public bool DeleteLog(int id) { using (var suspect = new SuspictionModel()) { suspect.Logs.Remove(suspect.Logs.First(x => x.logId == id)); suspect.SaveChanges(); var res = triggerPusher(); } return(false); }
public bool AddLog(LogModel logToSave) { LogModel log = logToSave; using (var suspect = new SuspictionModel()) { suspect.Logs.Add(log); suspect.SaveChanges(); var res = triggerPusher(); } return(false); }
public bool UpdateLog(LogModel log) { LogModel logToSave = log; using (var suspect = new SuspictionModel()) { LogModel logToUpdate = suspect.Logs.First(x => x.logId == logToSave.logId); logToUpdate.header = logToSave.header; logToUpdate.phone = logToSave.phone; logToUpdate.useremail = logToSave.useremail; logToUpdate.username = logToSave.username; logToUpdate.type = logToSave.type; suspect.SaveChanges(); var res = triggerPusher(); } return(false); }