private void dashBtn_Click(object sender, EventArgs e) { UserDashboard userDashboard = new UserDashboard(userid); userDashboard.Show(); this.Hide(); }
private void loginBtn_Click(object sender, EventArgs e) { string userId = userIdBox.Text; string password = passTextBox.Text; UserLogin userLogin = new UserLogin(); int flag = userLogin.getLoginInfo(userId, password); if (flag == 1) { UserDashboard dashboard = new UserDashboard(userId); dashboard.Show(); this.Hide(); } else if (flag == 2) { AdminDashboard adminDashboard = new AdminDashboard(userid); adminDashboard.Show(); this.Hide(); } else { MessageBox.Show("Invalid ID or Password"); } }