private void Pay_btn_Click(object sender, EventArgs e) { Account_BO account_BO = new Account_BO(); ArrayList list = new ArrayList(account_BO.readAccount()); ArrayList userBill = new ArrayList(account_BO.getUserBill()); try { int temp = index1; int i; int k = 1; ; for (i = index1; list[i].ToString() != "*****"; i++) { k++; } int m = 0; while (userBill[m].ToString() != list[index1].ToString()) { m++; } int n; int o = 1; for (n = m; userBill[n].ToString() != "*"; n++) { o++; } userBill.RemoveRange(m, o); list.RemoveRange(temp, k); account_BO.createAccount(list); account_BO.decreaseTotalUser(); account_BO.setUserBill(userBill); MessageBox.Show("Account remove successfull..."); this.Hide(); Home_Admin home_Admin = new Home_Admin(); home_Admin.Show(); } catch { MessageBox.Show("Wrong!!!"); } }