This commit is contained in:
@@ -38,7 +38,6 @@ TEST CHANGES
|
|||||||
TODO: REFACTOR GetNoLogAsync function is used in many places redundantly when the logging version could do the same thing but not log it with an optional bool switch so refactor that shit
|
TODO: REFACTOR GetNoLogAsync function is used in many places redundantly when the logging version could do the same thing but not log it with an optional bool switch so refactor that shit
|
||||||
TODO: REFACTOR biz objects have two creates, an async and sync one, WTF is that about? See if can make it just one async version.
|
TODO: REFACTOR biz objects have two creates, an async and sync one, WTF is that about? See if can make it just one async version.
|
||||||
|
|
||||||
|
|
||||||
DO CLIENT STUFF NOW COME BACK TO THIS STUFF LATER
|
DO CLIENT STUFF NOW COME BACK TO THIS STUFF LATER
|
||||||
|
|
||||||
TODO: the license being logged breaks the format of the log file because it has line breaks etc, so instead, maybe log out as a single line (remove breaks)
|
TODO: the license being logged breaks the format of the log file because it has line breaks etc, so instead, maybe log out as a single line (remove breaks)
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
});
|
});
|
||||||
|
|
||||||
//EVENT LOG
|
//EVENT LOG
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, attachToObject.ObjectId, attachToObject.ObjectType, AyaEvent.AttachmentCreate, v.DisplayFileName), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, attachToObject.ObjectId, attachToObject.ObjectType, AyaEvent.AttachmentCreate, v.DisplayFileName), ct);
|
||||||
|
|
||||||
//SEARCH INDEXING
|
//SEARCH INDEXING
|
||||||
// Search.ProcessNewObjectKeywords( UserLocaleIdFromContext.Id(HttpContext.Items), v.Id, AyaType.FileAttachment, v.DisplayFileName, v.DisplayFileName, v.Notes, v.StoredFileName);
|
// Search.ProcessNewObjectKeywords( UserLocaleIdFromContext.Id(HttpContext.Items), v.Id, AyaType.FileAttachment, v.DisplayFileName, v.DisplayFileName, v.Notes, v.StoredFileName);
|
||||||
@@ -306,7 +306,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
FileUtil.deleteFileAttachment(dbObj, ct);
|
FileUtil.deleteFileAttachment(dbObj, ct);
|
||||||
|
|
||||||
//Event log process delete
|
//Event log process delete
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.AttachToObjectId, dbObj.AttachToObjectType, AyaEvent.AttachmentDelete, dbObj.DisplayFileName), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, dbObj.AttachToObjectId, dbObj.AttachToObjectType, AyaEvent.AttachmentDelete, dbObj.DisplayFileName), ct);
|
||||||
|
|
||||||
//Delete search index
|
//Delete search index
|
||||||
Search.ProcessDeletedObjectKeywords(dbObj.Id, AyaType.FileAttachment);
|
Search.ProcessDeletedObjectKeywords(dbObj.Id, AyaType.FileAttachment);
|
||||||
@@ -388,7 +388,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Log
|
//Log
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.AttachToObjectId, dbObj.AttachToObjectType, AyaEvent.AttachmentDownload, dbObj.DisplayFileName), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, dbObj.AttachToObjectId, dbObj.AttachToObjectType, AyaEvent.AttachmentDownload, dbObj.DisplayFileName), ct);
|
||||||
|
|
||||||
return PhysicalFile(filePath, mimetype, dbObj.DisplayFileName);
|
return PhysicalFile(filePath, mimetype, dbObj.DisplayFileName);
|
||||||
|
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
}
|
}
|
||||||
var ret = AyaNova.Core.License.LicenseInfoAsJson;
|
var ret = AyaNova.Core.License.LicenseInfoAsJson;
|
||||||
//Log
|
//Log
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.License, AyaEvent.LicenseFetch), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.License, AyaEvent.LicenseFetch), ct);
|
||||||
|
|
||||||
return Ok(ApiOkResponse.Response(ret, true));
|
return Ok(ApiOkResponse.Response(ret, true));
|
||||||
}
|
}
|
||||||
@@ -180,7 +180,7 @@ 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.LogEventToDatabase(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.License, AyaEvent.LicenseTrialRequest), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.License, AyaEvent.LicenseTrialRequest), ct);
|
||||||
|
|
||||||
return Ok(ApiOkResponse.Response(ret, true));
|
return Ok(ApiOkResponse.Response(ret, true));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
string sResult = await GetTheMetrics("plain");
|
string sResult = await GetTheMetrics("plain");
|
||||||
|
|
||||||
//Log
|
//Log
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.Metrics, AyaEvent.Retrieved), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.Metrics, AyaEvent.Retrieved), ct);
|
||||||
|
|
||||||
return Content(sResult);
|
return Content(sResult);
|
||||||
}
|
}
|
||||||
@@ -100,7 +100,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
JObject json = JObject.Parse(sResult);
|
JObject json = JObject.Parse(sResult);
|
||||||
|
|
||||||
//Log
|
//Log
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.Metrics, AyaEvent.Retrieved), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.Metrics, AyaEvent.Retrieved), ct);
|
||||||
|
|
||||||
return Ok(ApiOkResponse.Response(json, true));
|
return Ok(ApiOkResponse.Response(json, true));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
serverState.SetState(desiredState, state.Reason);
|
serverState.SetState(desiredState, state.Reason);
|
||||||
|
|
||||||
//Log
|
//Log
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.ServerState, AyaEvent.ServerStateChange, $"{state.ServerState}-{state.Reason}"), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.ServerState, AyaEvent.ServerStateChange, $"{state.ServerState}-{state.Reason}"), ct);
|
||||||
|
|
||||||
return NoContent();
|
return NoContent();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
JobsBiz.AddJob(j, ct);
|
JobsBiz.AddJob(j, ct);
|
||||||
|
|
||||||
//Log
|
//Log
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.TrialSeeder, AyaEvent.Created, size), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.TrialSeeder, AyaEvent.Created, size), ct);
|
||||||
|
|
||||||
return Accepted(new { JobId = j.GId });//202 accepted
|
return Accepted(new { JobId = j.GId });//202 accepted
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,6 +77,44 @@ namespace AyaNova.DataList
|
|||||||
|
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//make sure the template parses and all the fields specified are really existant
|
||||||
|
//this is more for dev errors or api users becuase the client shouldn't generate bad templates
|
||||||
|
public bool ValidateTemplate(string template)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//parse the template
|
||||||
|
var jtemplate = JObject.Parse(template);
|
||||||
|
var fullFields = ((JArray)jtemplate["full"]).ToObject<string[]>();
|
||||||
|
var miniFields = ((JArray)jtemplate["mini"]).ToObject<string[]>();
|
||||||
|
|
||||||
|
foreach (string s in fullFields)
|
||||||
|
{
|
||||||
|
AyaDataListFieldDefinition o = FieldDefinitions.FirstOrDefault(x => x.FieldKey == s);
|
||||||
|
if (o == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (string s in miniFields)
|
||||||
|
{
|
||||||
|
AyaDataListFieldDefinition o = FieldDefinitions.FirstOrDefault(x => x.FieldKey == s);
|
||||||
|
if (o == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}//eoc
|
}//eoc
|
||||||
|
|
||||||
}//eons
|
}//eons
|
||||||
@@ -32,19 +32,19 @@ namespace AyaNova.DataList
|
|||||||
}
|
}
|
||||||
|
|
||||||
//FETCH DATALISTTEMPLATE HERE OR USE DEFAULT IF FAULTY OR NOT FOUND
|
//FETCH DATALISTTEMPLATE HERE OR USE DEFAULT IF FAULTY OR NOT FOUND
|
||||||
|
|
||||||
//start with default
|
//start with default
|
||||||
string JSONDataListTemplate=DataList.DefaultDataListDisplayTemplate;
|
string JSONDataListTemplate = DataList.DefaultDataListDisplayTemplate;
|
||||||
|
|
||||||
var CustomDataListTemplate = await ct.DataListTemplate.FirstOrDefaultAsync(x => x.DataListKey == listOptions.DataListKey);
|
var CustomDataListTemplate = await ct.DataListTemplate.FirstOrDefaultAsync(x => x.DataListKey == listOptions.DataListKey);
|
||||||
//Null is expected unless user has created a new one
|
//Null is expected unless user has created a custom one
|
||||||
if(CustomDataListTemplate!=null){
|
if (CustomDataListTemplate != null)
|
||||||
//todo: validate the template first here need a new method to do that
|
{
|
||||||
//Assuming it's valid then use it
|
//Make sure it's valid, if not then don't use it
|
||||||
JSONDataListTemplate = CustomDataListTemplate.Template;
|
if (DataList.ValidateTemplate(CustomDataListTemplate.Template))
|
||||||
|
JSONDataListTemplate = CustomDataListTemplate.Template;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//PARSE THE TEMPLATE INTO A STRING ARRAY
|
//PARSE THE TEMPLATE INTO A STRING ARRAY
|
||||||
//SO WE KNOW WHICH FIELDS TO RETURN FROM QUERY
|
//SO WE KNOW WHICH FIELDS TO RETURN FROM QUERY
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ namespace AyaNova.DataList
|
|||||||
string GenerateMINIListColumnsJSON();
|
string GenerateMINIListColumnsJSON();
|
||||||
string GenerateListColumnsJSONFromTemplate(string template);
|
string GenerateListColumnsJSONFromTemplate(string template);
|
||||||
|
|
||||||
|
bool ValidateTemplate(string template);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ namespace AyaNova.Biz
|
|||||||
//Handle child and associated items:
|
//Handle child and associated items:
|
||||||
|
|
||||||
//EVENT LOG
|
//EVENT LOG
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), ct);
|
||||||
|
|
||||||
//SEARCH INDEXING
|
//SEARCH INDEXING
|
||||||
// Search.ProcessNewObjectKeywords(UserLocaleId, outObj.Id, BizType, outObj.Name, outObj.Name);
|
// Search.ProcessNewObjectKeywords(UserLocaleId, outObj.Id, BizType, outObj.Name, outObj.Name);
|
||||||
@@ -101,7 +101,7 @@ namespace AyaNova.Biz
|
|||||||
//Handle child and associated items:
|
//Handle child and associated items:
|
||||||
|
|
||||||
//EVENT LOG
|
//EVENT LOG
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), TempContext);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), TempContext);
|
||||||
|
|
||||||
//SEARCH INDEXING
|
//SEARCH INDEXING
|
||||||
// Search.ProcessNewObjectKeywords(UserLocaleId, outObj.Id, BizType, outObj.Name, outObj.Name);
|
// Search.ProcessNewObjectKeywords(UserLocaleId, outObj.Id, BizType, outObj.Name, outObj.Name);
|
||||||
@@ -122,7 +122,7 @@ namespace AyaNova.Biz
|
|||||||
if (ret != null)
|
if (ret != null)
|
||||||
{
|
{
|
||||||
//Log
|
//Log
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, fetchId, BizType, AyaEvent.Retrieved), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, fetchId, BizType, AyaEvent.Retrieved), ct);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -173,7 +173,7 @@ namespace AyaNova.Biz
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
//Log modification
|
//Log modification
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
||||||
|
|
||||||
//Update keywords
|
//Update keywords
|
||||||
// Search.ProcessUpdatedObjectKeywords(UserLocaleId, dbObj.Id, BizType, dbObj.Name, dbObj.Name);
|
// Search.ProcessUpdatedObjectKeywords(UserLocaleId, dbObj.Id, BizType, dbObj.Name, dbObj.Name);
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Collections.Generic;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using AyaNova.Util;
|
using AyaNova.Util;
|
||||||
@@ -57,7 +56,7 @@ namespace AyaNova.Biz
|
|||||||
if (log)
|
if (log)
|
||||||
{
|
{
|
||||||
//Log
|
//Log
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, ret.Id, BizType, AyaEvent.Retrieved), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, ret.Id, BizType, AyaEvent.Retrieved), ct);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -83,7 +82,7 @@ namespace AyaNova.Biz
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
//Log modification
|
//Log modification
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -106,7 +105,7 @@ namespace AyaNova.Biz
|
|||||||
//Delete sibling objects
|
//Delete sibling objects
|
||||||
|
|
||||||
//Event log process delete
|
//Event log process delete
|
||||||
EventLogProcessor.DeleteObject(UserId, BizType, dbObj.Id, dbObj.Name, ct);
|
EventLogProcessor.DeleteObject(UserId, BizType, dbObj.Id, dbObj.DataListKey, ct);
|
||||||
ct.SaveChanges();
|
ct.SaveChanges();
|
||||||
|
|
||||||
//Delete search index
|
//Delete search index
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace AyaNova.Biz
|
|||||||
{
|
{
|
||||||
internal static class EventLogProcessor
|
internal static class EventLogProcessor
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add an entry to the log
|
/// Add an entry to the log
|
||||||
///
|
///
|
||||||
@@ -21,13 +21,13 @@ namespace AyaNova.Biz
|
|||||||
/// <param name="newEvent"></param>
|
/// <param name="newEvent"></param>
|
||||||
/// <param name="ct"></param>
|
/// <param name="ct"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
internal static void LogEventToDatabase(Event newEvent, AyContext ct)
|
internal static void LogEventToDatabaseAndSaveEntireContext(Event newEvent, AyContext ct)
|
||||||
{
|
{
|
||||||
ct.Event.Add(newEvent);
|
ct.Event.Add(newEvent);
|
||||||
ct.SaveChanges();
|
ct.SaveChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handle delete
|
/// Handle delete
|
||||||
@@ -41,7 +41,7 @@ namespace AyaNova.Biz
|
|||||||
internal static void DeleteObject(long userId, AyaType ayType, long ayId, string textra, AyContext ct)
|
internal static void DeleteObject(long userId, AyaType ayType, long ayId, string textra, AyContext ct)
|
||||||
{
|
{
|
||||||
ct.Database.ExecuteSqlInterpolated($"delete from aevent where aytype = {ayType} and ayid={ayId}");
|
ct.Database.ExecuteSqlInterpolated($"delete from aevent where aytype = {ayType} and ayid={ayId}");
|
||||||
ct.Event.Add(new Event(userId, ayId, ayType, AyaEvent.Deleted, textra));
|
ct.Event.Add(new Event(userId, ayId, ayType, AyaEvent.Deleted, textra));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ namespace AyaNova.Biz
|
|||||||
//Handle child and associated items:
|
//Handle child and associated items:
|
||||||
|
|
||||||
//EVENT LOG
|
//EVENT LOG
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), ct);
|
||||||
|
|
||||||
//SEARCH INDEXING
|
//SEARCH INDEXING
|
||||||
// Search.ProcessNewObjectKeywords(UserLocaleId, outObj.Id, BizType, outObj.Name, outObj.Name);
|
// Search.ProcessNewObjectKeywords(UserLocaleId, outObj.Id, BizType, outObj.Name, outObj.Name);
|
||||||
@@ -141,7 +141,7 @@ namespace AyaNova.Biz
|
|||||||
dbObj.Template = JsonUtil.CompactJson(dbObj.Template);
|
dbObj.Template = JsonUtil.CompactJson(dbObj.Template);
|
||||||
|
|
||||||
//Log modification
|
//Log modification
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
||||||
|
|
||||||
//Update keywords
|
//Update keywords
|
||||||
// Search.ProcessUpdatedObjectKeywords(UserLocaleId, dbObj.Id, BizType, dbObj.Name, dbObj.Name);
|
// Search.ProcessUpdatedObjectKeywords(UserLocaleId, dbObj.Id, BizType, dbObj.Name, dbObj.Name);
|
||||||
|
|||||||
@@ -349,9 +349,9 @@ 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.LogEventToDatabase(new Event(Creator, RavenId, ayaType, AyaEvent.Created, Created), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(Creator, RavenId, ayaType, AyaEvent.Created, Created), ct);
|
||||||
//MODIFIED
|
//MODIFIED
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(Modifier, RavenId, ayaType, AyaEvent.Modified, Modified), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(Modifier, RavenId, ayaType, AyaEvent.Modified, Modified), ct);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ namespace AyaNova.Biz
|
|||||||
ct.Locale.Add(NewLocale);
|
ct.Locale.Add(NewLocale);
|
||||||
await ct.SaveChangesAsync();
|
await ct.SaveChangesAsync();
|
||||||
//Log
|
//Log
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, NewLocale.Id, AyaType.Locale, AyaEvent.Created), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, NewLocale.Id, AyaType.Locale, AyaEvent.Created), ct);
|
||||||
return NewLocale;
|
return NewLocale;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -242,7 +242,7 @@ namespace AyaNova.Biz
|
|||||||
ct.SaveChanges();
|
ct.SaveChanges();
|
||||||
|
|
||||||
//Log
|
//Log
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbParent.Id, AyaType.Locale, AyaEvent.Modified), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, dbParent.Id, AyaType.Locale, AyaEvent.Modified), ct);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -269,7 +269,7 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
ct.SaveChanges();
|
ct.SaveChanges();
|
||||||
//Log
|
//Log
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, AyaType.Locale, AyaEvent.Modified), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, dbObj.Id, AyaType.Locale, AyaEvent.Modified), ct);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -611,7 +611,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.LogEventToDatabase(new Event(UserId, l.Id, AyaType.Locale, AyaEvent.Created), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, l.Id, AyaType.Locale, AyaEvent.Created), ct);
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ namespace AyaNova.Biz
|
|||||||
//Handle child and associated items
|
//Handle child and associated items
|
||||||
|
|
||||||
//Log event
|
//Log event
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, inObj.Id, BizType, AyaEvent.Created), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, inObj.Id, BizType, AyaEvent.Created), ct);
|
||||||
|
|
||||||
//SEARCH INDEXING
|
//SEARCH INDEXING
|
||||||
SearchIndex(inObj, true);
|
SearchIndex(inObj, true);
|
||||||
@@ -122,7 +122,7 @@ namespace AyaNova.Biz
|
|||||||
//Handle child and associated items
|
//Handle child and associated items
|
||||||
|
|
||||||
//Log event
|
//Log event
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, inObj.Id, BizType, AyaEvent.Created), TempContext);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, inObj.Id, BizType, AyaEvent.Created), TempContext);
|
||||||
|
|
||||||
//SEARCH INDEXING
|
//SEARCH INDEXING
|
||||||
SearchIndex(inObj, true);
|
SearchIndex(inObj, true);
|
||||||
@@ -146,7 +146,7 @@ namespace AyaNova.Biz
|
|||||||
if (ret != null)
|
if (ret != null)
|
||||||
{
|
{
|
||||||
//Log
|
//Log
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, fetchId, BizType, AyaEvent.Retrieved), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, fetchId, BizType, AyaEvent.Retrieved), ct);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -301,7 +301,7 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
|
|
||||||
//Log modification
|
//Log modification
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
||||||
|
|
||||||
SearchIndex(dbObj, false);
|
SearchIndex(dbObj, false);
|
||||||
|
|
||||||
@@ -338,7 +338,7 @@ namespace AyaNova.Biz
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
//Log modification
|
//Log modification
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
||||||
SearchIndex(dbObj, false);
|
SearchIndex(dbObj, false);
|
||||||
|
|
||||||
TagUtil.ProcessUpdateTagsInRepository(ct, dbObj.Tags, SnapshotOfOriginalDBObj.Tags);
|
TagUtil.ProcessUpdateTagsInRepository(ct, dbObj.Tags, SnapshotOfOriginalDBObj.Tags);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
ct.SaveChanges();
|
ct.SaveChanges();
|
||||||
//Log
|
//Log
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, AyaType.UserOptions, AyaEvent.Modified), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, dbObj.Id, AyaType.UserOptions, AyaEvent.Modified), ct);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
ct.SaveChanges();
|
ct.SaveChanges();
|
||||||
//Log
|
//Log
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, AyaType.UserOptions, AyaEvent.Modified), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, dbObj.Id, AyaType.UserOptions, AyaEvent.Modified), ct);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ namespace AyaNova.Biz
|
|||||||
if (ret != null)
|
if (ret != null)
|
||||||
{
|
{
|
||||||
//Log
|
//Log
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, fetchId, BizType, AyaEvent.Retrieved), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, fetchId, BizType, AyaEvent.Retrieved), ct);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -95,7 +95,7 @@ namespace AyaNova.Biz
|
|||||||
await ct.SaveChangesAsync();
|
await ct.SaveChangesAsync();
|
||||||
|
|
||||||
//Handle child and associated items:
|
//Handle child and associated items:
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), ct);
|
||||||
SearchIndex(outObj, true);
|
SearchIndex(outObj, true);
|
||||||
TagUtil.ProcessUpdateTagsInRepository(ct, outObj.Tags, null);
|
TagUtil.ProcessUpdateTagsInRepository(ct, outObj.Tags, null);
|
||||||
return outObj;
|
return outObj;
|
||||||
@@ -123,7 +123,7 @@ namespace AyaNova.Biz
|
|||||||
TempContext.SaveChanges();
|
TempContext.SaveChanges();
|
||||||
|
|
||||||
//Handle child and associated items:
|
//Handle child and associated items:
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), TempContext);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), TempContext);
|
||||||
SearchIndex(outObj, true);
|
SearchIndex(outObj, true);
|
||||||
TagUtil.ProcessUpdateTagsInRepository(TempContext, outObj.Tags, null);
|
TagUtil.ProcessUpdateTagsInRepository(TempContext, outObj.Tags, null);
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@ namespace AyaNova.Biz
|
|||||||
await ct.SaveChangesAsync();
|
await ct.SaveChangesAsync();
|
||||||
|
|
||||||
//Handle child and associated items:
|
//Handle child and associated items:
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), ct);
|
||||||
SearchIndex(outObj, true);
|
SearchIndex(outObj, true);
|
||||||
TagUtil.ProcessUpdateTagsInRepository(ct, outObj.Tags, null);
|
TagUtil.ProcessUpdateTagsInRepository(ct, outObj.Tags, null);
|
||||||
return outObj;
|
return outObj;
|
||||||
@@ -187,7 +187,7 @@ namespace AyaNova.Biz
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
//Associated items
|
//Associated items
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
||||||
SearchIndex(dbObj, false);
|
SearchIndex(dbObj, false);
|
||||||
TagUtil.ProcessUpdateTagsInRepository(ct, dbObj.Tags, SnapshotOfOriginalDBObj.Tags);
|
TagUtil.ProcessUpdateTagsInRepository(ct, dbObj.Tags, SnapshotOfOriginalDBObj.Tags);
|
||||||
|
|
||||||
@@ -217,7 +217,7 @@ namespace AyaNova.Biz
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
//Associated items
|
//Associated items
|
||||||
EventLogProcessor.LogEventToDatabase(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, dbObj.Id, BizType, AyaEvent.Modified), ct);
|
||||||
SearchIndex(dbObj, false);
|
SearchIndex(dbObj, false);
|
||||||
|
|
||||||
TagUtil.ProcessUpdateTagsInRepository(ct, dbObj.Tags, SnapshotOfOriginalDBObj.Tags);
|
TagUtil.ProcessUpdateTagsInRepository(ct, dbObj.Tags, SnapshotOfOriginalDBObj.Tags);
|
||||||
|
|||||||
Reference in New Issue
Block a user