public void EditDoctor()
        {
            try
            {
                ClinicUser clinicUser = new ClinicUser();
                clinicUser.ClinicUserId = selectedDoctor.ClinicUserId;
                clinicUser.FullName     = selectedDoctor.FullName;
                clinicUser.DateOfBirth  = selectedDoctor.DateOfBirth;
                clinicUser.IDNumber     = selectedDoctor.IDNumber;
                clinicUser.GenderId     = selectedDoctor.GenderId;
                clinicUser.Citizenship  = selectedDoctor.Citizenship;
                clinicUser.Username     = selectedDoctor.Username;
                clinicUser.Password     = selectedDoctor.Password;

                ClinicDoctor clinicDoctor = new ClinicDoctor();
                clinicDoctor.ClinicDoctorId      = selectedDoctor.ClinicDoctorId;
                clinicDoctor.ClinicUserId        = selectedDoctor.ClinicUserId;
                clinicDoctor.UniqueNumber        = selectedDoctor.UniqueNumber;
                clinicDoctor.BancAccount         = selectedDoctor.BancAccount;
                clinicDoctor.DepartmentId        = selectedDoctor.DepartmentId;
                clinicDoctor.WorkShiftId         = selectedDoctor.WorkShiftId;
                clinicDoctor.InChargeOfAdmission = selectedDoctor.InChargeOfAdmission;
                clinicDoctor.ClinicManagerId     = selectedDoctor.ClinicManagerId;

                AddDoctorView addDoctorView = new AddDoctorView(User, clinicUser, clinicDoctor, true);
                addDoctorView.Show();
                doctorView.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
 public AddDoctorViewModel(AddDoctorView doctorView)
 {
     this.doctorView = doctorView;
     ClinicDoctor    = new vwClinicDoctor();
     GenderList      = genders.GetGenders();
     ShiftList       = shifts.GetShifts();
     ManagerList     = managers.ManagersWhoCanSupervise();
 }
 private void AddNewDoctorExecute()
 {
     try
     {
         AddDoctorView addDoctor = new AddDoctorView();
         addDoctor.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
 /// <summary>
 /// This method invokes method for opening a window for adding doctor.
 /// </summary>
 public void AddExecute()
 {
     try
     {
         AddDoctorView form = new AddDoctorView();
         form.ShowDialog();
         DoctorList = doctors.ViewAllDoctors();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
 public void AddNewDoctorExecute()
 {
     try
     {
         AddDoctorView addDoctorView = new AddDoctorView(User, new ClinicUser(), new ClinicDoctor(), false);
         addDoctorView.Show();
         doctorView.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
 public AddDoctorViewModel(ClinicUser userAdmin, ClinicUser user, ClinicDoctor clinicDoctor, AddDoctorView addDoctorViewOpen, bool isForEdit)
 {
     this.userAdmin     = userAdmin;
     this.userDoctor    = clinicDoctor;
     this.user          = user;
     this.isForEdit     = isForEdit;
     addDoctorView      = addDoctorViewOpen;
     GenderList         = new ObservableCollection <Gender>(service.GetAllGender());
     SelectedGender     = GenderList.FirstOrDefault(p => p.GenderId == user.GenderId);
     DepartmentList     = new ObservableCollection <Department>(service.GetAllDepartment());
     SelectedDepartment = DepartmentList.FirstOrDefault(p => p.DepartmentId == userDoctor.DepartmentId);
     WorkShiftList      = new ObservableCollection <Workshift>(service.GetAllWorkshift());
     SelectedWorkShift  = WorkShiftList.FirstOrDefault(p => p.WorkShiftId == userDoctor.WorkShiftId);
     ManagerList        = new ObservableCollection <vwManager>(service.GetAllManager());
     SelectedManager    = ManagerList.FirstOrDefault(p => p.ClinicManagerId == userDoctor.ClinicManagerId);
 }
 public AddDoctorViewModel(AddDoctorView doctorView)
 {
     addDoctor = doctorView;
     doctor    = new tblDoctor();
 }