Exemple #1
0
 private void AddNewManagerExecute(object obj)
 {
     try
     {
         string password = (obj as PasswordBox).Password;
         if (managerCodes.Contains(password) && count < 3)
         {
             AddNewManagerView addNewManagerViewView = new AddNewManagerView();
             view.Close();
             addNewManagerViewView.ShowDialog();
             return;
         }
         else if (count < 2)
         {
             count++;
             int attempts = GetLeftAttempts();
             MessageBox.Show($"Code is wrong. You have {attempts} more attempts.");
             return;
         }
         else
         {
             MessageBox.Show("You can not create mannager type of account, continue with creating the employee account.");
             RegistrationView registrationWindow = new RegistrationView(false);
             registrationWindow.Show();
             view.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
 public AddNewManagerViewModel(AddNewManagerView addNewManagerView, IValidatedUserData userData)
 {
     this.addNewManagerView          = addNewManagerView;
     ProfessionalQualificationsLevel = string.Empty;
     FloorNumber    = string.Empty;
     WorkExperience = string.Empty;
     manager        = new tblManager();
     this.userData  = userData;
 }
 private void AddNewManagerExecute()
 {
     try
     {
         AddNewManagerView addNewManagerView = new AddNewManagerView();
         addNewManagerView.ShowDialog();
         hotelOwnerView.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Exemple #4
0
        public AddNewManagerViewModel(AddNewManagerView addNewManagerView)
        {
            this.addNewManagerView = addNewManagerView;
            PersonalNo             = string.Empty;
            Sex = string.Empty;
            PlaceOfResidence = string.Empty;
            MaritalStatus    = string.Empty;
            Username         = string.Empty;
            Password         = string.Empty;
            GivenName        = string.Empty;
            Surname          = string.Empty;
            CanSave          = true;
            userData         = new tblUserData();

            Manager       = new tblManager();
            passwordHint  = string.Empty;
            email         = string.Empty;
            officeNumber  = string.Empty;
            projectsCount = string.Empty;
        }