protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string strParams = Request.QueryString["params"]; string[] strVal = strParams.Split(','); grBankStatement.DataSource = objPayRptMgr.GetBankStatmentDetails(strVal[0], strVal[1], strVal[2], strVal[4]); grBankStatement.DataBind(); int i = 1; decimal decTotal = 0; lblBank.Text = strVal[3].Trim(); lblPrintDate.Text = DateTime.Today.ToLongDateString(); foreach (GridViewRow gRow in grBankStatement.Rows) { decTotal = decTotal + Common.RoundDecimal(gRow.Cells[5].Text.Trim(), 2); gRow.Cells[6].Text = gRow.Cells[6].Text.Trim() + " " + Common.ReturnFullMonthName(strVal[0].Trim()) + " " + strVal[1].Trim(); gRow.Cells[7].Text = Common.DisplayDate(gRow.Cells[7].Text); //gRow.Cells[0].Text = i.ToString(); //i++; } if (grBankStatement.Rows.Count > 0) { grBankStatement.FooterRow.Cells[1].Text = "Total"; grBankStatement.FooterRow.Cells[1].HorizontalAlign = HorizontalAlign.Right; grBankStatement.FooterRow.Cells[5].Text = decTotal.ToString(); grBankStatement.FooterRow.Cells[5].HorizontalAlign = HorizontalAlign.Right; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string strParams = Request.QueryString["params"]; string[] strVal = strParams.Split(','); grBankStatement.DataSource = objPayRptMgr.GetBankStatmentDetails(strVal[0], strVal[1], strVal[2], strVal[3]); grBankStatement.DataBind(); int i = 1; foreach (GridViewRow gRow in grBankStatement.Rows) { gRow.Cells[0].Text = i.ToString(); gRow.Cells[4].Text = gRow.Cells[4].Text.Trim() + " " + Common.ReturnFullMonthName(strVal[0].Trim()) + " " + strVal[1].Trim(); i++; gRow.Cells[6].Text = Common.DisplayDate(gRow.Cells[6].Text); } } }