コード例 #1
0
 public void delete(UpdateAppointmentRequest request)
 {
     try
     {
         var response = new UpdateAppointmentResponse();
         var bc       = new AppointmentComponent();
         bc.Update(request.Appointment);
     }
     catch (Exception ex)
     {
         var httpError = new HttpResponseMessage()
         {
             StatusCode   = (HttpStatusCode)422,
             ReasonPhrase = ex.Message
         };
         throw new HttpResponseException(httpError);
     }
 }
コード例 #2
0
 public GetAppointmentResponse getById(GetAppointmentRequest request)
 {
     try
     {
         var response = new GetAppointmentResponse();
         var bc       = new AppointmentComponent();
         response.Result = bc.Find(request.Appointment.Id);
         return(response);
     }
     catch (Exception ex)
     {
         var httpError = new HttpResponseMessage()
         {
             StatusCode   = (HttpStatusCode)422,
             ReasonPhrase = ex.Message
         };
         throw new HttpResponseException(httpError);
     }
 }
コード例 #3
0
        public AllAppointmentsResponse getAll()
        {
            try
            {
                var response = new AllAppointmentsResponse();
                var bc       = new AppointmentComponent();
                response.Result = bc.ToList();

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