コード例 #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 Remove_Click(object sender, EventArgs e)
        {
            Account_BO account_BO = new Account_BO();
            ArrayList  list       = new ArrayList(account_BO.readAccount());

            try
            {
                int temp = index1;

                int i;
                int k = 1;;
                for (i = index1; list[i].ToString() != "*****"; i++)
                {
                    k++;
                }
                list.RemoveRange(temp, k);

                account_BO.createAccount(list);
                MessageBox.Show("Account remove successfull...");

                this.Hide();
                Home_Admin home_Admin = new Home_Admin();
                home_Admin.Show();
            }
            catch
            {
                MessageBox.Show("Wrong!!!");
            }
        }
コード例 #3
0
        private void yesADD_Click_1(object sender, EventArgs e)
        {
            string     x;
            Account_BO account_BO = new Account_BO();
            ArrayList  list       = new ArrayList(account_BO.readAccount());
            ArrayList  savelist   = new ArrayList();
            int        y1         = 0;

            y1  = Convert.ToInt32(y);
            y1 += 1;
            x   = Convert.ToString(y1);
            int i;

            for (i = index1; list[i].ToString() != "*****"; i++)
            {
                if (list[i].ToString() == x)
                {
                    y1++;
                    x = Convert.ToString(y1);
                }
            }
            int j2 = i - 2;
            int j1 = i - 1;

            for (int k = 0; k <= j2; k++)
            {
                savelist.Add(list[k]);
            }
            savelist.Add(x);
            int j = 0;

            for (j = j1; j < list.Count; j++)
            {
                savelist.Add(list[j]);
            }
            account_BO.createAccount(savelist);
            this.Hide();
            MessageBox.Show("Year " + x + " Added Succssfully, Please Re-enter ID & This Year");
            Home_Admin_AccountWithdraw h = new Home_Admin_AccountWithdraw();

            h.Show();
        }
コード例 #4
0
        private void yes_Click(object sender, EventArgs e)
        {
            int        j          = index2 + 2;
            int        j1         = index2 + 1;
            Account_BO account_BO = new Account_BO();
            ArrayList  list       = new ArrayList(account_BO.readAccount());
            ArrayList  lastList   = new ArrayList();
            ArrayList  saveList   = new ArrayList();

            if (account_BO.security_Checker("rintu", password.Text))
            {
                if (index2 - index1 == 5)
                {
                    if (index1 != 0)
                    {
                        for (int i = 0; i < index1; i++)
                        {
                            saveList.Add(list[i]);
                        }

                        for (int i = index1; i <= index2 + 1; i++)
                        {
                            saveList.Add(list[i]);
                        }
                        for (int k = j; k < list.Count; k++)
                        {
                            lastList.Add(list[k]);
                        }
                        if (m == 1)
                        {
                            saveList.Add("January");
                        }
                        if (m == 2)
                        {
                            saveList.Add("February");
                        }
                        if (m == 3)
                        {
                            saveList.Add("March");
                        }
                        if (m == 4)
                        {
                            saveList.Add("April");
                        }
                        if (m == 5)
                        {
                            saveList.Add("May");
                        }
                        if (m == 6)
                        {
                            saveList.Add("June");
                        }
                        if (m == 7)
                        {
                            saveList.Add("July");
                        }
                        if (m == 8)
                        {
                            saveList.Add("August");
                        }
                        if (m == 9)
                        {
                            saveList.Add("September");
                        }
                        if (m == 10)
                        {
                            saveList.Add("October");
                        }
                        if (m == 11)
                        {
                            saveList.Add("November");
                        }
                        if (m == 12)
                        {
                            saveList.Add("December");
                        }
                        for (int i = 0; i < lastList.Count; i++)
                        {
                            saveList.Add(lastList[i]);
                        }

                        account_BO.createAccount(saveList);
                        MessageBox.Show("Payment Successfully Done");
                        this.Hide();

                        home_admin.Show();
                    }
                    else
                    {
                        for (int i = index1; i <= index2 + 1; i++)
                        {
                            saveList.Add(list[i]);
                        }
                        for (int k = j; k < list.Count; k++)
                        {
                            lastList.Add(list[k]);
                        }

                        if (m == 1)
                        {
                            saveList.Add("January");
                        }
                        if (m == 2)
                        {
                            saveList.Add("February");
                        }
                        if (m == 3)
                        {
                            saveList.Add("March");
                        }
                        if (m == 4)
                        {
                            saveList.Add("April");
                        }
                        if (m == 5)
                        {
                            saveList.Add("May");
                        }
                        if (m == 6)
                        {
                            saveList.Add("June");
                        }
                        if (m == 7)
                        {
                            saveList.Add("July");
                        }
                        if (m == 8)
                        {
                            saveList.Add("August");
                        }
                        if (m == 9)
                        {
                            saveList.Add("September");
                        }
                        if (m == 10)
                        {
                            saveList.Add("October");
                        }
                        if (m == 11)
                        {
                            saveList.Add("November");
                        }
                        if (m == 12)
                        {
                            saveList.Add("December");
                        }
                        for (int i = 0; i < lastList.Count; i++)
                        {
                            saveList.Add(lastList[i]);
                        }

                        account_BO.createAccount(saveList);
                        MessageBox.Show("Payment Successfully Done");
                        this.Hide();
                        home_admin.Show();
                    }
                }
                else
                {
                    if (index1 != 0)
                    {
                        for (int i = 0; i < index1; i++)
                        {
                            saveList.Add(list[i]);
                        }

                        for (int i = index1; i <= index2; i++)
                        {
                            saveList.Add(list[i]);
                        }
                        for (int k = j1; k < list.Count; k++)
                        {
                            lastList.Add(list[k]);
                        }
                        if (m == 1)
                        {
                            saveList.Add("January");
                        }
                        if (m == 2)
                        {
                            saveList.Add("February");
                        }
                        if (m == 3)
                        {
                            saveList.Add("March");
                        }
                        if (m == 4)
                        {
                            saveList.Add("April");
                        }
                        if (m == 5)
                        {
                            saveList.Add("May");
                        }
                        if (m == 6)
                        {
                            saveList.Add("June");
                        }
                        if (m == 7)
                        {
                            saveList.Add("July");
                        }
                        if (m == 8)
                        {
                            saveList.Add("August");
                        }
                        if (m == 9)
                        {
                            saveList.Add("September");
                        }
                        if (m == 10)
                        {
                            saveList.Add("October");
                        }
                        if (m == 11)
                        {
                            saveList.Add("November");
                        }
                        if (m == 12)
                        {
                            saveList.Add("December");
                        }
                        for (int i = 0; i < lastList.Count; i++)
                        {
                            saveList.Add(lastList[i]);
                        }

                        account_BO.createAccount(saveList);
                        MessageBox.Show("Payment Successfully Done");
                        this.Hide();

                        home_admin.Show();
                    }
                    else
                    {
                        for (int i = index1; i <= index2; i++)
                        {
                            saveList.Add(list[i]);
                        }
                        for (int k = j1; k < list.Count; k++)
                        {
                            lastList.Add(list[k]);
                        }

                        if (m == 1)
                        {
                            saveList.Add("January");
                        }
                        if (m == 2)
                        {
                            saveList.Add("February");
                        }
                        if (m == 3)
                        {
                            saveList.Add("March");
                        }
                        if (m == 4)
                        {
                            saveList.Add("April");
                        }
                        if (m == 5)
                        {
                            saveList.Add("May");
                        }
                        if (m == 6)
                        {
                            saveList.Add("June");
                        }
                        if (m == 7)
                        {
                            saveList.Add("July");
                        }
                        if (m == 8)
                        {
                            saveList.Add("August");
                        }
                        if (m == 9)
                        {
                            saveList.Add("September");
                        }
                        if (m == 10)
                        {
                            saveList.Add("October");
                        }
                        if (m == 11)
                        {
                            saveList.Add("November");
                        }
                        if (m == 12)
                        {
                            saveList.Add("December");
                        }
                        for (int i = 0; i < lastList.Count; i++)
                        {
                            saveList.Add(lastList[i]);
                        }

                        account_BO.createAccount(saveList);
                        MessageBox.Show("Payment Successfully Done");
                        this.Hide();
                        home_admin.Show();
                    }
                }
            }
            else
            {
                MessageBox.Show("Wrong Password !");
                password.Clear();
            }
        }
コード例 #5
0
        private void Create_Click(object sender, EventArgs e)
        {
            Account_BO     account_Bo     = new Account_BO();
            Account_ENTITY account_Entity = new Account_ENTITY();

            ArrayList listAccount = new ArrayList(account_Bo.readAccount());

            try
            {
                if (userName.Text != "" && userID.Text != "" && address.Text != "" && phoneNo.Text != "" && this.dateTimePicker1.Text != null && regFee != null && imagePath != null)
                {
                    if (Convert.ToDouble(regFee.Text) == 120)
                    {
                        int flag = 0;
                        for (int i = 0; i < listAccount.Count; i++)
                        {
                            if (listAccount[i].ToString() == userID.Text)
                            {
                                MessageBox.Show("Wrong!!! This User ID is already in used");
                                flag = 1;
                                break;
                            }
                        }
                        account_Entity.identity = "*****";
                        account_Entity.userID   = userID.Text;
                        account_Entity.userName = userName.Text;
                        account_Entity.address  = address.Text;
                        account_Entity.phoneNo  = phoneNo.Text;
                        account_Entity.regFee   = Convert.ToInt32(regFee.Text);
                        account_Entity.date     = this.dateTimePicker1.Text;


                        if (flag == 0)
                        {
                            listAccount.Add(account_Entity.userID);
                            listAccount.Add(account_Entity.userName);
                            listAccount.Add(account_Entity.address);
                            listAccount.Add(account_Entity.phoneNo);
                            listAccount.Add(account_Entity.regFee);
                            listAccount.Add(account_Entity.date);
                            listAccount.Add(imagePath);
                            listAccount.Add(account_Entity.identity);



                            account_Bo.createAccount(listAccount);
                            MessageBox.Show("The Account create successful");
                            this.Hide();
                            Home_Admin home_admin = new Home_Admin();
                            home_admin.Show();
                        }

                        userID.Clear();
                        userName.Clear();
                        address.Clear();
                        phoneNo.Clear();
                        regFee.ResetText();
                    }
                    else
                    {
                        MessageBox.Show("Wrong!! You have to must deposit at least 120TK");
                    }
                }
                else
                {
                    MessageBox.Show("Wrong!!! Enter the information fully");
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Error!!! Please Retry");
            }
        }