Ejemplo n.º 1
0
        private void ButtonClick(object sender, EventArgs e)
        {
            string clickedButton = (sender as Button).Text;

            switch (clickedButton)
            {
            case "Add Employee":
                MVCForm.DisposeView(this.view);
                AddEmployee           addEmployeeDashboard  = new AddEmployee();
                AddEmployeeView       addEmployeeView       = new AddEmployeeView();
                AddEmployeeController addEmployeeController = new AddEmployeeController(addEmployeeDashboard, addEmployeeView, this.curForm);
                addEmployeeController.DisplayView();
                DisplayNavigation();
                break;

            case "Edit Employee":
                MVCForm.DisposeView(this.view);
                EditEmployee           editEmployeeDashboard  = new EditEmployee();
                EditEmployeeView       editEmployeeView       = new EditEmployeeView();
                EditEmployeeController editEmployeeController = new EditEmployeeController(editEmployeeDashboard, editEmployeeView, this.curForm);
                editEmployeeController.DisplayView();
                DisplayNavigation();
                break;

            case "Delete Employee":
                MVCForm.DisposeView(this.view);
                DeleteEmployee           deleteEmployeeDashboard  = new DeleteEmployee();
                DeleteEmployeeView       deleteEmployeeView       = new DeleteEmployeeView();
                DeleteEmployeeController deleteEmployeeController = new DeleteEmployeeController(deleteEmployeeDashboard, deleteEmployeeView, this.curForm);
                deleteEmployeeController.DisplayView();
                DisplayNavigation();
                break;
            }
        }
Ejemplo n.º 2
0
        private void logoutBtn_Click(object sender, EventArgs e)
        {
            MVCForm.DisposeView(this.view);
            Login           loginModel      = new Login();
            LoginView       loginView       = new LoginView();
            LoginController loginController = new LoginController(loginModel, loginView, this.curForm);

            loginController.DisplayView();
        }
Ejemplo n.º 3
0
        private void goBackBtn_Click(object sender, EventArgs e)
        {
            MVCForm.DisposeView(view);
            AdminDashboard           adminDashboard           = new AdminDashboard();
            AdminDashboardView       adminDashboardView       = new AdminDashboardView();
            AdminDashboardController adminDashboardController = new AdminDashboardController(adminDashboard, adminDashboardView, this.curForm);

            adminDashboardController.DisplayView();
            adminDashboardController.DisplayNavigation();
        }
Ejemplo n.º 4
0
 public void ButtonClick(object sender, EventArgs e)
 {
     if (this.model.LoginValidation(this.view.UsernameBox.Text, this.view.PasswordBox.Text))
     {
         MVCForm.DisposeView(this.view);
         AdminDashboard           adminDashboard           = new AdminDashboard();
         AdminDashboardView       adminDashboardView       = new AdminDashboardView();
         AdminDashboardController adminDashboardController = new AdminDashboardController(adminDashboard, adminDashboardView, this.curForm);
         adminDashboardController.DisplayView();
         adminDashboardController.DisplayNavigation();
     }
 }