Exemplo n.º 1
0
        private void LoadGridBillOutstanding(TransactionEntity transactionEntity)
        {
            List <PharmaBusinessObjects.Transaction.ReceiptPayment.BillOutstanding> allOutstandings = applicationFacade.GetAllBillOutstandingForLedger(transactionEntity);

            dgvCustomerBillOS.DataSource = allOutstandings;
            ExtensionMethods.SetGridDefaultProperty(dgvCustomerBillOS);

            dgvCustomerBillOS.Columns["InvoiceNumber"].Visible      = true;
            dgvCustomerBillOS.Columns["InvoiceNumber"].HeaderText   = "Bill Number";
            dgvCustomerBillOS.Columns["InvoiceNumber"].DisplayIndex = 0;

            dgvCustomerBillOS.Columns["InvoiceDate"].Visible                 = true;
            dgvCustomerBillOS.Columns["InvoiceDate"].HeaderText              = "Bill Date";
            dgvCustomerBillOS.Columns["InvoiceDate"].DisplayIndex            = 1;
            dgvCustomerBillOS.Columns["InvoiceDate"].DefaultCellStyle.Format = "dd/MM/yyyy";

            dgvCustomerBillOS.Columns["BillAmount"].Visible      = true;
            dgvCustomerBillOS.Columns["BillAmount"].HeaderText   = "Bill Amount";
            dgvCustomerBillOS.Columns["BillAmount"].DisplayIndex = 2;

            dgvCustomerBillOS.Columns["OSAmount"].Visible      = true;
            dgvCustomerBillOS.Columns["OSAmount"].HeaderText   = "Outstanding Amount";
            dgvCustomerBillOS.Columns["OSAmount"].DisplayIndex = 3;

            //Display totall of outstanding amount
            decimal totallOutstanding = 0;

            allOutstandings.ForEach(x => totallOutstanding += x.OSAmount);
            lblAmtOSVal.Text = Convert.ToString(totallOutstanding);
        }