public IActionResult AddPastShift(PastShiftModel pastShiftModel) { try { PastShiftModel addedPastShift = logic.AddPastShiftModel(pastShiftModel); return(Created("api/shifts/past_shifts/" + addedPastShift.ShiftId, addedPastShift)); } catch (Exception ex) { return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message)); } }
public IActionResult GetSinglePastShift(int id) { try { PastShiftModel pastShift = logic.GetSinglePastShift(id); if (pastShift == null) { return(NotFound($"id {id} not found")); } return(Ok(pastShift)); } catch (Exception ex) { return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message)); } }
public IActionResult UpdateFullPastShift(int id, PastShiftModel pastShiftModel) { try { pastShiftModel.ShiftId = id; PastShiftModel updatedPastShift = logic.UptdateFullPastShift(pastShiftModel); if (updatedPastShift == null) { return(NotFound($"id {id} not found")); } return(Ok(updatedPastShift)); } catch (Exception ex) { return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message)); } }