private void Load_Details() { try { dtFormulaMaterials = objBatchFormulaMaterial_DL.GetView(objBatch.BatchID); txtBatchNo.Text = objBatch.BatchID; txtBatchSize.Text = objBatch.BatchSize.ToString(); txtProduct.Text = objBatch.StandardBatch.STDBatchBasicProduct.Code; bindActivityList.DataSource = objBatchActivity_DL.GetView(objBatch.BatchID); lblUnit1.Text = objBatch.StandardBatch.STDBatchBasicProduct.BasicProductUnit.UnitCode; if (dtFormulaMaterials.Rows.Count > 0) { dgvFormulaMaterial.AutoGenerateColumns = false; objSourceFormulaMaterials.DataSource = dtFormulaMaterials; dgvFormulaMaterial.DataSource = objSourceFormulaMaterials; objSourceFormulaMaterials.ResetBindings(true); } else { dgvFormulaMaterial.AutoGenerateColumns = false; objSourceFormulaMaterials.DataSource = null; dgvFormulaMaterial.DataSource = objSourceFormulaMaterials; objSourceFormulaMaterials.ResetBindings(true); } } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void Load_Activity_List() { try { if ((dgvBatcList.CurrentRow != null) && (dgvBatcList.CurrentRow.IsNewRow == false)) { DataTable dt = objBatchActivity_DL.GetView(dgvBatcList.CurrentRow.Cells["BatchNo"].Value.ToString()); objSourceActivityList.DataSource = dt; dgvActivity.AutoGenerateColumns = false; dgvActivity.DataSource = objSourceActivityList; objSourceActivityList.ResetBindings(true); objBatch = objBatch_DL.Get(dgvBatcList.CurrentRow.Cells["BatchNo"].Value.ToString()); } else { DataTable dt = null; objSourceActivityList.DataSource = dt; dgvActivity.AutoGenerateColumns = false; dgvActivity.DataSource = objSourceActivityList; objSourceActivityList.ResetBindings(true); objBatch = null; } SetColors(); } catch (Exception) { MessageBox.Show(this, "Error occured while loading Activity List", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void gvBatchList_CellClick(object sender, DataGridViewCellEventArgs e) { try { objBatch = objBatchDL.Get(gvBatchList.Rows[e.RowIndex].Cells["ColBatchNo"].Value.ToString()); dtFormulaMaterials = objBatchFormulaMaterial_DL.GetView(objBatch.BatchID); txtBatchNo.Text = objBatch.BatchID; txtBatchSize.Text = objBatch.BatchSize.ToString(); txtProduct.Text = objBatch.StandardBatch.STDBatchBasicProduct.Code; bindActivityList.DataSource = objBatchActivity_DL.GetView(objBatch.BatchID); lblUnit1.Text = objBatch.StandardBatch.STDBatchBasicProduct.BasicProductUnit.UnitCode; dgvFormulaMaterial.AutoGenerateColumns = false; objSourceFormulaMaterials.DataSource = dtFormulaMaterials; dgvFormulaMaterial.DataSource = objSourceFormulaMaterials; objSourceFormulaMaterials.ResetBindings(true); } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void Load_Activity_List() { try { if (objBatch.BatchID != "") { DataTable dt = objBatchActivity_DL.GetView(objBatch.BatchID); objSourceActivityList.DataSource = dt; dgvActivity.AutoGenerateColumns = false; dgvActivity.DataSource = objSourceActivityList; objSourceActivityList.ResetBindings(true); } else { DataTable dt = null; objSourceActivityList.DataSource = dt; dgvActivity.AutoGenerateColumns = false; dgvActivity.DataSource = objSourceActivityList; objSourceActivityList.ResetBindings(true); } SetColors(); } catch (Exception) { MessageBox.Show(this, "Error occured while loading Activity List", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void Load_BatchActivity() { try { DataTable dt = new DataTable(); dt = objBatchActivity_DL.GetView(BatchID); dgvBatchActivity.AutoGenerateColumns = false; objSourceBatchActivity.DataSource = dt; } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } }