Example #1
0
        private void Refresh()
        {
            DoctorRegistry reg = new DoctorRegistry();

            docs = reg.GetAvailable();
            grdDoctors.ItemsSource = docs;
        }
Example #2
0
        private void LoadData(object sender, RoutedEventArgs e)
        {
            DoctorRegistry doctorRegistry = new DoctorRegistry();

            foreach (var el in doctorRegistry.GetAvailable())
            {
                cboxDocsList.Items.Add(el);
            }
        }
Example #3
0
        private void LoadDoctorsList()
        {
            DoctorRegistry dr = new DoctorRegistry();

            cboxDoctorsList.Items.Clear();

            foreach (var el in dr.GetAvailable())
            {
                cboxDoctorsList.Items.Add(el);
            }
        }
Example #4
0
        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);
        }
Example #5
0
        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();
        }
Example #6
0
        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);
        }
Example #7
0
        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");
            }
        }
Example #8
0
        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;
            }
        }
Example #9
0
 public HumanManagerWindow()
 {
     doctorRegistry  = new DoctorRegistry();
     patientRegistry = new PatientRegistry();
     InitializeComponent();
 }