public void showRequestFormById(AdminDashBoard adminDashBoard, int requestId)
        {
            adminDashBoard.Hide();
            RequestForm requestForm = new RequestForm(adminDashBoard, requestId);

            requestForm.Show();
        }
        public void showUserPayroll(AdminDashBoard adminDashBoard, Payslip payslip)
        {
            adminDashBoard.Hide();
            PayrollForm payrollForm = new PayrollForm(adminDashBoard, payslip);

            payrollForm.ShowDialog();
        }
        public void showEmployeeForm(AdminDashBoard adminDashBoard)
        {
            EmployeeForm employeeForm = new EmployeeForm(adminDashBoard);

            adminDashBoard.Hide();
            employeeForm.ShowDialog();
        }
        public void showUpdateUserForm(AdminDashBoard adminDashBoard, User user)
        {
            UpdateUserForm updateUserForm = new UpdateUserForm(adminDashBoard, user);

            adminDashBoard.Hide();
            updateUserForm.ShowDialog();
        }
 public void showAdminDashBoard(RequestForm requestForm, AdminDashBoard adminDashboard)
 {
     requestForm.Close();
     adminDashboard.loadPendingRequests();
     adminDashboard.loadApprovedRequests();
     adminDashboard.Show();
 }
 /// <summary>
 /// Execute when go back command invoke
 /// </summary>
 /// <param name="parameter">object</param>
 public void GoBack(object parameter)
 {
     if (parameter != null)
     {
         Window   window;
         object[] data = (object[])parameter;
         window = new AdminDashBoard();
         (data[1] as Window).Close();
         window.Show();
     }
 }
 public void showDashboard(LoginForm loginForm, User user)
 {
     if (user.role.type == "admin")
     {
         AdminDashBoard adminDashboardForm = new AdminDashBoard(loginForm, user);
         loginForm.Hide();
         adminDashboardForm.ShowDialog();
     }
     else
     {
         DashboardForm dashboardForm = new DashboardForm(loginForm, user);
         loginForm.Hide();
         dashboardForm.ShowDialog();
     }
 }
        private void btnLogin_Click(object sender, EventArgs e)
        {
            logBLL.userName = txtUserName.Text.Trim();
            logBLL.passWord = txtPassord.Text.Trim();
            logBLL.userType = cmbUserType.Text.Trim();

            //Checking the Login
            bool success = logDAL.loginCheck(logBLL);

            if (success == true)
            {
                MessageBox.Show("Login SuccessFul");
                //stoer username
                LoggedInUserName = logBLL.userName;
                // We Need to Open Respective Form Based on User Type
                switch (logBLL.userType)
                {
                case "Admin":
                    AdminDashBoard admin = new AdminDashBoard();
                    admin.Show();
                    this.Hide();
                    break;

                case "User":
                    UserDashBoard userDash = new UserDashBoard();
                    userDash.Show();
                    this.Hide();
                    break;

                default:
                {
                    MessageBox.Show("INVALID!!!!! USER");
                }
                break;
                }
            }
            else
            {
                MessageBox.Show("Login Failed!!!!!! try for the second time");
                txtUserName.Text = "";
                txtPassord.Text  = "";
                cmbUserType.Text = "";
            }
        }
 /// <summary>
 /// Execute when login command execute
 /// </summary>
 /// <param name="parameter">object</param>
 public void Login(object parameter)
 {
     if (parameter != null)
     {
         object[] data = (object[])parameter;
         if ((data[0] as string).Equals("admin123") && (data[1] as string).Equals("123456"))
         {
             Window window;
             window = new AdminDashBoard();
             MessageBox.Show("Now, you will have access to Admin's Dashboard", "Login Successful", MessageBoxButton.OK, MessageBoxImage.Information);
             (data[2] as Window).Close();
             window.Show();
         }
         else
         {
             MessageBox.Show("Wrong UserName or Password", "Login Unsuccessful", MessageBoxButton.OK, MessageBoxImage.Error);
         }
     }
 }
 public void showAdminDashBoardForPosition(AdminDashBoard adminDashboard, PositionForm positionForm)
 {
     positionForm.Close();
     adminDashboard.Show();
 }
        public void showPositionForm(AdminDashBoard adminDashboard)
        {
            PositionForm positionForm = new PositionForm(adminDashboard);

            positionForm.ShowDialog();
        }
 public void showAdminDashBoard(AdminDashBoard adminDashboard, UpdateUserForm updateUserForm)
 {
     updateUserForm.Close();
     adminDashboard.Show();
 }
 public void showAdminDashBoard(AdminDashBoard adminDashboard, EmployeeForm employeeForm)
 {
     employeeForm.Close();
     adminDashboard.Show();
 }
        public void showEmployeeForm(AdminDashBoard adminDashBoard, Employee employee)
        {
            EmployeeForm employeeForm = new EmployeeForm(adminDashBoard, employee);

            employeeForm.ShowDialog();
        }
 public void showAdminDashBoard(AdminDashBoard adminDashboard)
 {
     adminDashboard.loadUsers();
     adminDashboard.Show();
 }
        public void showMiscForm(AdminDashBoard adminDashboard)
        {
            MiscellaneousForm miscForm = new MiscellaneousForm(adminDashboard);

            miscForm.ShowDialog();
        }
 public void showAdminDashBoardForMisc(AdminDashBoard adminDashboard, MiscellaneousForm miscForm)
 {
     miscForm.Close();
     adminDashboard.Show();
 }
 public void showAdminDashboardForm(PayrollForm payrollForm, AdminDashBoard adminDashboardForm)
 {
     payrollForm.Close();
     adminDashboardForm.Show();
 }
 public void showLoginWindow(AdminDashBoard adminDashBoard, LoginForm loginForm)
 {
     adminDashBoard.Close();
     loginForm.Show();
 }