Exemplo n.º 1
0
 /// <summary>
 /// Function to check existence of batch no
 /// </summary>
 /// <param name="e"></param>
 public void BatchNoExistenceChecking(DataGridViewCellEventArgs e)
 {
     try
     {
         BatchSP spBatch = new BatchSP();
         string strBatchNo = Convert.ToString(dgvProductCreation.Rows[e.RowIndex].Cells["dgvtxtbatch"].Value);
         decBatchId = Convert.ToDecimal(dgvProductCreation.Rows[e.RowIndex].Cells["dgvtxtbatchId"].Value);
         bool isOk = spBatch.BatchNameExistenceChecking(strBatchNo, decBatchId);
         if (!isOk)
         {
             Messages.InformationMessage("Batch No already exist");
             dgvProductCreation.CurrentCell = dgvProductCreation.Rows[e.RowIndex].Cells["dgvtxtbatch"];
             dgvProductCreation.Rows[e.RowIndex].Cells["dgvtxtbatch"].Value = "";
             dgvProductCreation.BeginEdit(true);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PC:6" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }