private void Login_Btn_Click(object sender, EventArgs e) { LoginRepo lr = new LoginRepo(); string id = UserTB.Text; string password = PassTB.Text; Login l = lr.GetUser(id, password); if (l != null) { if (l.Role == 0) { //MessageBox.Show("Valid"); AdminHomepage hp = new AdminHomepage(l); this.Visible = false; hp.Visible = true; } if (l.Role == 1) { EmployeeHomepage ep = new EmployeeHomepage(); this.Visible = false; ep.Visible = true; } } else { MessageBox.Show("Invalid User"); } }
private void button1_Click(object sender, EventArgs e) { Login l = new Login(); AdminHomepage ah = new AdminHomepage(l); this.Visible = false; ah.Visible = true; }