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