/// <summary>
 /// Function to fill additional cost
 /// </summary>
 public void AdditionalCostComboFill()
 {
     try
     {
         List<DataTable> ListObj = new List<DataTable>();
         AccountLedgerBll bllAccountLedger = new AccountLedgerBll();
         ListObj = bllAccountLedger.AdditionalCostGet();
         dgvcmbAdditionalCostLedger.DataSource = ListObj[0];
         dgvcmbAdditionalCostLedger.ValueMember = "ledgerId";
         dgvcmbAdditionalCostLedger.DisplayMember = "ledgerName";
     }
     catch (Exception ex)
     {
         MessageBox.Show("SJ:25" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// dgvAdditionalCost grid cellbeginedit event
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dgvAdditionalCost_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
 {
     try
     {
         List<DataTable> ListObj = new List<DataTable>();
         AccountLedgerBll bllAccountLedger = new AccountLedgerBll();
         if (dgvAdditionalCost.CurrentCell.ColumnIndex == dgvAdditionalCost.Columns["dgvcmbAdditionalCostLedger"].Index)
         {
             ListObj = bllAccountLedger.AdditionalCostGet();
             if (ListObj[0].Rows.Count > 0)
             {
                 if (dgvAdditionalCost.RowCount > 1)
                 {
                     int inGridRowCount = dgvAdditionalCost.RowCount;
                     for (int inI = 0; inI < inGridRowCount - 1; inI++)
                     {
                         if (inI != e.RowIndex)
                         {
                             int inTableRowcount = ListObj[0].Rows.Count;
                             for (int inJ = 0; inJ < inTableRowcount; inJ++)
                             {
                                 if (dgvAdditionalCost.Rows[inI].Cells["dgvcmbAdditionalCostLedger"].Value != null && dgvAdditionalCost.Rows[inI].Cells["dgvcmbAdditionalCostLedger"].Value.ToString() != string.Empty)
                                 {
                                     if (ListObj[0].Rows[inJ]["ledgerId"].ToString() == dgvAdditionalCost.Rows[inI].Cells["dgvcmbAdditionalCostLedger"].Value.ToString())
                                     {
                                         ListObj[0].Rows.RemoveAt(inJ);
                                         break;
                                     }
                                 }
                             }
                         }
                     }
                 }
                 DataGridViewComboBoxCell dgvcmbLedger = (DataGridViewComboBoxCell)dgvAdditionalCost[dgvAdditionalCost.Columns["dgvcmbAdditionalCostLedger"].Index, e.RowIndex];
                 dgvcmbLedger.DataSource = ListObj[0];
                 dgvcmbLedger.ValueMember = "ledgerId";
                 dgvcmbLedger.DisplayMember = "ledgerName";
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SJ:77" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }