Example #1
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();
        }
Example #2
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();
        }