//view all accounts private void viewAccountsToolStripMenuItem_Click(object sender, EventArgs e) { //close current form ExitCurrentForm(); frmManageAccounts ma = new frmManageAccounts(); ma.PopulateAccountsDGV(); ma.lblManAccDgvHeader.Text = "Accounts"; ma.panelAccManNewAcc.Visible = false; ma.panelManAccEditSearch.Visible = false; ma.panelManAccFullDet.Visible = false; ma.ShowDialog(); }
//CLICK user logges in. Show frmManageAaccounts private void btnHomePLoginLogin_Click(object sender, EventArgs e) { bool success = false; Staff stf = new Staff(); stf.Name = txtHomePLoginUserName.Text; stf.Password = txtHomePLoginPassword.Text; BLLAccountMgmt bllAM = new BLLAccountMgmt(); success = bllAM.CheckLoginBLL(stf); if (success) { this.Hide(); //must not close frmHome - Application Run form frmManageAccounts ma = new frmManageAccounts(); ma.PopulateAccountsDGV(); ma.panelAccManNewAcc.Visible = false; ma.panelManAccEditSearch.Visible = false; ma.panelManAccFullDet.Visible = false; ma.ShowDialog(); } else { MessageBox.Show("Invalid Username or Password"); panelHomeLogin.Visible = false; btnHomeLogin.Visible = true; txtHomePLoginUserName.Text = ""; txtHomePLoginPassword.Text = ""; } }