public EditDoctorViewModel(EditDoctorView doctorView, vwClinicDoctor doctorToEdit) { this.doctorView = doctorView; ClinicDoctor = doctorToEdit; GenderList = genders.GetGenders(); ShiftList = shifts.GetShifts(); ManagerList = managers.ManagersWhoCanSupervise(); OldDoctor = new vwClinicDoctor { Citizenship = doctorToEdit.Citizenship, DateOfBirth = doctorToEdit.DateOfBirth, Gender = doctorToEdit.Gender, IdentityCardNumber = doctorToEdit.IdentityCardNumber, NameAndSurname = doctorToEdit.NameAndSurname, Password = doctorToEdit.Password, Username = doctorToEdit.Username, BankAccountNumber = doctorToEdit.BankAccountNumber, Department = doctorToEdit.Department, ResponsibleForPatientAdmission = doctorToEdit.ResponsibleForPatientAdmission, Shift = doctorToEdit.Shift, SuperiorManager = doctorToEdit.SuperiorManager, UniqueNumber = doctorToEdit.UniqueNumber, Manager = doctorToEdit.Manager }; }
public void EditExecute() { try { if (Doctor != null) { EditDoctorView form = new EditDoctorView(Doctor); form.ShowDialog(); DoctorList = doctors.ViewAllDoctors(); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }