private void Refresh() { DoctorRegistry reg = new DoctorRegistry(); docs = reg.GetAvailable(); grdDoctors.ItemsSource = docs; }
private void LoadData(object sender, RoutedEventArgs e) { DoctorRegistry doctorRegistry = new DoctorRegistry(); foreach (var el in doctorRegistry.GetAvailable()) { cboxDocsList.Items.Add(el); } }
private void LoadDoctorsList() { DoctorRegistry dr = new DoctorRegistry(); cboxDoctorsList.Items.Clear(); foreach (var el in dr.GetAvailable()) { cboxDoctorsList.Items.Add(el); } }
public static RecordView CreateRecordView(RecordDTO recordDTO) { DoctorRegistry registry = new DoctorRegistry(); RecordView recordView = new RecordView() { Doctor = registry.GetAll().Where(x => x.Id == recordDTO.DoctorId).FirstOrDefault().ToString(), Date = recordDTO.Date, Diagnosis = recordDTO.Diagnosis, Therapy = recordDTO.Therapy, Addition = recordDTO.Addition }; return(recordView); }
private void FindDoctor(object sender, RoutedEventArgs e) { DoctorRegistry doctorRegistry = new DoctorRegistry(); if (string.IsNullOrEmpty(txtName.Text.Trim()) || string.IsNullOrEmpty(txtSurname.Text.Trim())) { MessageBox.Show("Enter data"); return; } DoctorsPage.instance.grdDoctors.ItemsSource = null; DoctorsPage.instance.grdDoctors.ItemsSource = doctorRegistry.Find(txtName.Text.Trim(), txtSurname.Text.Trim()); this.Close(); }
public static ScheduleView CreateScheduleView(ScheduleDTO scheduleDTO) { DoctorRegistry registry = new DoctorRegistry(); var doc = registry.Find(scheduleDTO.DoctorId); ScheduleView scheduleView = new ScheduleView() { Id = scheduleDTO.Id, Doctor = doc.ToString(), Date = scheduleDTO.Date.ToShortDateString(), Time = scheduleDTO.Time, Addition = scheduleDTO.Addition }; return(scheduleView); }
private void LoadData(object sender, RoutedEventArgs e) { int startHours = 8; int endHours = 20; dpDate.DisplayDateStart = DateTime.Today.AddDays(1); DoctorRegistry doctorRegistry = new DoctorRegistry(); foreach (var el in doctorRegistry.GetAvailable()) { cboxDocsList.Items.Add(el); } for (int i = startHours; i < endHours; i++) { cboxStartHours.Items.Add(i + ":00"); cboxEndHours.Items.Add(i + ":00"); } }
private void RemoveDoctor(object sender, RoutedEventArgs e) { DoctorRegistry registry = new DoctorRegistry(); try { string question = "Are you sure to remove doctor " + (grdDoctors.SelectedValue as DoctorDTO).ToString() + " ?"; MessageBoxResult result = MessageBox.Show(question, "Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question); if (result == MessageBoxResult.Yes) { registry.Remove(grdDoctors.SelectedValue as DoctorDTO); Refresh(); } else { return; } } catch (NullReferenceException) { return; } }
public HumanManagerWindow() { doctorRegistry = new DoctorRegistry(); patientRegistry = new PatientRegistry(); InitializeComponent(); }