This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
@@ -127,9 +127,8 @@ namespace AyaNova.Api.Controllers
|
||||
}
|
||||
var ret = AyaNova.Core.License.LicenseInfoAsJson;
|
||||
//Log
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.License, AyaEvent.LicenseFetch), ct);
|
||||
ct.SaveChanges();
|
||||
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.License, AyaEvent.LicenseFetch), ct);
|
||||
|
||||
return Ok(new ApiOkResponse(ret));
|
||||
}
|
||||
|
||||
@@ -180,9 +179,8 @@ namespace AyaNova.Api.Controllers
|
||||
var ret = Core.License.RequestTrial(requestData.EmailAddress, requestData.RegisteredTo, log);
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.License, AyaEvent.LicenseTrialRequest), ct);
|
||||
ct.SaveChanges();
|
||||
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.License, AyaEvent.LicenseTrialRequest), ct);
|
||||
|
||||
return Ok(new ApiOkResponse(ret));
|
||||
}
|
||||
|
||||
|
||||
@@ -183,13 +183,6 @@ namespace AyaNova.Api.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
//save to get Id
|
||||
await ct.SaveChangesAsync();
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(biz.UserId, o.Id, AyaType.Locale, AyaEvent.Created), ct);
|
||||
await ct.SaveChangesAsync();
|
||||
|
||||
return CreatedAtAction("GetLocale", new { id = o.Id }, new ApiCreatedResponse(o));
|
||||
}
|
||||
}
|
||||
@@ -241,17 +234,12 @@ namespace AyaNova.Api.Controllers
|
||||
//Instantiate the business object handler
|
||||
LocaleBiz biz = new LocaleBiz(ct, UserIdFromContext.Id(HttpContext.Items), UserRolesFromContext.Roles(HttpContext.Items));
|
||||
|
||||
if (!biz.PutLocaleItemDisplayText(oFromDb, inObj, oDbParent))
|
||||
{
|
||||
return BadRequest(new ApiErrorResponse(biz.Errors));
|
||||
}
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(biz.UserId, oDbParent.Id, AyaType.Locale, AyaEvent.Modified), ct);
|
||||
|
||||
try
|
||||
{
|
||||
await ct.SaveChangesAsync();
|
||||
if (!biz.PutLocaleItemDisplayText(oFromDb, inObj, oDbParent))
|
||||
{
|
||||
return BadRequest(new ApiErrorResponse(biz.Errors));
|
||||
}
|
||||
}
|
||||
catch (DbUpdateConcurrencyException)
|
||||
{
|
||||
@@ -311,17 +299,13 @@ namespace AyaNova.Api.Controllers
|
||||
//Instantiate the business object handler
|
||||
LocaleBiz biz = new LocaleBiz(ct, UserIdFromContext.Id(HttpContext.Items), UserRolesFromContext.Roles(HttpContext.Items));
|
||||
|
||||
if (!biz.PutLocaleName(oFromDb, inObj))
|
||||
{
|
||||
return BadRequest(new ApiErrorResponse(biz.Errors));
|
||||
}
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(biz.UserId, oFromDb.Id, AyaType.Locale, AyaEvent.Modified), ct);
|
||||
|
||||
try
|
||||
{
|
||||
await ct.SaveChangesAsync();
|
||||
if (!biz.PutLocaleName(oFromDb, inObj))
|
||||
{
|
||||
return BadRequest(new ApiErrorResponse(biz.Errors));
|
||||
}
|
||||
|
||||
}
|
||||
catch (DbUpdateConcurrencyException)
|
||||
{
|
||||
|
||||
@@ -68,8 +68,7 @@ namespace AyaNova.Api.Controllers
|
||||
string sResult = await GetTheMetrics("plain");
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.Metrics, AyaEvent.Retrieved), ct);
|
||||
await ct.SaveChangesAsync();
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.Metrics, AyaEvent.Retrieved), ct);
|
||||
|
||||
return Content(sResult);
|
||||
}
|
||||
@@ -100,9 +99,8 @@ namespace AyaNova.Api.Controllers
|
||||
JObject json = JObject.Parse(sResult);
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.Metrics, AyaEvent.Retrieved), ct);
|
||||
await ct.SaveChangesAsync();
|
||||
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.Metrics, AyaEvent.Retrieved), ct);
|
||||
|
||||
return Ok(new ApiOkResponse(json));
|
||||
}
|
||||
|
||||
|
||||
@@ -95,8 +95,7 @@ namespace AyaNova.Api.Controllers
|
||||
serverState.SetState(desiredState, state.Reason);
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.ServerState, AyaEvent.ServerStateChange, $"{state.ServerState}-{state.Reason}"), ct);
|
||||
ct.SaveChanges();
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.ServerState, AyaEvent.ServerStateChange, $"{state.ServerState}-{state.Reason}"), ct);
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
@@ -100,12 +100,9 @@ namespace AyaNova.Api.Controllers
|
||||
JobsBiz.AddJob(j, ct);
|
||||
|
||||
//Log
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.TrialSeeder, AyaEvent.Created, size), ct);
|
||||
ct.SaveChanges();
|
||||
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.TrialSeeder, AyaEvent.Created, size), ct);
|
||||
|
||||
return Accepted(new { JobId = j.GId });//202 accepted
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -81,14 +81,14 @@ namespace AyaNova.Api.Controllers
|
||||
if (o == null)
|
||||
{
|
||||
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return Ok(new ApiOkResponse(o));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Put (update) UserOptions
|
||||
///
|
||||
@@ -111,7 +111,7 @@ namespace AyaNova.Api.Controllers
|
||||
{
|
||||
return BadRequest(new ApiErrorResponse(ModelState));
|
||||
}
|
||||
var UserId = UserIdFromContext.Id(HttpContext.Items);
|
||||
var UserId = UserIdFromContext.Id(HttpContext.Items);
|
||||
|
||||
var o = await ct.UserOptions.SingleOrDefaultAsync(m => m.UserId == id);
|
||||
|
||||
@@ -128,16 +128,12 @@ namespace AyaNova.Api.Controllers
|
||||
//Instantiate the business object handler
|
||||
UserOptionsBiz biz = new UserOptionsBiz(ct, UserIdFromContext.Id(HttpContext.Items), UserRolesFromContext.Roles(HttpContext.Items));
|
||||
|
||||
if (!biz.Put(o, inObj))
|
||||
{
|
||||
return BadRequest(new ApiErrorResponse(biz.Errors));
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
//Log
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(biz.UserId, o.Id, AyaType.UserOptions, AyaEvent.Modified), ct);
|
||||
await ct.SaveChangesAsync();
|
||||
if (!biz.Put(o, inObj))
|
||||
{
|
||||
return BadRequest(new ApiErrorResponse(biz.Errors));
|
||||
}
|
||||
}
|
||||
catch (DbUpdateConcurrencyException)
|
||||
{
|
||||
@@ -169,7 +165,7 @@ namespace AyaNova.Api.Controllers
|
||||
/// <returns></returns>
|
||||
[HttpPatch("{id}/{concurrencyToken}")]
|
||||
public async Task<IActionResult> PatchUserOptions([FromRoute] long id, [FromRoute] uint concurrencyToken, [FromBody]JsonPatchDocument<UserOptions> objectPatch)
|
||||
{
|
||||
{
|
||||
|
||||
if (!serverState.IsOpen)
|
||||
{
|
||||
@@ -181,7 +177,7 @@ namespace AyaNova.Api.Controllers
|
||||
return BadRequest(new ApiErrorResponse(ModelState));
|
||||
}
|
||||
|
||||
var UserId = UserIdFromContext.Id(HttpContext.Items);
|
||||
var UserId = UserIdFromContext.Id(HttpContext.Items);
|
||||
|
||||
//Instantiate the business object handler
|
||||
UserOptionsBiz biz = new UserOptionsBiz(ct, UserId, UserRolesFromContext.Roles(HttpContext.Items));
|
||||
@@ -198,17 +194,14 @@ namespace AyaNova.Api.Controllers
|
||||
return StatusCode(401, new ApiNotAuthorizedResponse());
|
||||
}
|
||||
|
||||
//patch and validate
|
||||
if (!biz.Patch(o, objectPatch, concurrencyToken))
|
||||
{
|
||||
return BadRequest(new ApiErrorResponse(biz.Errors));
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
//Log
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(biz.UserId, o.Id, AyaType.UserOptions, AyaEvent.Modified), ct);
|
||||
await ct.SaveChangesAsync();
|
||||
//patch and validate
|
||||
if (!biz.Patch(o, objectPatch, concurrencyToken))
|
||||
{
|
||||
return BadRequest(new ApiErrorResponse(biz.Errors));
|
||||
}
|
||||
}
|
||||
catch (DbUpdateConcurrencyException)
|
||||
{
|
||||
|
||||
@@ -13,18 +13,18 @@ namespace AyaNova.Biz
|
||||
{
|
||||
internal static class EventLogProcessor
|
||||
{
|
||||
private static ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger("EventLogProcessor");
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Add an entry to the log
|
||||
/// DOES NOT SAVE
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="newEvent"></param>
|
||||
/// <param name="ct"></param>
|
||||
/// <returns></returns>
|
||||
internal static void AddEntryToContextNoSave(Event newEvent, AyContext ct)
|
||||
internal static void LogEventToDatabase(Event newEvent, AyContext ct)
|
||||
{
|
||||
ct.Event.Add(newEvent);
|
||||
ct.Event.Add(newEvent);
|
||||
ct.SaveChanges();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -249,10 +249,10 @@ namespace AyaNova.Biz
|
||||
|
||||
//handle EventLog entries for users now that we have the user's created
|
||||
//Created
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(Creator, RavenId, ayaType, AyaEvent.Created, Created), ct);
|
||||
EventLogProcessor.LogEventToDatabase(new Event(Creator, RavenId, ayaType, AyaEvent.Created, Created), ct);
|
||||
//MODIFIED
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(Modifier, RavenId, ayaType, AyaEvent.Modified, Modified), ct);
|
||||
await ct.SaveChangesAsync();
|
||||
EventLogProcessor.LogEventToDatabase(new Event(Modifier, RavenId, ayaType, AyaEvent.Modified, Modified), ct);
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -63,6 +63,9 @@ namespace AyaNova.Biz
|
||||
|
||||
//Add it to the context so the controller can save it
|
||||
ct.Locale.Add(NewLocale);
|
||||
await ct.SaveChangesAsync();
|
||||
//Log
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, NewLocale.Id, AyaType.Locale, AyaEvent.Created), ct);
|
||||
return NewLocale;
|
||||
|
||||
}
|
||||
@@ -223,6 +226,10 @@ namespace AyaNova.Biz
|
||||
|
||||
if (HasErrors)
|
||||
return false;
|
||||
ct.SaveChanges();
|
||||
|
||||
//Log
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbParent.Id, AyaType.Locale, AyaEvent.Modified), ct);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -247,6 +254,10 @@ namespace AyaNova.Biz
|
||||
if (HasErrors)
|
||||
return false;
|
||||
|
||||
ct.SaveChanges();
|
||||
//Log
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, AyaType.Locale, AyaEvent.Modified), ct);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -537,8 +548,7 @@ namespace AyaNova.Biz
|
||||
ct.SaveChanges();
|
||||
|
||||
//Log now that we have the Id, note that there is no source created / modified for this so just attributing to current userId
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserId, l.Id, AyaType.Locale, AyaEvent.Created), ct);
|
||||
ct.SaveChanges();
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, l.Id, AyaType.Locale, AyaEvent.Created), ct);
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -76,8 +76,7 @@ namespace AyaNova.Biz
|
||||
//Handle child and associated items:
|
||||
|
||||
//EVENT LOG
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), ct);
|
||||
await ct.SaveChangesAsync();
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), ct);
|
||||
|
||||
//SEARCH INDEXING
|
||||
Search.ProcessNewObjectKeywords(ct, UserLocaleId, outObj.Id, BizType, outObj.Name, outObj.Name);
|
||||
@@ -185,8 +184,8 @@ namespace AyaNova.Biz
|
||||
return false;
|
||||
|
||||
//Log modification
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
||||
ct.SaveChanges();
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
||||
|
||||
//Update keywords
|
||||
Search.ProcessUpdatedObjectKeywords(ct, UserLocaleId, dbObj.Id, BizType, dbObj.Name, dbObj.Name);
|
||||
|
||||
@@ -210,8 +209,8 @@ namespace AyaNova.Biz
|
||||
return false;
|
||||
|
||||
//Log modification
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
||||
ct.SaveChanges();
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
||||
|
||||
//Update keywords
|
||||
Search.ProcessUpdatedObjectKeywords(ct, UserLocaleId, dbObj.Id, BizType, dbObj.Name, dbObj.Name);
|
||||
|
||||
@@ -258,8 +257,8 @@ namespace AyaNova.Biz
|
||||
ct.Database.ExecuteSqlCommand($"delete from atagmap where tagid = {dbObj.Id}");
|
||||
ct.Database.ExecuteSqlCommand($"delete from ataggroupmap where tagid = {dbObj.Id}");
|
||||
//Log
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserId, dbObj.Id, BizType, AyaEvent.TagMassUntag), ct);
|
||||
ct.SaveChanges();
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.TagMassUntag), ct);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,9 +66,8 @@ namespace AyaNova.Biz
|
||||
await ct.TagGroup.AddAsync(outObj);
|
||||
|
||||
//EVENT LOG
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), ct);
|
||||
await ct.SaveChangesAsync();
|
||||
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), ct);
|
||||
|
||||
//SEARCH INDEXING
|
||||
Search.ProcessNewObjectKeywords(ct, UserLocaleId, outObj.Id, BizType, outObj.Name, outObj.Name);
|
||||
|
||||
@@ -202,8 +201,8 @@ namespace AyaNova.Biz
|
||||
return false;
|
||||
|
||||
//Log modification
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
||||
ct.SaveChanges();
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
||||
|
||||
//Update keywords
|
||||
Search.ProcessUpdatedObjectKeywords(ct, UserLocaleId, dbObj.Id, BizType, dbObj.Name, dbObj.Name);
|
||||
|
||||
@@ -226,8 +225,8 @@ namespace AyaNova.Biz
|
||||
return false;
|
||||
|
||||
//Log modification
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
||||
ct.SaveChanges();
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
||||
|
||||
//Update keywords
|
||||
Search.ProcessUpdatedObjectKeywords(ct, UserLocaleId, dbObj.Id, BizType, dbObj.Name, dbObj.Name);
|
||||
|
||||
|
||||
@@ -72,9 +72,8 @@ namespace AyaNova.Biz
|
||||
//Handle child and associated items
|
||||
|
||||
//Log event
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), ct);
|
||||
await ct.SaveChangesAsync();
|
||||
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), ct);
|
||||
|
||||
//SEARCH INDEXING
|
||||
Search.ProcessNewObjectKeywords(ct, UserLocaleId, outObj.Id, BizType, outObj.Name, outObj.EmployeeNumber, outObj.Notes, outObj.Name);
|
||||
|
||||
@@ -110,9 +109,8 @@ namespace AyaNova.Biz
|
||||
//Handle child and associated items
|
||||
|
||||
//Log event
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), TempContext);
|
||||
//ct.SaveChanges();
|
||||
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), TempContext);
|
||||
|
||||
//SEARCH INDEXING
|
||||
Search.ProcessNewObjectKeywords(TempContext, UserLocaleId, outObj.Id, BizType, outObj.Name, outObj.EmployeeNumber, outObj.Notes, outObj.Name);
|
||||
|
||||
@@ -132,8 +130,7 @@ namespace AyaNova.Biz
|
||||
if (ret != null)
|
||||
{
|
||||
//Log
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserId, fetchId, BizType, AyaEvent.Retrieved), ct);
|
||||
ct.SaveChanges();
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, fetchId, BizType, AyaEvent.Retrieved), ct);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -254,8 +251,7 @@ namespace AyaNova.Biz
|
||||
|
||||
|
||||
//Log modification
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
||||
ct.SaveChanges();
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
||||
//Update keywords
|
||||
Search.ProcessUpdatedObjectKeywords(ct, UserLocaleId, dbObj.Id, BizType, dbObj.Name, dbObj.EmployeeNumber, dbObj.Notes, dbObj.Name);
|
||||
|
||||
@@ -288,8 +284,8 @@ namespace AyaNova.Biz
|
||||
return false;
|
||||
|
||||
//Log modification
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
||||
ct.SaveChanges();
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
||||
|
||||
//Update keywords
|
||||
Search.ProcessUpdatedObjectKeywords(ct, UserLocaleId, dbObj.Id, BizType, dbObj.Name, dbObj.EmployeeNumber, dbObj.Notes, dbObj.Name);
|
||||
|
||||
|
||||
@@ -56,6 +56,9 @@ namespace AyaNova.Biz
|
||||
if (HasErrors)
|
||||
return false;
|
||||
|
||||
ct.SaveChanges();
|
||||
//Log
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, AyaType.UserOptions, AyaEvent.Modified), ct);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -72,6 +75,10 @@ namespace AyaNova.Biz
|
||||
Validate(dbObj);
|
||||
if (HasErrors)
|
||||
return false;
|
||||
|
||||
ct.SaveChanges();
|
||||
//Log
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, AyaType.UserOptions, AyaEvent.Modified), ct);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -72,9 +72,8 @@ namespace AyaNova.Biz
|
||||
//Handle child and associated items:
|
||||
|
||||
//EVENT LOG
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), ct);
|
||||
await ct.SaveChangesAsync();
|
||||
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), ct);
|
||||
|
||||
//SEARCH INDEXING
|
||||
Search.ProcessNewObjectKeywords(ct, UserLocaleId, outObj.Id, BizType, outObj.Name, outObj.Notes, outObj.Name);
|
||||
|
||||
@@ -101,7 +100,8 @@ namespace AyaNova.Biz
|
||||
//Handle child and associated items:
|
||||
|
||||
//EVENT LOG
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), TempContext);
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), TempContext);
|
||||
|
||||
//SEARCH INDEXING
|
||||
Search.ProcessNewObjectKeywords(TempContext, UserLocaleId, outObj.Id, BizType, outObj.Name, outObj.Notes, outObj.Name);
|
||||
|
||||
@@ -121,8 +121,7 @@ namespace AyaNova.Biz
|
||||
if (ret != null)
|
||||
{
|
||||
//Log
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserId, fetchId, BizType, AyaEvent.Retrieved), ct);
|
||||
ct.SaveChanges();
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, fetchId, BizType, AyaEvent.Retrieved), ct);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -217,8 +216,8 @@ namespace AyaNova.Biz
|
||||
return false;
|
||||
|
||||
//Log modification
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
||||
ct.SaveChanges();
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
||||
|
||||
//Update keywords
|
||||
Search.ProcessUpdatedObjectKeywords(ct, UserLocaleId, dbObj.Id, BizType, dbObj.Name, dbObj.Notes, dbObj.Name);
|
||||
|
||||
@@ -239,8 +238,8 @@ namespace AyaNova.Biz
|
||||
return false;
|
||||
|
||||
//Log modification
|
||||
EventLogProcessor.AddEntryToContextNoSave(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
||||
ct.SaveChanges();
|
||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
||||
|
||||
//Update keywords
|
||||
Search.ProcessUpdatedObjectKeywords(ct, UserLocaleId, dbObj.Id, BizType, dbObj.Name, dbObj.Notes, dbObj.Name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user