示例#1
0
        public void DisplayAppointmentTypes()
        {
            var allAppointmentTypes = AppointmentDB.GetAppointmentTypes();

            foreach (var item in allAppointmentTypes)
            {
                AppointmentTypes.Add(item);
            }
        }
 public IHttpActionResult Get()
 {
     try
     {
         return(Ok(AppointmentDB.GetAllAppointment()));
     }
     catch (Exception ex)
     {
         return(BadRequest("could not get all the Appointment!"));
     }
 }
示例#3
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 Get(int id)
 {
     try
     {
         List <Appointment> u = AppointmentDB.GetAppointmentByID(id);
         if (u != null)
         {
             return(Ok(u));
         }
         return(Content(HttpStatusCode.NotFound, $"Appointment witn id {id} was not found!!!"));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }
 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));
     }
 }
示例#6
0
        //Method to call the instance of insertPatient from the PatientDB.
        //This method will be attached to the button 'Insert' command.
        private void UpdateAppointment()
        {
            try
            {
                rowsAffected = AppointmentDB.updateAppointment(SelectedAppointment);

                Appointments.Clear();
                DisplayAllAppointments();

                if (rowsAffected != 0)
                {
                    MessageBox.Show("Appointment updated");
                }
                else
                {
                    MessageBox.Show("Update Failed");
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
            }
        }
        public async Task <List <AppointmentInfo> > Get(string CustomerID)
        {
            var db = new AppointmentDB(_storageConnectionString);

            return(await db.GetAppointmentAsync(CustomerID));
        }
示例#8
0
 public AppointmentBL()
 {
     objDB = new AppointmentDB();
 }