public ActionResult <CitaResponse> Post(CitaRequest request)
        {
            CrearCitaService _service = new CrearCitaService(_unitOfWork);
            CitaResponse     response = _service.CrearCita(request);

            return(Ok(response));
        }
Esempio n. 2
0
 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);
     }
 }
Esempio n. 3
0
 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);
     }
 }
Esempio n. 4
0
 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);
     }
 }
Esempio n. 5
0
 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);
     }
 }
Esempio n. 6
0
 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);
     }
 }
Esempio n. 7
0
        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);
        }