Beispiel #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();
        }
Beispiel #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();
        }