private void btnLogin_Click(object sender, EventArgs e) { if (Validation.ValidAccountNumOrAmt(txtAccNum.Text) && Validation.ValidPin(txtPin.Text)) { Account a = SuperGlobal.db.Retrieve(txtAccNum.Text, txtPin.Text); if (a == null) { Dialog d = new Dialog("Account not found"); d.ShowDialog(); } else { SuperGlobal.account = a; FormAccountOps f = new FormAccountOps(); f.Show(); Close(); } } else if (!Validation.ValidAccountNumOrAmt(txtAccNum.Text)) { Dialog d = new Dialog("Invalid Accnum"); d.ShowDialog(); } else if (!Validation.ValidPin(txtPin.Text)) { Dialog d = new Dialog("Invalid Pin"); d.ShowDialog(); } }
private void btnSubmit_Click(object sender, EventArgs e) { if (Validation.ValidName(txtName.Text) && Validation.ValidAccountNumOrAmt(txtBal.Text) && Validation.ValidPin(txtPin.Text)) { switch (cmbType.Text) { case "Savings": account = new SavingsAccount(txtName.Text, int.Parse(txtBal.Text), txtPin.Text); break; case "Current": account = new CurrentAccount(txtName.Text, int.Parse(txtBal.Text), txtPin.Text); break; default: break; } SuperGlobal.account = account; SuperGlobal.db.Insert(account); Dialog d = new Dialog(account.AccNum); FormAccountOps f = new FormAccountOps(); f.Show(); Close(); } else { Dialog d = new Dialog("invalid input"); } }
private void btnProceed_Click(object sender, EventArgs e) { try { if (Validation.ValidAccountNumOrAmt(txtAmt.Text)) { if (s == "withdraw") { account.WithDraw(int.Parse(txtAmt.Text)); } else { account.Deposit(int.Parse(txtAmt.Text)); } SuperGlobal.db.Update(account.AccNum, account); account = SuperGlobal.db.Retrieve(account.AccNum, account.Pin); FormAccountOps f = new FormAccountOps(); f.Show(); Close(); } else { Dialog g = new Dialog("Invalid amount"); g.ShowDialog(); } } catch (Exception) { Dialog g = new Dialog("Invalid amount"); g.ShowDialog(); } }
private void btnBack_Click(object sender, EventArgs e) { FormAccountOps f = new FormAccountOps(); f.Show(); Close(); }
private void btnSubmit_Click(object sender, EventArgs e) { if (Validation.ValidName(txtName.Text) && Validation.ValidPin(txtPin.Text)) { account.Name = txtName.Text; account.Pin = txtPin.Text; SuperGlobal.db.Update(account.AccNum, account); FormAccountOps f = new FormAccountOps(); f.Show(); Close(); } }