private void Button_Click(object sender, RoutedEventArgs e) { RoomDTO tempRoom = new RoomDTO() { Floor = "two", Type = Project.Model.RoomType.medicalRoom, Ward = "op" }; AvailableAppoitments.Clear(); AvailableAppoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 10, 15, 0, 0), Type = Project.Model.MedicalAppointmentType.examination, End = new DateTime(2020, 5, 10, 15, 30, 0), IsScheduled = false }); AvailableAppoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 11, 15, 0, 0), Type = Project.Model.MedicalAppointmentType.examination, End = new DateTime(2020, 5, 11, 15, 30, 0), IsScheduled = false }); AvailableAppoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 12, 15, 0, 0), Type = Project.Model.MedicalAppointmentType.examination, End = new DateTime(2020, 5, 12, 15, 30, 0), IsScheduled = false }); AvailableAppoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 13, 15, 0, 0), Type = Project.Model.MedicalAppointmentType.examination, End = new DateTime(2020, 5, 13, 15, 30, 0), IsScheduled = false }); AvailableAppoitments.Add(new MedicalAppointmentDTO() { Room = tempRoom, Beginning = new DateTime(2020, 5, 14, 15, 0, 0), Type = Project.Model.MedicalAppointmentType.examination, End = new DateTime(2020, 5, 14, 15, 30, 0), IsScheduled = false }); ConfirmButton.IsEnabled = true; CancelButton.IsEnabled = true; ViewAvailableButton.IsEnabled = false; }
private void Cancel_Click(object sender, RoutedEventArgs e) { AvailableAppoitments.Clear(); ConfirmButton.IsEnabled = false; CancelButton.IsEnabled = false; ViewAvailableButton.IsEnabled = true; }
private void ViewAvailable_Click(object sender, RoutedEventArgs e) { RoomDTO tempRoom = new RoomDTO() { Floor = "One", Id = 4, Ward = "Check" }; DoctorDTO tempDoctor = new DoctorDTO() { FirstName = "Filip Zdelar", Address = LoggedInPatient.Address }; ReviewDTO tempReview = new ReviewDTO(5, "yes"); List <DoctorDTO> tempDoctors = new List <DoctorDTO>(); tempDoctors.Add(tempDoctor); AvailableAppoitments.Clear(); AvailableAppoitments.Add(new MedicalAppointmentDTO() { Beginning = new DateTime(2020, 5, 10, 15, 0, 0), Type = MedicalAppointmentType.examination, End = new DateTime(2020, 5, 10, 15, 30, 0), IsScheduled = false, Room = tempRoom, Patient = LoggedInPatient, Doctors = tempDoctors }); AvailableAppoitments.Add(new MedicalAppointmentDTO() { Beginning = new DateTime(2020, 5, 11, 18, 0, 0), Type = MedicalAppointmentType.examination, End = new DateTime(2020, 5, 11, 18, 30, 0), IsScheduled = false, Room = tempRoom, Patient = LoggedInPatient, Doctors = tempDoctors }); AvailableAppoitments.Add(new MedicalAppointmentDTO() { Beginning = new DateTime(2020, 5, 12, 15, 0, 0), Type = MedicalAppointmentType.examination, End = new DateTime(2020, 5, 12, 15, 30, 0), IsScheduled = false, Room = tempRoom, Patient = LoggedInPatient, Doctors = tempDoctors }); AvailableAppoitments.Add(new MedicalAppointmentDTO() { Beginning = new DateTime(2020, 5, 13, 15, 0, 0), Type = MedicalAppointmentType.examination, End = new DateTime(2020, 5, 13, 15, 30, 0), IsScheduled = false, Room = tempRoom, Patient = LoggedInPatient, Doctors = tempDoctors }); AvailableAppoitments.Add(new MedicalAppointmentDTO() { Beginning = new DateTime(2020, 5, 14, 11, 0, 0), Type = MedicalAppointmentType.operation, End = new DateTime(2020, 5, 14, 11, 30, 0), IsScheduled = false, Room = tempRoom, Patient = LoggedInPatient, Doctors = tempDoctors }); AvailableAppoitments.Add(new MedicalAppointmentDTO() { Beginning = new DateTime(2020, 5, 15, 14, 0, 0), Type = MedicalAppointmentType.operation, End = new DateTime(2020, 5, 15, 14, 30, 0), IsScheduled = false, Room = tempRoom, Patient = LoggedInPatient, Doctors = tempDoctors }); ConfirmButton.IsEnabled = true; CancelButton.IsEnabled = true; ViewAvailableButton.IsEnabled = false; }
private void Confirm_Click(object sender, RoutedEventArgs e) { for (int i = 0; i < AvailableAppoitments.Count(); i++) { if (!AvailableAppoitments[i].IsScheduled) { AvailableAppoitments.RemoveAt(i); i--; } } //TEMP FOR CONTROLLER TO DO for (int i = 1; i < AvailableAppoitments.Count(); i++) { if (AvailableAppoitments[i].IsScheduled) { AvailableAppoitments.RemoveAt(i); i--; } } ConfirmButton.IsEnabled = false; }
private void ConfirmAvailable_Click(object sender, RoutedEventArgs e) { for (int i = 0; i < AvailableAppoitments.Count(); i++) { if (!AvailableAppoitments[i].IsScheduled) { AvailableAppoitments.RemoveAt(i); i--; } } for (int i = 1; i < AvailableAppoitments.Count(); i++) { if (AvailableAppoitments[i].IsScheduled) { AvailableAppoitments.RemoveAt(i); i--; } } app.MedicalAppointmentController.Save(AvailableAppoitments[0]); ConfirmButton.IsEnabled = false; }