예제 #1
0
 private void btChoose_Click(object sender, RoutedEventArgs e)
 {
     if (lvVisitTypes.SelectedItem == null)
     {
         MessageBox.Show("Выберите пациента");
         return;
     }
     _choose = (VisitTypeBL)lvVisitTypes.SelectedItem;
     Close();
 }
예제 #2
0
        private void txtType_GotFocus(object sender, RoutedEventArgs e)
        {
            _ChooseVisitType = VisitTypes.Choose();
            if (_ChooseVisitType != null)
            {
                txtType.Text = _ChooseVisitType.Name;
            }

            txtId.Focusable = true;
        }
예제 #3
0
        public void Set(VisitBL visit)
        {
            txtId.Text        = visit.Id.ToString();
            txtDate.Text      = visit.Date.ToString("dd/MM/yyyy");
            txtDiagnosis.Text = visit.Diagnosis;
            txtFIO.Text       = visit.Patient.FIO;
            txtType.Text      = visit.VisitType.Name;

            _ChoosePatient   = visit.Patient;
            _ChooseVisitType = visit.VisitType;
        }
예제 #4
0
        private void btDelete_Click(object sender, RoutedEventArgs e)
        {
            if (lvVisitTypes.SelectedItem == null)
            {
                MessageBox.Show("Выберите тип");
                return;
            }
            VisitTypeBL type = (VisitTypeBL)lvVisitTypes.SelectedItem;
            string      res  = type.Delete();

            if (!string.IsNullOrEmpty(res))
            {
                MessageBox.Show(res);
            }

            Window_Loaded(sender, null);
        }
예제 #5
0
        private void btAdd_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(txtName.Text))
            {
                MessageBox.Show("Укажите название");
                return;
            }
            VisitTypeBL visitType = new VisitTypeBL(txtName.Text);
            string      res       = visitType.Save();

            if (!string.IsNullOrEmpty(res))
            {
                MessageBox.Show("Не могу сохранить данные. Ошибка:" + res);
            }

            Window_Loaded(sender, e);
        }
예제 #6
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     lvVisitTypes.ItemsSource = VisitTypeBL.GetAll();
 }