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!")); } }
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)); } }
//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)); }
public AppointmentBL() { objDB = new AppointmentDB(); }