private void setInvoice()
 {
     //Check if invoice already exist or not
     OBJ_Stock.INVOICE_NO = txtInvoice.AdvanceText;
     OBJ_Stock.COMPANY_CODE =Convert.ToInt32( txtComCode.AdvanceText);
     if (HandlerToDB.GetCount(ConfigSelectQueryModes.NO_OF_INVOICES) == 0)
     {
         txtInvoice.Enabled = false;
         txtBatchNo.Enabled = true;
         txtBatchNo.Focus();
         CurrentStage = Stage.locked;
     }
     else
     {
         txtInvoice.AdvanceText = "";
         HANDLER.ShowMessage(txtMessage, "Invoice Already Exist in "+ ComDataGrid.Rows[ComDataGrid.SelectedRows[0].Index].Cells["C_Name"].Value.ToString());
     }
 }
 private void setBatch()
 {
     //Check if invoice already exist or not
     OBJ_Stock.BATCH_NO = txtBatchNo.AdvanceText;
     OBJ_Stock.COMPANY_CODE = Convert.ToInt32(txtComCode.AdvanceText);
     if (HandlerToDB.GetCount(ConfigSelectQueryModes.NO_OF_BATCHS) == 0)
     {
         txtQuantity.Enabled = true;
         dateInvoice.Enabled = true;
         DateExpiry.Enabled = true;                
         gbActions.Enabled = true;
         gPricing.Enabled = true;
         txtBatchNo.Enabled = false;
     }
     else
     {
         txtBatchNo.AdvanceText = "";
         HANDLER.ShowMessage(txtMessage, "Batch Already Exist in "+ComDataGrid.Rows[ComDataGrid.SelectedRows[0].Index].Cells["C_Name"].Value.ToString());
     }
 }