This commit is contained in:
2018-08-28 23:25:50 +00:00
parent 78ce79fc5c
commit 6374b386d6
11 changed files with 70 additions and 65 deletions

View File

@@ -22,23 +22,12 @@ namespace AyaNova.Biz
/// <param name="newEvent"></param>
/// <param name="ct"></param>
/// <returns></returns>
internal static void AddEntryNoSave(Event newEvent, AyContext ct)
internal static void AddEntry(Event newEvent, AyContext ct)
{
ct.Event.Add(newEvent);
}
/// <summary>
/// Add and SAVE entry to the log
/// </summary>
/// <param name="newEvent"></param>
/// <param name="ct"></param>
/// <returns></returns>
internal static void AddEntryAndSave(Event newEvent, AyContext ct)
{
ct.Event.Add(newEvent);
ct.SaveChanges();
}
/// <summary>
/// Handle delete
@@ -52,8 +41,7 @@ namespace AyaNova.Biz
internal static void DeleteObject(long userId, AyaType ayType, long ayId, string textra, AyContext ct)
{
ct.Database.ExecuteSqlCommand($"delete from aevent where aytype = {ayType} and ayid={ayId}");
ct.Event.Add(new Event(userId, ayId, ayType, AyaEvent.Deleted, textra));
ct.SaveChanges();
ct.Event.Add(new Event(userId, ayId, ayType, AyaEvent.Deleted, textra));
}
/// <summary>