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());
            }
        }
Exemplo n.º 2
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());
            }
        }