public IHttpActionResult GetRehabilitations(int childCardId) { try { var resultDTO = _childCardsService.GetRehabilitationsList(childCardId); var resultVM = RehabilitationMapHelper.DTOsToVMs(resultDTO); return(Ok(resultVM)); } catch (Exception exception) { return(InternalServerError(exception)); } }
public HttpResponseMessage AddRehabilitationIntoChildCard(int childCardId, [FromBody] RehabilitationVM rehabilitationVM) { try { var rehabilitationDTO = RehabilitationMapHelper.VMToDTO(rehabilitationVM); _childCardsService.AddRehabilitationIntoChildCard(childCardId, rehabilitationDTO); return(Request.CreateResponse(HttpStatusCode.OK)); } catch (Exception exception) { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exception)); } }