public string finalize([FromBody] IEnumerable <IncidentManagement_WeeklyData> tickets) { foreach (IncidentManagement_WeeklyData ticket in tickets) { using (TicketAutomationEntities entities = new TicketAutomationEntities()) { var entity = entities.IncidentManagement_WeeklyData.FirstOrDefault(e => e.PayrollDataId == ticket.PayrollDataId); entity.Finalized = true; entities.SaveChanges(); } } return("{success:'ticket updated successfully'}"); }
public string Patch(int id, [FromBody] IncidentManagement_WeeklyData ticket) { using (TicketAutomationEntities entities = new TicketAutomationEntities()) { var entity = entities.IncidentManagement_WeeklyData.FirstOrDefault(e => e.PayrollDataId == id); entity.SeverityNumber = ticket.SeverityNumber; entity.Status = ticket.Status; entity.Priority = ticket.Priority; entity.SuspendReason = ticket.SuspendReason; entity.ETR = ticket.ETR; entity.TBD = ticket.TBD; entity.StatusTracking = ticket.StatusTracking; entity.UpdatedDateTime = DateTime.Now; entities.SaveChanges(); return("{success:'ticket updated successfully'}"); } }