private void ShowAccountStatement_Click(object sender, EventArgs e) { Account_BO accountBO = new Account_BO(); ArrayList list = new ArrayList(accountBO.readAccount()); if (AccountStatementSearch.Text == "" || stYear.Text == "") { MessageBox.Show("Wrong!!! Enter the information fully"); } else { try { int flag = 0; int flag1 = 0; int i1 = 0, i2 = 0; for (int i = 0; i < list.Count; i++) { if (list[i].ToString() == AccountStatementSearch.Text) { flag = 1; i1 = i; break; } } for (int i = i1; list[i].ToString() != "*****"; i++) { if (list[i].ToString() == stYear.Text) { flag1 = 1; i2 = i; break; } } if (flag == 1 && flag1 == 1) { try { Home_Admin_AccountStatement_Show home_Admin_AccountStatement_Show = new Home_Admin_AccountStatement_Show(); home_Admin_AccountStatement_Show.giveIndex(i1); home_Admin_AccountStatement_Show.giveYear(i2); this.Hide(); home_Admin_AccountStatement_Show.Show(); } catch (Exception) { MessageBox.Show("Error!!!"); } } if (flag == 0) { MessageBox.Show("Sorry!!! This account number isn't Exist"); AccountStatementSearch.Clear(); } if (flag1 == 0) { MessageBox.Show("Sorry!!! This year isn't Exist"); stYear.ResetText(); } } catch (Exception) { MessageBox.Show("No User Exists"); } } }
private void GoWithdrawAccount_Click(object sender, EventArgs e) { Account_BO accountBO = new Account_BO(); ArrayList list = new ArrayList(accountBO.readAccount()); ArrayList userBill = new ArrayList(accountBO.getUserBill()); if (searchUserID.Text == "") { MessageBox.Show("Wrong!!! Enter the information fully"); } else { try { int flag = 0; int i; for (i = 0; i < list.Count; i++) { if (list[i].ToString() == searchUserID.Text) { flag = 1; break; } } if (flag == 0) { MessageBox.Show("Sorry!!! This account number isn't Exist"); searchUserID.Clear(); } if (flag == 1) { int m = 0; while (userBill[m].ToString() != searchUserID.Text) { m++; } int b; for (b = m; userBill[b].ToString() != "*"; b++) { } Home_Admin_AccountStatement_Show home_Admin_AccountRemove_Remove = new Home_Admin_AccountStatement_Show(); home_Admin_AccountRemove_Remove.giveIndex(list.IndexOf(list[i].ToString())); home_Admin_AccountRemove_Remove.giveUserBillIndex(m,b); home_Admin_AccountRemove_Remove.Show(); this.Hide(); } } catch (Exception) { MessageBox.Show("No User Exists"); } } }