public IHttpActionResult UpdateServiceSheet(int id, ServSheetDTO sheetDto) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } serviceSheetService.UpdateServiceSheet(id, sheetDto); return(Ok("Service sheeet updated! ")); }
public void UpdateServiceSheet(int id, ServSheetDTO dto) { var service = DbContext.ServiceSheets.SingleOrDefault(b => b.ID_Service == id); if (service != null) { service.ID_Service = dto.ID_Service; service.phoneID = dto.phoneID; service.claimed_defect = dto.claimed_defect; service.phone_description_on_reception = dto.phone_description_on_reception; service.accesories = dto.accesories; service.date = dto.date; DbContext.SaveChanges(); } }