This commit is contained in:
2018-10-08 18:20:10 +00:00
parent f6c9280a11
commit 40dc278310
15 changed files with 96 additions and 119 deletions

View File

@@ -230,9 +230,8 @@ namespace AyaNova.Api.Controllers
});
//EVENT LOG
EventLogProcessor.AddEntryToContextNoSave(new Event(UserId, attachToObject.ObjectId, attachToObject.ObjectType, AyaEvent.AttachmentCreate, v.DisplayFileName), ct);
ct.SaveChanges();
EventLogProcessor.LogEventToDatabase(new Event(UserId, attachToObject.ObjectId, attachToObject.ObjectType, AyaEvent.AttachmentCreate, v.DisplayFileName), ct);
//SEARCH INDEXING
Search.ProcessNewObjectKeywords(ct, UserLocaleIdFromContext.Id(HttpContext.Items), v.Id, AyaType.FileAttachment, v.DisplayFileName, v.DisplayFileName, v.Notes, v.StoredFileName);
@@ -301,9 +300,8 @@ namespace AyaNova.Api.Controllers
FileUtil.deleteFileAttachment(dbObj, ct);
//Event log process delete
EventLogProcessor.AddEntryToContextNoSave(new Event(UserId, dbObj.AttachToObjectId, dbObj.AttachToObjectType, AyaEvent.AttachmentDelete, dbObj.DisplayFileName), ct);
ct.SaveChanges();
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.AttachToObjectId, dbObj.AttachToObjectType, AyaEvent.AttachmentDelete, dbObj.DisplayFileName), ct);
//Delete search index
Search.ProcessDeletedObjectKeywords(ct, dbObj.Id, AyaType.FileAttachment);
@@ -384,8 +382,8 @@ namespace AyaNova.Api.Controllers
}
//Log
EventLogProcessor.AddEntryToContextNoSave(new Event(UserId, dbObj.AttachToObjectId, dbObj.AttachToObjectType, AyaEvent.AttachmentDownload, dbObj.DisplayFileName), ct);
ct.SaveChanges();
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.AttachToObjectId, dbObj.AttachToObjectType, AyaEvent.AttachmentDownload, dbObj.DisplayFileName), ct);
return PhysicalFile(filePath, mimetype, dbObj.DisplayFileName);
}