public void SavePersonTimeSheet([FromUri] TimeSaveModel personTimeSheet) { try { iTimeSheet.SavePersonTimeSheet(personTimeSheet); } catch (Exception ex) { } }
public bool SavePersonTimeSheet(TimeSaveModel personTimeSheet) { bool flag = false; try { PersonTimeSheet P = new PersonTimeSheet(); if (personTimeSheet != null) { P.Pid = Convert.ToInt32(personTimeSheet.Pid.ToString()); P.Date = Convert.ToDateTime(personTimeSheet.Date.ToString()); P.HoursWorked = Convert.ToInt32(personTimeSheet.HoursWorked.ToString()); } _context.PersonTimeSheet.Add(P); _context.SaveChanges(); flag = true; } catch (Exception ex) { } return(flag); }