private void btnUpdate_Click(object sender, EventArgs e)
 {
     if (dgw.Rows.Count == 0)
     {
         Interaction.MsgBox("Please select record to update", MsgBoxStyle.Exclamation, "Update");
         return;
     }
     try
     {
         if (string.IsNullOrEmpty(dgw.CurrentRow.Cells[2].Value.ToString()))
         {
         }
         else
         {
             SQLConn.adding   = false;
             SQLConn.updating = true;
             invoice_no       = dgw.CurrentRow.Cells[1].Value.ToString();;
             frmAddEditInvoice aeC = new frmAddEditInvoice(invoice_no);
             aeC.ShowDialog();
         }
     }
     catch
     {
         Interaction.MsgBox("Please select record to update", MsgBoxStyle.Exclamation, "Update");
         return;
     }
 }
        private void btnNew_Click(object sender, EventArgs e)
        {
            SQLConn.adding   = true;
            SQLConn.updating = false;
            invoice_no       = "";
            frmAddEditInvoice aeC = new frmAddEditInvoice(invoice_no);

            aeC.ShowDialog();
        }
 public frmEnterDiscount(frmAddEditInvoice invoice)
 {
     InitializeComponent();
     Invoice = invoice;
 }
 public frmListProductforInvoice(frmAddEditInvoice invoice)
 {
     InitializeComponent();
     Invoice = invoice;
 }
 public frmListCustomerForInvoice(frmAddEditInvoice inv)
 {
     InitializeComponent();
     CInvoice = inv;
 }