Ejemplo n.º 1
0
        private void frmAccountView_Load(object sender, EventArgs e)
        {
            tmrDateTime_Tick(sender, e);
            int       currentCustomerNum    = fileClass.getcurrentCustomerNum();
            int       currentAccountNum     = fileClass.getcurrentAccountNum();
            int       currentTransactionNum = 0;
            ArrayList returnedData          = fileClass.readFile();

            Customer  thisCustomer = (Customer)returnedData[currentCustomerNum];
            ArrayList accountList  = thisCustomer.getaccountList();
            Account   thisAccount  = (Account)accountList[currentAccountNum];

            lblCustomer.Text        = thisCustomer.getfirstName() + " " + thisCustomer.getsurname() + " - " + thisCustomer.getpostcode();
            lblAccountNickName.Text = thisAccount.getnickName();
            lblAccountNumber.Text   = Convert.ToString(thisAccount.getaccountNumber());
            lblAccountSortCode.Text = thisAccount.getsortCode();
            lblAccountBalance.Text  = String.Format("{0:c}", thisAccount.getcurrentBalance());

            foreach (Transaction oneTransaction in thisAccount.gettransactionList())
            {
                DataGridViewRow  dgvRow  = new DataGridViewRow();
                DataGridViewCell dgvCell = new DataGridViewTextBoxCell();

                dgvCell.Value = currentTransactionNum;
                dgvRow.Cells.Add(dgvCell);

                dgvCell       = new DataGridViewTextBoxCell();
                dgvCell.Value = oneTransaction.getdate();
                dgvRow.Cells.Add(dgvCell);

                dgvCell       = new DataGridViewTextBoxCell();
                dgvCell.Value = oneTransaction.gettype();
                dgvRow.Cells.Add(dgvCell);

                dgvCell       = new DataGridViewTextBoxCell();
                dgvCell.Value = oneTransaction.getdescription();
                dgvRow.Cells.Add(dgvCell);

                dgvCell       = new DataGridViewTextBoxCell();
                dgvCell.Value = oneTransaction.getamount();
                dgvRow.Cells.Add(dgvCell);

                dgvCell       = new DataGridViewTextBoxCell();
                dgvCell.Value = oneTransaction.getbalanceAfter();
                dgvRow.Cells.Add(dgvCell);

                dgvTransactions.Rows.Add(dgvRow);
                currentTransactionNum++;
            }

            dgvTransactions.Refresh();
        }
Ejemplo n.º 2
0
        private void frmCustomerView_Load(object sender, EventArgs e)
        {
            tmrDateTime_Tick(sender, e);
            int       currentCustomerNum = fileClass.getcurrentCustomerNum();
            int       currentAccountNum  = 0;
            ArrayList returnedData       = fileClass.readFile();

            Customer thisCustomer = (Customer)returnedData[currentCustomerNum];

            lblCustomerName.Text           = thisCustomer.getfirstName() + " " + thisCustomer.getsurname();
            lblCustomerDOB.Text            = thisCustomer.getdob();
            lblCustomerHouseNameOrNum.Text = thisCustomer.gethouseNameNumber();
            lblCustomerStreet.Text         = thisCustomer.getstreetName();
            lblCustomerAddress.Text        = thisCustomer.getaddressArea();
            lblCustomerTownOrCity.Text     = thisCustomer.getcityTown();
            lblCustomerCounty.Text         = thisCustomer.getcounty();
            lblCustomerPostcode.Text       = thisCustomer.getpostcode();

            foreach (Account oneAccount in thisCustomer.getaccountList())
            {
                DataGridViewRow  dgvRow  = new DataGridViewRow();
                DataGridViewCell dgvCell = new DataGridViewTextBoxCell();

                dgvCell.Value = currentAccountNum;
                dgvRow.Cells.Add(dgvCell);

                dgvCell       = new DataGridViewTextBoxCell();
                dgvCell.Value = oneAccount.getnickName();
                dgvRow.Cells.Add(dgvCell);

                dgvCell       = new DataGridViewTextBoxCell();
                dgvCell.Value = oneAccount.getcurrentBalance();
                dgvRow.Cells.Add(dgvCell);

                dgvAccounts.Rows.Add(dgvRow);
                currentAccountNum++;
            }

            dgvAccounts.Refresh();
        }
Ejemplo n.º 3
0
        private void frmCustomerEdit_Load(object sender, EventArgs e)
        {
            tmrDateTime_Tick(sender, e);
            int currentCustomerNum = fileClass.getcurrentCustomerNum();

            ArrayList returnedData = fileClass.readFile();

            Customer thisCustomer = (Customer)returnedData[currentCustomerNum];

            txtFirstName.Text   = thisCustomer.getfirstName();
            txtSurname.Text     = thisCustomer.getsurname();
            txtDob.Text         = thisCustomer.getdob();
            txtInitials.Text    = thisCustomer.getinitials();
            txtTitle.Text       = thisCustomer.gettitle();
            txtPassword.Text    = thisCustomer.getpassword();
            txtNumberName.Text  = thisCustomer.gethouseNameNumber();
            txtStreetName.Text  = thisCustomer.getstreetName();
            txtAddressArea.Text = thisCustomer.getaddressArea();
            txtCityTown.Text    = thisCustomer.getcityTown();
            txtCounty.Text      = thisCustomer.getcounty();
            txtPostcode.Text    = thisCustomer.getpostcode();
        }
Ejemplo n.º 4
0
        private void generateVerification()
        {
            int       currentCustomerNum = fileClass.getcurrentCustomerNum();
            ArrayList returnedData       = fileClass.readFile();

            Customer thisCustomer = (Customer)returnedData[currentCustomerNum];

            txt1stChar.Text = "";
            txt2ndChar.Text = "";
            txt3rdChar.Text = "";

            string password    = thisCustomer.getpassword();
            float  passwordLen = password.Length;

            int char1s = 1;
            int char1f = Convert.ToInt32(Math.Floor(passwordLen / 3f));

            int char2s = char1f + 1;
            int char2f = char2s + char1f;

            int char3s = char2f + 1;
            int char3f = Convert.ToInt32(passwordLen);

            Random random    = new Random();
            int    randomNum = random.Next(char1s, char1f + 1);

            lbl1stChar.Text = "#" + randomNum;
            char1           = password[randomNum - 1];

            randomNum       = random.Next(char2s, char2f + 1);
            lbl2ndChar.Text = "#" + randomNum;
            char2           = password[randomNum - 1];

            randomNum       = random.Next(char3s, char3f + 1);
            lbl3rdChar.Text = "#" + randomNum;
            char3           = password[randomNum - 1];

            txt1stChar.Focus();
        }