public IHttpActionResult Post(SupportStaffRosterDTO model) { var shift = _supportStaffShiftService.Insert(model.Start, model.End, model.Description, model.EmployeeId, model.Color, model.Title, model.RecurrenceId, model.RecurrenceException, model.RecurrenceRule); model.Id = shift.Id; model.Title = shift.EmployeeInSupportPosition.Employee.Firstname + " " + shift.EmployeeInSupportPosition.Employee.Lastname; return(CreatedAtRoute("DefaultApi", new { id = model.Id }, model)); }
public IHttpActionResult Put(SupportStaffRosterDTO model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _supportStaffShiftService.Update(model.Id, model.Start, model.End, model.Description, model.EmployeeId, model.Color, model.Title, model.RecurrenceId, model.RecurrenceException, model.RecurrenceRule); return(CreatedAtRoute("DefaultApi", model.Id, model)); }
public IHttpActionResult Delete(SupportStaffRosterDTO model) { _supportStaffShiftService.Delete(model.Id); return(Ok()); }