예제 #1
0
 public void delete(UpdatePatientRequest request)
 {
     try
     {
         var response = new UpdatePatientResponse();
         var bc       = new PatientComponent();
         bc.Update(request.Patient);
     }
     catch (Exception ex)
     {
         var httpError = new HttpResponseMessage()
         {
             StatusCode   = (HttpStatusCode)422,
             ReasonPhrase = ex.Message
         };
         throw new HttpResponseException(httpError);
     }
 }
예제 #2
0
 public GetPatientResponse getById(GetPatientRequest request)
 {
     try
     {
         var response = new GetPatientResponse();
         var bc       = new PatientComponent();
         response.Result = bc.Find(request.Patient.Id);
         return(response);
     }
     catch (Exception ex)
     {
         var httpError = new HttpResponseMessage()
         {
             StatusCode   = (HttpStatusCode)422,
             ReasonPhrase = ex.Message
         };
         throw new HttpResponseException(httpError);
     }
 }
예제 #3
0
        public AllPatientsResponse getAll()
        {
            try
            {
                var response = new AllPatientsResponse();
                var bc       = new PatientComponent();
                response.Result = bc.ToList();

                return(response);
            }
            catch (Exception ex)
            {
                var httpError = new HttpResponseMessage()
                {
                    StatusCode   = (HttpStatusCode)422,
                    ReasonPhrase = ex.Message
                };
                throw new HttpResponseException(httpError);
            }
        }