/// <summary>
        /// Executes the edit command
        /// </summary>
        public void EditUserExecute()
        {
            try
            {
                if (Employee != null)
                {
                    AddEmployee addEmployee = new AddEmployee(Employee);
                    addEmployee.ShowDialog();

                    EmployeeList        = service.GetAllEmployees().ToList();
                    AllInfoEmployeeList = service.GetAllEmployeesInfo().ToList();
                    UserList            = service.GetAllUsers().ToList();
                }
                if (Manager != null)
                {
                    AddManager addManager = new AddManager(Manager);
                    addManager.ShowDialog();

                    ManagerList        = service.GetAllManagers().ToList();
                    AllInfoManagerList = service.GetAllManagersInfo().ToList();
                    UserList           = service.GetAllUsers().ToList();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
 private void SaveExecute()
 {
     try
     {
         if (service.CheckCode(Code))
         {
             MessageBox.Show("Code correct. Please procced to completing yor manager registration.");
             AddManager addManager = new AddManager(AccountToView);
             addManager.ShowDialog();
             managerCode.Close();
         }
         else
         {
             counter--;
             if (counter > 0)
             {
                 MessageBox.Show("Code incorrect." + " " + counter.ToString() + " " + "attempts left");
             }
             else
             {
                 MessageBox.Show("Out of attempts. Proceed to completing registration as an employee.");
                 AddEmployee addEmployee = new AddEmployee(AccountToView);
                 addEmployee.ShowDialog();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Exemple #3
0
 private void AddManagerExecute()
 {
     try
     {
         AddManager addManager = new AddManager();
         addManager.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Exemple #4
0
 private void CreateManagerExecute()
 {
     try
     {
         AddManager addManager = new AddManager();
         masterWindow.Close();
         addManager.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
 /// <summary>
 /// Executes the add Manager command
 /// </summary>
 private void AddNewManagerExecute()
 {
     try
     {
         AddManager addManager = new AddManager();
         addManager.ShowDialog();
         if ((addManager.DataContext as AddUserViewModel).IsUpdateManager == true)
         {
             ManagerList        = service.GetAllManagers().ToList();
             AllInfoManagerList = service.GetAllManagersInfo().ToList();
             UserList           = service.GetAllUsers().ToList();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }