Beispiel #1
0
        public void AddClient(object parameter)
        {
            AddPatientView view = new AddPatientView();

            view.DataContext = new AddPatientViewModel(this);
            view.ShowDialog();
        }
Beispiel #2
0
        private void AddPatient(object sender, RoutedEventArgs e)
        {
            AddPatientView addPatient = new AddPatientView();

            addPatient.AddedHandler += (s, p) => rows.Add(p);
            addPatient.Show();
        }
Beispiel #3
0
 public AddPatientViewModel(AddPatientView patientView)
 {
     this.patientView = patientView;
     ClinicPatient    = new vwClinicPatient();
     GenderList       = genders.GetGenders();
     DoctorList       = doctors.ViewAllDoctors();
 }
Beispiel #4
0
        public void EditPatient()
        {
            try
            {
                ClinicUser clinicUser = new ClinicUser();
                clinicUser.ClinicUserId = selectedPatient.ClinicUserId;
                clinicUser.FullName     = selectedPatient.FullName;
                clinicUser.DateOfBirth  = selectedPatient.DateOfBirth;
                clinicUser.IDNumber     = selectedPatient.IDNumber;
                clinicUser.GenderId     = selectedPatient.GenderId;
                clinicUser.Citizenship  = selectedPatient.Citizenship;
                clinicUser.Username     = selectedPatient.Username;
                clinicUser.Password     = selectedPatient.Password;

                ClinicPatient clinicPatient = new ClinicPatient();
                clinicPatient.InsuranceNumber         = selectedPatient.InsuranceNumber;
                clinicPatient.InsuranceExpirationDate = selectedPatient.InsuranceExpirationDate;
                clinicPatient.UniqueDoctorNumber      = selectedPatient.UniqueDoctorNumber;

                AddPatientView addPatientView = new AddPatientView(User, clinicUser, clinicPatient, true);
                addPatientView.Show();
                patientView.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
 private void AddNewPatientExecute()
 {
     try
     {
         AddPatientView addPatient = new AddPatientView();
         addPatient.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
 public AddPatientViewModel(ClinicUser userAdmin, ClinicUser user, ClinicPatient patient, AddPatientView addPatientViewOpen, bool isForEdit)
 {
     this.userAdmin   = userAdmin;
     this.user        = user;
     this.userPatient = patient;
     this.isForEdit   = isForEdit;
     addPatientView   = addPatientViewOpen;
     GenderList       = new ObservableCollection <Gender>(service.GetAllGender());
     SelectedGender   = GenderList.FirstOrDefault(p => p.GenderId == user.GenderId);
     DoctorList       = new ObservableCollection <vwDoctor>(service.GetAllDoctors());
     SelectedDoctor   = DoctorList.FirstOrDefault(p => p.UniqueNumber == patient.UniqueDoctorNumber);
 }
Beispiel #7
0
 private void RegistrationPatientExecute()
 {
     try
     {
         AddPatientView addPatientWindow = new AddPatientView();
         addPatientWindow.Show();
         main.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Beispiel #8
0
 public void AddNewMenagerExecute()
 {
     try
     {
         AddPatientView addManagerView = new AddPatientView(User, new ClinicUser(), new ClinicPatient(), false);
         addManagerView.Show();
         patientView.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Beispiel #9
0
        private async void AddPatient_ContextMenu_Click(object sender, RoutedEventArgs e)
        {
            AddPatientView addPatientView = new AddPatientView();

            addPatientView.ShowDialog();

            if (!addPatientView.IsConfirmedToAdd)
            {
                return;
            }

            Patient patient = new Patient
                                  (addPatientView.FirstName_TextBox.Text, addPatientView.LastName_TextBox.Text);
            await _patientsViewModel.AddPatientAsync(patient).ConfigureAwait(false);
        }
Beispiel #10
0
 /// <summary>
 /// This method invokes method for opening a window for adding patient.
 /// </summary>
 public void AddExecute()
 {
     try
     {
         if (doctors.CheckIfDoctorExists())
         {
             AddPatientView form = new AddPatientView();
             form.ShowDialog();
             PatientList = patients.ViewAllPatients();
         }
         else
         {
             MessageBox.Show("Please first create a doctor.", "Notification", MessageBoxButton.OK);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Beispiel #11
0
 public Issue2634()
 {
     Content = new AddPatientView();
 }
 public AddPatientViewModel(AddPatientView patientView)
 {
     addPatient = patientView;
     patient    = new tblPatient();
 }
 public AddPatientViewModel(AddPatientView addPatientOpen, Patient patientEdit)
 {
     patient          = patientEdit;
     addPatientWindow = addPatientOpen;
 }
 public AddPatientViewModel(AddPatientView addPatientOpen)
 {
     patient          = new Patient();
     addPatientWindow = addPatientOpen;
 }