private void LoginExecute(object obj)
        {
            currentEmployee.password = (obj as PasswordBox).Password;
            try
            {
                switch (currentEmployee.role)
                {
                case "admin":
                    AdminMenu adminMenu = new AdminMenu();
                    authentication.Close();
                    adminMenu.ShowDialog();
                    break;

                case "employee":
                    DAN_XLIII.View.Employee e = new DAN_XLIII.View.Employee(currentEmployee.id);
                    authentication.Close();
                    e.ShowDialog();
                    break;

                case "manager":
                    tblManager    m             = Service.Service.GetManagerById(currentEmployee.id);
                    ManagerModify managerModify = new ManagerModify(currentEmployee.id);
                    authentication.Close();
                    managerModify.ShowDialog();
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Example #2
0
 public ManagerViewModel(ManagerModify openModify, int id)
 {
     man          = openModify;
     employeeList = Service.Service.GetAllEmployees();
     idOfManager  = id;
     //depend of sector, reports are visiable or not
     manager = Service.Service.GetManagerById(id);
 }
Example #3
0
        private void LoginExecute()
        {
            try
            {
                switch (currentEmployee.role)
                {
                case "admin":
                    AdminMenu adminMenu = new AdminMenu();
                    adminMenu.ShowDialog();
                    break;

                case "employee":
                    DAN_XLIII.View.Employee e = new DAN_XLIII.View.Employee(currentEmployee.id);
                    e.ShowDialog();
                    break;

                case "manager":
                    tblManager m = Service.Service.GetManagerById(currentEmployee.id);
                    if (m.access == "modify")
                    {
                        ManagerModify managerModify = new ManagerModify();
                        managerModify.ShowDialog();
                    }
                    else
                    {
                        ManagerReadonly managerReadonly = new ManagerReadonly();
                        managerReadonly.ShowDialog();
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Example #4
0
 public ManagerModifyViewModel(ManagerModify openModify)
 {
     modify       = openModify;
     employeeList = Service.Service.GetAllEmployees();
 }