Exemple #1
0
        private void Update_Click(object sender, EventArgs e)
        {
            Account_BO account_BO = new Account_BO();
            ArrayList  list       = new ArrayList(account_BO.readAccount());

            try
            {
                int temp = index1;
                if (updateUserName.Text != "" && updateUserAddress.Text != "" && updatePhoneNo.Text != "" && imagePath != null)
                {
                    list[temp + 1] = updateUserName.Text;
                    list[temp + 2] = updateUserAddress.Text;
                    list[temp + 3] = updatePhoneNo.Text;
                    int i;
                    for (i = index1; list[i].ToString() != "*****"; i++)
                    {
                    }
                    int j = i - 1;
                    list[j] = imagePath;
                    account_BO.createAccount(list);
                    Home_Admin_AccountUpdate_Update_Show home_Admin_AccountStatement_Update_Show = new Home_Admin_AccountUpdate_Update_Show();
                    home_Admin_AccountStatement_Update_Show.giveIndex(index1);
                    home_Admin_AccountStatement_Update_Show.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Wrong!!! Enter the information carefully");
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Error !!");
            }
        }
        private void update_Create_Click(object sender, EventArgs e)
        {
            Account_BO account_BO = new Account_BO();
            ArrayList list = new ArrayList(account_BO.readAccount());

            try
            {
                int temp = index1;
                if (update_userName_txt.Text != "" && update_Ocupation_TextBox.Text != null && update_Gender_com.Text != null && update_address.Text != null && update_phoneNo.Text != "" && update_Landline.Text != null && update_EmailID.Text != null && imagePath != null && update_dop_dtp.Text != null)
                {
                    list[temp + 1] = update_userName_txt.Text;
                    list[temp + 2] = update_address.Text;
                    list[temp + 3] = update_Gender_com.Text;
                    list[temp + 4] = update_dop_dtp.Text;
                    list[temp + 5] = update_Ocupation_TextBox.Text;
                    list[temp + 7] = update_phoneNo.Text;
                    list[temp + 8] = update_Landline.Text;
                    list[temp + 9] = update_EmailID.Text;

                    int i;
                    for (i = index1; list[i].ToString() != "*****"; i++)
                    {

                    }
                    int j = i - 1;
                    list[j] = imagePath;
                    account_BO.createAccount(list);
                    Home_Admin_AccountUpdate_Update_Show home_Admin_AccountStatement_Update_Show = new Home_Admin_AccountUpdate_Update_Show();
                    home_Admin_AccountStatement_Update_Show.giveIndex(index1);
                    home_Admin_AccountStatement_Update_Show.Show();
                    this.Hide();
                }
                else
                    MessageBox.Show("Wrong!!! Enter the information carefully");
            }
            catch (Exception)
            {
                MessageBox.Show("Error !!");
            }
        }