Пример #1
0
        private async void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                _visitDoctorData = await DVisitDoctor.GetVisitDoctorData(DoctorId);
            }
            catch (Exception exception)
            {
                Utility.MyMessageBox("خطا در بانک اطلاعاتی", "خطا در دریافت اطلاعات\n" + exception.Message);
                Close();
                return;
            }
            DgdVisitDoctor.ItemsSource = _visitDoctorData;

            BtnNew_Click(null, null);
        }
Пример #2
0
        private async void DgdDoctor_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (DgdDoctor.SelectedIndex == -1)
            {
                return;
            }
            var selectItem = _doctorSearchData[DgdDoctor.SelectedIndex];

            LblDoctorId.Content  = selectItem.Doctor_Id;
            LblName.Content      = selectItem.Name;
            LblFamily.Content    = selectItem.Family;
            LblSpecialty.Content = selectItem.SpecialtyName;

            try
            {
                _visitDoctor = await DVisitDoctor.GetVisitDoctorData(selectItem.Id);
            }
            catch (Exception exception)
            {
                Utility.MyMessageBox("خطا در بانک اطلاعاتی", "خطا در دریافت اطلاعات\n" + exception.Message);
                return;
            }
            DgdVisitDoctor.ItemsSource = _visitDoctor;
        }