private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     selectedRow = e.RowIndex;
     if (selectedRow >= 0)
     {
         objInvoices[selectedRow].loadRows();
         dlgCashRegisterPayment dlg = new dlgCashRegisterPayment(true);
         dlg.objInvoice = objInvoices[selectedRow];
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             pbOK_Click(this, new EventArgs());
         }
     }
 }
        private void pbNewPayment_Click(object sender, EventArgs e)
        {
            Invoice newInv = new Invoice();

            newInv.dtInvoiceDate = DateTime.Now;
            //if (selectedRow >= 0)
            //{
            //    newInv.strCustNo = objInvoices[selectedRow].strCustNo;
            //    newInv.strCustomerName = objInvoices[selectedRow].strCustomerName;
            //    newInv.strInvoiceNo = objInvoices[selectedRow].strInvoiceNo;
            //    newInv.strOrderNo = objInvoices[selectedRow].strOrderNo;
            //}
            newInv.strInvoiceModule = "CU";
            newInv.InvoiceFlag      = InvoiceFlags.CashRegisterFlag;
            newInv.strType          = "Cash Register";
            dlgCashRegisterPayment dlg = new dlgCashRegisterPayment(false);

            dlg.objInvoice = newInv;
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                pbOK_Click(this, new EventArgs());
            }
        }