示例#1
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();
        }
示例#2
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);
        }