/// <summary> /// To fill the grid /// </summary> public void GridFill() { try { if (cmbTax.SelectedValue != null && cmbVoucherType.SelectedItem != null) { TaxBll bllTax = new TaxBll(); List<DataTable> ListObj = new List<DataTable>(); DateTime dtFromDate = DateTime.Parse(txtFromDate.Text); DateTime dtToDate = DateTime.Parse(txtToDate.Text); decimal dectaxId = Convert.ToDecimal(cmbTax.SelectedValue.ToString()); decimal decvoucherTypeId = Convert.ToDecimal(cmbVoucherType.SelectedValue.ToString()); string strTypeofVoucher = Convert.ToString(cmbTypeOfVoucher.Text); if (isBillwise) { ListObj = bllTax.TaxReportGridFillByBillWise(dtFromDate, dtToDate, dectaxId, decvoucherTypeId, strTypeofVoucher, isInput); if (ListObj[0].Rows.Count > 0) { for (int i = 0; i < ListObj[0].Rows.Count; i++) { dgvTaxReport.Rows.Add(); dgvTaxReport.Rows[i].Cells["dgvtxtSlNo"].Value = Convert.ToDecimal(ListObj[0].Rows[i]["SlNo"]); dgvTaxReport.Rows[i].Cells["dgvtxtDate"].Value = ListObj[0].Rows[i]["Date"].ToString(); dgvTaxReport.Rows[i].Cells["dgvtxtVoucherType"].Value = ListObj[0].Rows[i]["TypeofVoucher"].ToString(); dgvTaxReport.Rows[i].Cells["dgvtxtVoucherNo"].Value = ListObj[0].Rows[i]["Voucher No"].ToString(); dgvTaxReport.Rows[i].Cells["dgvtxtCashParty"].Value = ListObj[0].Rows[i]["Cash/Party"].ToString(); dgvTaxReport.Rows[i].Cells["dgvtxtTIN"].Value = ListObj[0].Rows[i]["TIN"].ToString(); dgvTaxReport.Rows[i].Cells["dgvtxtCST"].Value = ListObj[0].Rows[i]["CST"].ToString(); dgvTaxReport.Rows[i].Cells["dgvtxtBillAmount"].Value = Convert.ToDecimal(ListObj[0].Rows[i]["Bill Amount"]); dgvTaxReport.Rows[i].Cells["dgvtxtCessAmount"].Value = Convert.ToDecimal(ListObj[0].Rows[i]["Cess Amount"]); dgvTaxReport.Rows[i].Cells["dgvtxtTaxAmount"].Value = Convert.ToDecimal(ListObj[0].Rows[i]["Tax Amount"]); } } } else { ListObj = bllTax.TaxReportGridFillByProductwise(dtFromDate, dtToDate, dectaxId, decvoucherTypeId, strTypeofVoucher, isInput); if (ListObj[0].Rows.Count > 0) { for (int i = 0; i < ListObj[0].Rows.Count; i++) { dgvTaxReport.Rows.Add(); dgvTaxReport.Rows[i].Cells["dgvtxtSlNo"].Value = Convert.ToDecimal(ListObj[0].Rows[i]["SlNo"]); dgvTaxReport.Rows[i].Cells["dgvtxtDate"].Value = ListObj[0].Rows[i]["Date"].ToString(); dgvTaxReport.Rows[i].Cells["dgvtxtVoucherType"].Value = ListObj[0].Rows[i]["Voucher Type"].ToString(); dgvTaxReport.Rows[i].Cells["dgvtxtBillNo"].Value = ListObj[0].Rows[i]["Bill No"].ToString(); dgvTaxReport.Rows[i].Cells["dgvtxtItem"].Value = ListObj[0].Rows[i]["Item"].ToString(); dgvTaxReport.Rows[i].Cells["dgvtxtBillAmount"].Value = Convert.ToDecimal(ListObj[0].Rows[i]["Bill Amount"]); dgvTaxReport.Rows[i].Cells["dgvtxtTax"].Value = Convert.ToDecimal(ListObj[0].Rows[i]["Tax %"]); dgvTaxReport.Rows[i].Cells["dgvtxtTaxAmount"].Value = Convert.ToDecimal(ListObj[0].Rows[i]["Tax Amount"]); dgvTaxReport.Rows[i].Cells["dgvtxtTotalAmount"].Value = Convert.ToDecimal(ListObj[0].Rows[i]["Total Amount"]); } } } } } catch (Exception ex) { MessageBox.Show("TR:3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }