예제 #1
0
        public void btn_submit_Clicked()
        {
            appointment.AppointmentType    = (Consult)Enum.Parse(typeof(Consult), view.getAppointmentType());
            appointment.AppointmentDate    = view.getAppointmentDate();
            appointment.AppointmentTime    = view.getAppointmentTime();
            appointment.AppointmentDentist = view.getAppointmentDentist();
            appointment.AppointmentNotes   = view.getAppointmentNotes();

            AppointmentDB.InsertAppointment(appointment);
            ConfirmationForm      cForm      = new ConfirmationForm();
            ConfirmationPresenter cPresenter = new ConfirmationPresenter(cForm);

            cForm.Show();
        }
 public IHttpActionResult Post([FromBody] Appointment Appointment2Insert)
 {
     try
     {
         int res = AppointmentDB.InsertAppointment(Appointment2Insert);
         if (res == -1)
         {
             return(Content(HttpStatusCode.BadRequest, $"user with id = {Appointment2Insert.appointmentID} was not created in DB!!!"));
         }
         Appointment2Insert.appointmentID = res;
         return(Created(new Uri(Request.RequestUri.AbsoluteUri + res), Appointment2Insert));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }