public ActionResult <CitaResponse> Post(CitaRequest request) { CrearCitaService _service = new CrearCitaService(_unitOfWork); CitaResponse response = _service.CrearCita(request); return(Ok(response)); }
public void Delete(Cita cita) { try { var request = new CitaRequest() { Cita = cita }; HttpPost <CitaResponse, CitaRequest>("api/Cita/Eliminar", request, MediaType.Json); } catch (Exception ex) { throw new ApplicationException(ex.Message); } }
public void Facturar(Cita cita, int val) { try { var request = new CitaRequest() { Cita = cita }; HttpPost <CitaResponse, CitaRequest>("api/Cita/Actualizar", request, MediaType.Json, val); } catch (Exception ex) { throw new ApplicationException(ex.Message); } }
public void Actualizar(CitaRequest request) { try { var bc = new CitaComponent(); bc.Edit(request.Cita); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }
public void Facturar(CitaRequest request, int val) { try { var bc = new CitaComponent(); bc.Facturar(request.Cita, val); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }
public CitaResponse Agregar(CitaRequest request) { try { var response = new CitaResponse(); var bc = new CitaComponent(); response.Result = bc.Add(request.Cita); return(response); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }
public Cita Add(Cita cita) { Cita result = default(Cita); try { var request = new CitaRequest() { Cita = cita }; var response = HttpPost <CitaResponse, CitaRequest>("api/Cita/Agregar", request, MediaType.Json); result = response.Result; } catch (FaultException fex) { throw new ApplicationException(fex.Message); } return(result); }