private void dgvBatcList_CellClick(object sender, DataGridViewCellEventArgs e) { try { if (dgvBatcList.Rows.Count > 0) { objBatch = objBatch_DL.Get(dgvBatcList.CurrentRow.Cells["BatchNo"].Value.ToString()); txtBatchID.Text = objBatch.BatchID; lblUnit.Text = objBatch.StandardBatch.STDBatchBasicProduct.BasicProductUnit.UnitCode; lblUnit1.Text = objBatch.StandardBatch.STDBatchBasicProduct.BasicProductUnit.UnitCode; objBatchActivity = objBatchActivity_DL.Get(objBatch.BatchID, objActivity.MainActID); DataTable dt = objFinishProduct_DL.GetBy_TypeandBasicProduct(objBatch.StandardBatch.STDBatchBasicProduct.BasicProductCode, true, "Primary"); objSourceFinishedProducts.DataSource = dt; cmbFinishedProduct.DataSource = objSourceFinishedProducts; Load_Activity(); } } catch (Exception) { MessageBox.Show(this, "Error occured while loading Batch List", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void dgvBatcList_CellClick(object sender, DataGridViewCellEventArgs e) { try { if (dgvBatcList.Rows.Count > 0) { objBatch = objBatch_DL.Get(dgvBatcList.CurrentRow.Cells["BatchNo"].Value.ToString()); txtBatchID.Text = objBatch.BatchID; objBatchActivity = objBatchActivity_DL.Get(objBatch.BatchID, objActivity.MainActID); Load_Activity(); } } catch (Exception) { MessageBox.Show(this, "Error occured while loading Batch List", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void dgvBatcList_CellClick(object sender, DataGridViewCellEventArgs e) { try { if (dt.Rows.Count > 0) { if (dgvBatcList.CurrentRow.IsNewRow == false) { objBatch = objBatch_DL.Get(dgvBatcList.CurrentRow.Cells["BatchNo"].Value.ToString()); objBatchActivity = objBatchActivity_DL.Get(objBatch.BatchID, objMainAct.MainActID); if (objBatchActivity.BatchActID != 0) { } else { objBatchActivity = new BatchActivity(); objBatchActivity.Batch = objBatch; objBatchActivity.BatchActStatus = BatchActivity.Status.Initial; objBatchActivity.BlockNextActivity = true; objBatchActivity.SequenceNo = -1; objBatchActivity.Part = "N/A"; objBatchActivity.MainActivity = objMainAct; objBatchActivity.LastEdited = DateTime.Now; objBatchActivity.ActType = "Manufacturing"; long ID = objBatchActivity_DL.Add(objBatchActivity); if (ID > 0) { objBatchActivity.BatchActID = ID; } } Load_LabourDetails(); Load_Formula(objBatch.BatchID, Part); } } } catch (Exception) { MessageBox.Show(this, "Error occured while loading", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }