예제 #1
0
        private async void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                _doctorData = await DDoctor.GetViewData();

                _specialtyData = await DDoctor.GetSpecialty();

                CboProvince.ItemsSource = await DDoctor.GetProvince();

                _countiyData = await DDoctor.GetCounty();
            }
            catch (Exception exception)
            {
                Utility.MyMessageBox("خطا در بانک اطلاعاتی", "خطا در دریافت اطلاعات\n" + exception.Message);
                Close();
                return;
            }
            _doctorSearchData = _doctorData;
            if (string.IsNullOrEmpty(TxtSearch.Text.Trim()) || _add)
            {
                DgdDoctor.ItemsSource    = _doctorSearchData;
                CboSpecialty.ItemsSource = _specialtyData;
                TxtSearch.Text           = string.Empty;
                CboSpecialty.Text        = string.Empty;
            }
            else
            {
                TxtSearch_TextChanged(null, null);
            }
            CboSpecialty.ItemsSource = _specialtyData;
            DgdDoctor.ItemsSource    = _doctorSearchData;

            BtnNew_Click(null, null);
        }
예제 #2
0
        //baraye shomare gozari datagrid

        #endregion

        private async void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                _doctorData = await DDoctor.GetViewData();

                _specialtyData = await DDoctor.GetSpecialty();

                CboProvince.ItemsSource = await DDoctor.GetProvince();

                _countiyData = await DDoctor.GetCounty();
            }
            catch (Exception exception)
            {
                Utility.MyMessageBox("خطا در بانک اطلاعاتی", "خطا در دریافت اطلاعات\n" + exception.Message);
                Close();
                return;
            }
            _doctorSearchData        = _doctorData;
            CboSpecialty.ItemsSource = _specialtyData;
            DgdDoctor.ItemsSource    = _doctorSearchData;
            BtnNew_Click(null, null);
        }