private void btnLogin_Click_1(object sender, EventArgs e) { List <MySqlParameter> paramList = new List <MySqlParameter>(); paramList.Add(new MySqlParameter("@userName", txtLoginUsername.Text)); paramList.Add(new MySqlParameter("@password", txtLoginPw.Text)); int returnedRowCount = DatabaseHandler.returnRowCount("SELECT * FROM tbladmin WHERE userName=@userName and password=@password", paramList); if (returnedRowCount != 1) { GlobalLoginData.userName = txtLoginUsername.Text; paramList.Clear(); //paramList.Add(new MySqlParameter("@username", txtLoginUsername.Text)); //GlobalLoginData.userRole = DatabaseHandler.returnOneValue("SELECT userRole FROM tbladmin WHERE userName = @userName", paramList, "userName"); this.Hide(); frmHomepage dash = new frmHomepage(); dash.Show(); } else { MessageBox.Show("Invalid Data! Please Try Again!"); txtLoginPw.Clear(); txtLoginUsername.Clear(); } }
private void btnBack_Click(object sender, EventArgs e) { this.Hide(); frmHomepage home = new frmHomepage(); home.Show(); }
private void frmHomepage_Load(object sender, EventArgs e) { _formObject = this; }