コード例 #1
0
        private void GoRemoveAccount_Click(object sender, EventArgs e)
        {
            Account_BO accountBO = new Account_BO();
            ArrayList  list      = new ArrayList(accountBO.readAccount());

            if (searchRemoveAccount.Text == "")
            {
                MessageBox.Show("Wrong!!! Enter the information fully");
            }
            else
            {
                try
                {
                    int flag = 0;
                    for (int i = 0; i < list.Count; i++)
                    {
                        if (list[i].ToString() == searchRemoveAccount.Text)
                        {
                            Home_Admin_AccountRemove_Remove home_Admin_AccountRemove_Remove = new Home_Admin_AccountRemove_Remove();
                            home_Admin_AccountRemove_Remove.giveIndex(list.IndexOf(list[i].ToString()));
                            home_Admin_AccountRemove_Remove.Show();
                            this.Hide();

                            flag = 1;
                            break;
                        }
                    }
                    if (flag == 0)
                    {
                        MessageBox.Show("Sorry!!! This account number isn't Exist");
                        searchRemoveAccount.Clear();
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("No User Exists");
                }
            }
        }
コード例 #2
0
        private void GoRemoveAccount_Click(object sender, EventArgs e)
        {
            Account_BO accountBO = new Account_BO();
            ArrayList list = new ArrayList(accountBO.readAccount());
            if (searchRemoveAccount.Text == "")
            {
                MessageBox.Show("Wrong!!! Enter the information fully");
            }
            else
            {
                try
                {
                    int flag = 0;
                    for (int i = 0; i < list.Count; i++)
                    {

                        if (list[i].ToString() == searchRemoveAccount.Text)
                        {
                            Home_Admin_AccountRemove_Remove home_Admin_AccountRemove_Remove = new Home_Admin_AccountRemove_Remove();
                            home_Admin_AccountRemove_Remove.giveIndex(list.IndexOf(list[i].ToString()));
                            home_Admin_AccountRemove_Remove.Show();
                            this.Hide();

                            flag = 1;
                            break;
                        }
                    }
                    if (flag == 0)
                    {
                        MessageBox.Show("Sorry!!! This account number isn't Exist");
                        searchRemoveAccount.Clear();
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("No User Exists");
                }
            }
        }