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

            if (accountUpdateSearch.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() == accountUpdateSearch.Text)
                        {
                            Home_Admin_AccountUpdate_Update home_Admin_AccountUpdate_Update = new Home_Admin_AccountUpdate_Update();
                            home_Admin_AccountUpdate_Update.giveIndex(list.IndexOf(list[i].ToString()));
                            home_Admin_AccountUpdate_Update.Show();
                            this.Hide();

                            flag = 1;
                            break;
                        }
                    }
                    if (flag == 0)
                    {
                        MessageBox.Show("Sorry!!! This account number isn't Exist");
                        accountUpdateSearch.Clear();
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("No User Exists");
                }
            }
        }
コード例 #2
0
        private void GoUpdateAccount_Click(object sender, EventArgs e)
        {
            Account_BO accountBO = new Account_BO();
            ArrayList list = new ArrayList(accountBO.readAccount());
            if (accountUpdateSearch.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() == accountUpdateSearch.Text)
                        {
                            Home_Admin_AccountUpdate_Update home_Admin_AccountUpdate_Update = new Home_Admin_AccountUpdate_Update();
                            home_Admin_AccountUpdate_Update.giveIndex(list.IndexOf(list[i].ToString()));
                            home_Admin_AccountUpdate_Update.Show();
                            this.Hide();

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