public void EditManager() { try { ClinicUser clinicUser = new ClinicUser(); clinicUser.ClinicUserId = selectedManager.ClinicUserId; clinicUser.FullName = selectedManager.FullName; clinicUser.DateOfBirth = selectedManager.DateOfBirth; clinicUser.IDNumber = selectedManager.IDNumber; clinicUser.GenderId = selectedManager.GenderId; clinicUser.Citizenship = selectedManager.Citizenship; clinicUser.Username = selectedManager.Username; clinicUser.Password = selectedManager.Password; ClinicManager clinicManager = new ClinicManager(); clinicManager.ClinicManagerId = selectedManager.ClinicManagerId; clinicManager.ClinicUserId = selectedManager.ClinicUserId; clinicManager.ClinicFloor = selectedManager.ClinicFloor; clinicManager.MaxNumOfDoctorsSupervised = selectedManager.MaxNumOfDoctorsSupervised; clinicManager.MinNumOfRoomSupervised = selectedManager.MinNumOfRoomSupervised; clinicManager.NumberOfMistake = selectedManager.NumberOfMistake; AddManagerView addManagerView = new AddManagerView(User, clinicUser, clinicManager, true); addManagerView.Show(); managerView.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void ConfirmCommandExecute(object obj) { try { string password = (obj as PasswordBox).Password; string filePassword = RandomPasswordGenerator.ReadManagerPassword(); if (password.Equals(filePassword)) { AddManagerView managerView = new AddManagerView(); managerPasswordEnterView.Close(); registration.Close(); managerView.Show(); return; } else { if (retryCounter == 0) { MessageBox.Show("You have exeeded maximum number of tries.\nReturning to registration screen."); RegistrationView registrationView = new RegistrationView(retryCounter); managerPasswordEnterView.Close(); registration.Close(); registrationView.Show(); } else { MessageBox.Show($"Wrong password. Remaining number of tries: {--retryCounter}"); } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public void GoToAddManagerExecute() { try { AddManagerView main = new AddManagerView(); main.Show(); ownerView.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public void AddNewMenagerExecute() { try { AddManagerView addManagerView = new AddManagerView(User, new ClinicUser(), new ClinicManager(), false); addManagerView.Show(); managerView.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }