public Clients(AdminController adminC) { InitializeComponent(); adminController = adminC; DataTable dt = adminC.viewClients(); dataGridView1.DataSource = dt; }
private void btnLogin_Click(object sender, EventArgs e) { //Login into the application user = authController.login(txtUserName.Text, txtPassword.Text); if (user != null) { if (user.Status == 0) { ClientController clientController = new ClientController(); Main main=new Main(clientController,user); main.Show(this); main.FormClosed += new FormClosedEventHandler(adminMain_FormClosed); this.Hide(); } else { AdminController adminController = new AdminController(); AdminMain adminMain = new AdminMain(adminController); adminMain.Show(this); adminMain.FormClosed += new FormClosedEventHandler(adminMain_FormClosed); this.Hide(); } } }
public AdminMain(AdminController adminController) { InitializeComponent(); this.adminController = adminController; }