private void btnLogin_Click(object sender, EventArgs e) { String uName = userName.Text.ToString(); String uPwd = userPassword.Text.ToString(); clsdb obj = new clsdb(); DataTable dt = new DataTable(); dt = obj.getUserTable(uName, uPwd); if (dt.Rows.Count > 0 && dt.Rows[0][3].ToString() == "su_admin") { Addpatients frm = new Addpatients(); frm.Show(); this.Hide(); } else if (dt.Rows.Count > 0 && dt.Rows[0][3].ToString() == "staff") { Addpatients frm = new Addpatients(); frm.Show(); } else { MessageBox.Show("Username or password is incorrect!"); } }
private void pictureBox2_Click(object sender, EventArgs e) { Addpatients frmp = new Addpatients(); frmp.Show(); this.Close(); }