//Modify the Count Based on the Date public int ModifyJerkCount(DateTime jdate, int jtimes) { try { Jlog jObj = context.Jlog.Find(jdate); if (jObj != null) { jObj.Ntimes = jtimes; context.SaveChanges(); status = 1; } } catch (Exception e) { Console.WriteLine(e.Message); status = -99; } return(status); }
//Delete Particular Entry Based on Date public int DeleteJerk(DateTime jdate) { try { Jlog jObj = context.Jlog.Find(jdate); if (jObj != null) { context.Jlog.Remove(jObj); context.SaveChanges(); status = 1; } } catch (Exception e) { Console.WriteLine(e.Message); status = -99; } return(status); }
//Add Details public int AddJerk(DateTime jdate, int jtimes, string jreasontxt) { Jlog jObj = new Jlog(); jObj.Date = jdate; jObj.Ntimes = jtimes; jObj.Reason = jreasontxt; try { context.Jlog.Add(jObj); context.SaveChanges(); status = 1; } catch (Exception e) { Console.WriteLine(e.Message); status = -99; } return(status); }
//Modify the Reason Based on the Date public int ModifyJerkReason(DateTime jdate, string jreasontxt) { try { Jlog jobj = context.Jlog.Find(jdate); if (jobj != null) { jobj.Reason = jreasontxt; context.SaveChanges(); status = 1; } } catch (Exception e) { Console.WriteLine(e.Message); status = -99; } return(status); }