/// <summary> /// fill the curresponding details for update /// </summary> public void TaxSelectionFillForUpdate() { try { int inRowCount = dgvTaxSelection.RowCount; for (int i = 0; i < inRowCount; i++) { dgvTaxSelection.Rows[i].Cells["dgvcbxSelect"].Value = false; } decTaxId = Convert.ToDecimal(dgvTaxSearch.CurrentRow.Cells["dgvtxtTaxIdSearch"].Value.ToString()); TaxInfo infoTax = new TaxInfo(); TaxSP spTax = new TaxSP(); TaxDetailsInfo infoTaxDetails = new TaxDetailsInfo(); TaxDetailsSP spTaxDetails = new TaxDetailsSP(); infoTax = spTax.TaxView(decTaxId); txtTaxName.Text = infoTax.TaxName; txtRate.Text = infoTax.Rate.ToString(); cmbApplicableFor.Text = infoTax.ApplicableOn; cmbCalculationMode.Text = infoTax.CalculatingMode; txtNarration.Text = infoTax.Narration; if (infoTax.IsActive.ToString() == "True") { cbxActive.Checked = true; } else { cbxActive.Checked = false; } strTaxName = infoTax.TaxName; decTaxIdForEdit = infoTax.TaxId; btnSave.Text = "Update"; btnDelete.Enabled = true; DataTable dtbl = new DataTable(); dtbl = spTax.TaxIdForTaxSelectionUpdate(decTaxId); foreach (DataRow dr in dtbl.Rows) { string strTaxId = dr["selectedtaxId"].ToString(); for (int i = 0; i < inRowCount; i++) { if (dgvTaxSelection.Rows[i].Cells["dgvtxtTaxId"].Value.ToString() == strTaxId) { dgvTaxSelection.Rows[i].Cells["dgvcbxSelect"].Value = true; } } } AccountLedgerSP spAccountLedger = new AccountLedgerSP(); decLedgerId = spAccountLedger.AccountLedgerIdGetByName(txtTaxName.Text); } catch (Exception ex) { MessageBox.Show("TC10:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }