/// <summary> /// Function to view all tax details for Report by bill wise based on parameter /// </summary> /// <param name="fromdate"></param> /// <param name="todate"></param> /// <param name="dectaxId"></param> /// <param name="decvoucherTypeId"></param> /// <param name="isInput"></param> /// <returns></returns> public List <DataTable> TaxReportGridFillByBillWise(DateTime fromdate, DateTime todate, decimal dectaxId, decimal decvoucherTypeId, string strTypeofVoucher, bool isInput) { List <DataTable> ListObj = new List <DataTable>(); try { ListObj = spTax.TaxReportGridFillByBillWise(fromdate, todate, dectaxId, decvoucherTypeId, strTypeofVoucher, isInput); } catch (Exception ex) { MessageBox.Show("TBLL18:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return(ListObj); }
/// <summary> /// To fill the grid /// </summary> public void GridFill() { try { if (cmbTax.SelectedValue != null && cmbVoucherType.SelectedItem != null) { DataTable dtbl = new DataTable(); TaxSP spTax = new TaxSP(); 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) { dtbl = spTax.TaxReportGridFillByBillWise(dtFromDate, dtToDate, dectaxId, decvoucherTypeId, strTypeofVoucher, isInput); if (dtbl.Rows.Count > 0) { for (int i = 0; i < dtbl.Rows.Count; i++) { dgvTaxReport.Rows.Add(); dgvTaxReport.Rows[i].Cells["dgvtxtSlNo"].Value = Convert.ToDecimal(dtbl.Rows[i]["SlNo"]); dgvTaxReport.Rows[i].Cells["dgvtxtDate"].Value = dtbl.Rows[i]["Date"].ToString(); dgvTaxReport.Rows[i].Cells["dgvtxtVoucherType"].Value = dtbl.Rows[i]["TypeofVoucher"].ToString(); dgvTaxReport.Rows[i].Cells["dgvtxtVoucherNo"].Value = dtbl.Rows[i]["Voucher No"].ToString(); dgvTaxReport.Rows[i].Cells["dgvtxtCashParty"].Value = dtbl.Rows[i]["Cash/Party"].ToString(); dgvTaxReport.Rows[i].Cells["dgvtxtTIN"].Value = dtbl.Rows[i]["TIN"].ToString(); dgvTaxReport.Rows[i].Cells["dgvtxtCST"].Value = dtbl.Rows[i]["CST"].ToString(); dgvTaxReport.Rows[i].Cells["dgvtxtBillAmount"].Value = Convert.ToDecimal(dtbl.Rows[i]["Bill Amount"]); dgvTaxReport.Rows[i].Cells["dgvtxtCessAmount"].Value = Convert.ToDecimal(dtbl.Rows[i]["Cess Amount"]); dgvTaxReport.Rows[i].Cells["dgvtxtTaxAmount"].Value = Convert.ToDecimal(dtbl.Rows[i]["Tax Amount"]); } } } else { dtbl = spTax.TaxReportGridFillByProductwise(dtFromDate, dtToDate, dectaxId, decvoucherTypeId, strTypeofVoucher, isInput); if (dtbl.Rows.Count > 0) { for (int i = 0; i < dtbl.Rows.Count; i++) { dgvTaxReport.Rows.Add(); dgvTaxReport.Rows[i].Cells["dgvtxtSlNo"].Value = Convert.ToDecimal(dtbl.Rows[i]["SlNo"]); dgvTaxReport.Rows[i].Cells["dgvtxtDate"].Value = dtbl.Rows[i]["Date"].ToString(); dgvTaxReport.Rows[i].Cells["dgvtxtVoucherType"].Value = dtbl.Rows[i]["Voucher Type"].ToString(); dgvTaxReport.Rows[i].Cells["dgvtxtBillNo"].Value = dtbl.Rows[i]["Bill No"].ToString(); dgvTaxReport.Rows[i].Cells["dgvtxtItem"].Value = dtbl.Rows[i]["Item"].ToString(); dgvTaxReport.Rows[i].Cells["dgvtxtBillAmount"].Value = Convert.ToDecimal(dtbl.Rows[i]["Bill Amount"]); dgvTaxReport.Rows[i].Cells["dgvtxtTax"].Value = Convert.ToDecimal(dtbl.Rows[i]["Tax %"]); dgvTaxReport.Rows[i].Cells["dgvtxtTaxAmount"].Value = Convert.ToDecimal(dtbl.Rows[i]["Tax Amount"]); dgvTaxReport.Rows[i].Cells["dgvtxtTotalAmount"].Value = Convert.ToDecimal(dtbl.Rows[i]["Total Amount"]); } } } } } catch (Exception ex) { MessageBox.Show("TR:3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }