/// <summary> /// Batch combobox fill /// </summary> public void BatchComboFill() { try { BatchBll BllBatch = new BatchBll(); List<DataTable> list = BllBatch.BatchViewAll(); cmbBatchNo.DisplayMember = "batchNo"; cmbBatchNo.ValueMember = "batchId"; DataRow dr = list[0].NewRow(); dr["batchId"] = -1; dr["batchNo"] = "All"; list[0].Rows.InsertAt(dr, 0); cmbBatchNo.DataSource = list[0]; cmbBatchNo.SelectedIndex = 0; } catch (Exception ex) { MessageBox.Show(" PVSBR:6" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Batch all combofill for Grid /// </summary> public void batchAllComboFill() { try { BatchBll BllBatch = new BatchBll(); List<DataTable> listBatch = new List<DataTable>(); listBatch = BllBatch.BatchViewAll(); dgvcmbSalesInvoiceBatch.DataSource = listBatch[0]; dgvcmbSalesInvoiceBatch.ValueMember = "batchId"; dgvcmbSalesInvoiceBatch.DisplayMember = "batchNo"; } catch (Exception ex) { MessageBox.Show("SI: 29" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public void DGVBatchComboFill() { try { BatchBll BllBatch = new BatchBll(); List<DataTable> listBatch = new List<DataTable>(); listBatch = BllBatch.BatchViewAll(); dgvcmbBatch.DataSource = listBatch; DataRow dr = listBatch[0].NewRow(); dr[0] = 0; dr[1] = "NA"; listBatch[0].Rows.InsertAt(dr, 0); dgvcmbBatch.ValueMember = "batchId"; dgvcmbBatch.DisplayMember = "batchNo"; } catch (Exception ex) { MessageBox.Show("SO34:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }