/// <summary> /// Function to fill additional cost grid /// </summary> public void AdditionalCostGridFill() { List<DataTable> ListObjforaccountLedger = new List<DataTable>(); PurchaseInvoiceBll BllPurchaseInvoice = new PurchaseInvoiceBll(); AditionalCostBll bllAdditionalCost = new AditionalCostBll(); try { ListObjforaccountLedger = BllPurchaseInvoice.AccountLedgerViewForAdditionalCost(); DataRow dr = ListObjforaccountLedger[0].NewRow(); dr["ledgerName"] = string.Empty; dr["ledgerId"] = 0; ListObjforaccountLedger[0].Rows.InsertAt(dr, 0); dgvcmbLedger.DataSource = ListObjforaccountLedger[0]; dgvcmbLedger.DisplayMember = "ledgerName"; dgvcmbLedger.ValueMember = "ledgerId"; if (decPurchaseMasterId == 0) { AdditionalCostComboFill(0); } else { List<DataTable> ListObj = new List<DataTable>(); ListObj = bllAdditionalCost.AdditionalCostViewAllByVoucherTypeIdAndVoucherNo(decPurchaseInvoiceVoucherTypeId, strVoucherNo); dgvAdditionalCost.DataSource = ListObj[0]; } AdditionalCostSerialNo(); } catch (Exception ex) { MessageBox.Show("PI26:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }