private void button1_Click(object sender, EventArgs e) { if (txt_username.Text == "") { errorlabelUsernme.Visible = true; } else { errorlabelUsernme.Visible = false; } if (txt_password.Text == "") { errorlabelpassword.Visible = true; } else { errorlabelpassword.Visible = false; } if (errorlabelpassword.Visible || errorlabelUsernme.Visible) { Mainclass.ShowMsg("Field with * are mandatory", "Error...", "Error.."); } else { if (mai.getStaffLogin(txt_username.Text, txt_password.Text)) { if (Mainclass.STAFFROLE == "Falculty") { FalcultyDashboard hs = new FalcultyDashboard(); Mainclass.showWindow(hs, this, Mdi.ActiveForm); } if (Mainclass.STAFFROLE == "Admin") { Home hs = new Home(); Mainclass.showWindow(hs, this, Mdi.ActiveForm); } if (Mainclass.STAFFROLE == "Teacher") { } if (Mainclass.STAFFROLE == "Principal") { } } else { Mainclass.ShowMsg("Invalid Login Details", "Error...", "Error.."); } } }