//edit account / member private void editAccountToolStripMenuItem_Click(object sender, EventArgs e) { //close current form ExitCurrentForm(); frmManageAccounts ma = new frmManageAccounts(); ma.panelManAccFullDet.Hide(); ma.ShowDialog(); }
//view all transations private void viewTransactionsToolStripMenuItem_Click(object sender, EventArgs e) { //close current form ExitCurrentForm(); frmManageAccounts ma = new frmManageAccounts(); ma.lblManAccDgvHeader.Text = "Transactions"; ma.panelAccManNewAcc.Visible = false; ma.panelManAccEditSearch.Visible = false; ma.panelManAccFullDet.Visible = false; ma.ShowDialog(); }
//view one account full details private void viewAccountToolStripMenuItem_Click(object sender, EventArgs e) { //close current form ExitCurrentForm(); //select account to view - open form frmManageAccounts ma = new frmManageAccounts(); ma.panelManAccViewAccSearch.Visible = true; ma.panelManAccEditSearch.Visible = false; ma.ShowDialog(); }
//add new account private void newAccountToolStripMenuItem_Click(object sender, EventArgs e) { //close current form ExitCurrentForm(); frmManageAccounts ma = new frmManageAccounts(); ma.panelManAccFullDet.Visible = false; ma.panelAccManNewAcc.Visible = true; ma.panelManAccEditSearch.Visible = false; ma.panelManAccViewAccSearch.Visible = false; ma.txtManAccPNewAccAccHolder.Enabled = 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 = ""; } }