protected void Page_Load(object sender, EventArgs e) { global.checkSession(); objLog.WriteLog("FormCSelect : page_load"); try { if (Session["table"] != null) { dtnew = (DataTable)Session["table"]; for (int j = 0; j < dtnew.Rows.Count; j++) { double amt = Convert.ToDouble(dtnew.Rows[j]["TRND_AMOUNT"]); dtnew.Rows[j]["TRND_AMOUNT"] = String.Format(new CultureInfo("hi-IN", false), "{0:0,0.00}", Convert.ToDouble(dtnew.Rows[j]["TRND_AMOUNT"])); } DataRow row = dtnew.NewRow(); string stramt = String.Format(new CultureInfo("hi-IN", false), "{0:0,0.00}", Convert.ToDouble(dtnew.Compute("Sum(TRND_AMOUNT)", ""))); row["TRND_AMOUNT"] = String.Format(new CultureInfo("hi-IN", false), "{0:0,0.00}", Convert.ToDouble(dtnew.Compute("Sum(TRND_AMOUNT)", ""))); row["TRND_INSTRUMENTNUMBER"] = "Grand Total"; dtnew.Rows.Add(row); gv.DataSource = dtnew; //gv.DataSource = (DataTable)Session["table"]; gv.DataBind(); objfrmpt.FormatGridView(gv); } } catch (Exception ex) { objLog.WriteLog("form c Select Exception in PageLoad() : " + ex.Message); ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert('" + ex.Message + "')</script>"); } finally { dtnew.Dispose(); } }
protected void btnOK_Click(object sender, EventArgs e) { DataTable dtDCB = new DataTable(); DataTable dtDetails = new DataTable(); DataRow row; globalSession.checkSession(); OraConn = objDataFetch.getSingletonConnectionInstance(); objCmdSave.Connection = OraConn; string abbr = "", sOD = "", sLoan = "", strFrmDate = "", strToDate = ""; int intRecount = 0; double dblSlNo = 0, dblTotErlierDemand = 0.00, dblTotPresentDemand = 0.00, dblTotPresentCollection = 0.00, dblGTotErlierCollection = 0.00, dblTotFutureCollection = 0.00, dblTotErlierBalance = 0.00, dblTotPresentBalance = 0.00, dblgrdTotdmd = 0.00, dblgrdTotColl = 0.00, dblgrdTotBal = 0.00, dblTotErDemand = 0.00, dblTotPrDemand = 0.00, dblgrdTotdemand = 0.00, dblGTotErCollection = 0.00, dblTotPrCollection = 0.00, dblTotFuCollection = 0.00, dblgrdTotCollection = 0.00, dblTotErBalance = 0.00, dblTotPrBalance = 0.00, dblgrdTotBalance = 0.00; DateTime temp; try { strFrmDate = txtFromDate.Text.ToString(); Session["strFrmDate"] = strFrmDate; strToDate = txtToDate.Text; Session["strToDate"] = strToDate; if (!(DateTime.TryParse(strFrmDate, out temp))) { ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert ('Enter a Valid From Date') </script>"); return; } if (!(DateTime.TryParse(strToDate, out temp))) { ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert ('Enter a Valid To Date') </script>"); return; } if ((Convert.ToDateTime(strFrmDate) > DateTime.Now) || (Convert.ToDateTime(strToDate) > DateTime.Now)) { ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert ('Enter a Valid Date') </script>"); return; } if (Convert.ToDateTime(strFrmDate) > Convert.ToDateTime(strToDate)) { ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert ('Check From and To Dates') </script>"); return; } if ((chkLoanScheme.SelectedValue == "") && (chkODScheme.SelectedValue == "")) { ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert ('Select atleast one Scheme') </script>"); return; } for (int c = 0; c < chkODScheme.Items.Count; c++) { if (chkODScheme.Items[c].Selected) { abbr += chkODScheme.Items[c].Value.Trim() + ","; sOD += "" + chkODScheme.Items[c].Value.Trim() + ","; intRecount = intRecount + 1; } } objLog.WriteLog("DCBStatment sOD : " + sOD); for (int i = 0; i < chkLoanScheme.Items.Count; i++) { if (chkLoanScheme.Items[i].Selected) { abbr += chkLoanScheme.Items[i].Value.Trim() + ","; sLoan += "" + chkLoanScheme.Items[i].Value.Trim() + ","; intRecount = intRecount + 1; } } objLog.WriteLog("DCBStatment sLoan : " + sLoan); OracleCommand cmdProcExe = new OracleCommand("DCBSTAT.MENT", OraConn); cmdProcExe.CommandType = System.Data.CommandType.StoredProcedure; cmdProcExe.Parameters.Add("V_BRANCH", OracleType.Number).Value = ddlBranch.SelectedValue; cmdProcExe.Parameters.Add("V_LSCHEME", OracleType.VarChar).Value = sLoan; cmdProcExe.Parameters.Add("V_OSCHEME", OracleType.VarChar).Value = sOD; cmdProcExe.Parameters.Add("V_TYPE", OracleType.VarChar).Value = rblPriOrInt.SelectedValue; cmdProcExe.Parameters.Add("V_FDATE", OracleType.DateTime).Value = String.Format("{0:dd-MMM-yyyy}", strFrmDate); cmdProcExe.Parameters.Add("V_TDATE", OracleType.DateTime).Value = String.Format("{0:dd-MMM-yyyy}", strToDate); cmdProcExe.Parameters.Add("V_OUT", OracleType.Cursor).Direction = System.Data.ParameterDirection.Output; OracleDataAdapter oDaExecution = new OracleDataAdapter(cmdProcExe); oDaExecution.Fill(dtDCB); if (dtDCB.Rows.Count <= 0) { ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert ('There is No Criteria') </script>"); return; } //objLog.WriteLog("DCBStatement - V_BRANCH INPUT to Stored Procedure " + ddlBranch.SelectedValue); //objLog.WriteLog("DCBStatement - V_LSCHEME INPUT to Stored Procedure " + sOD); //objLog.WriteLog("DCBStatement - V_OSCHEME INPUT to Stored Procedure " + sLoan); //objLog.WriteLog("DCBStatement - V_TYPE INPUT to Stored Procedure " + rblPriOrInt.SelectedValue); //objLog.WriteLog("DCBStatement - V_FDATE INPUT to Stored Procedure " + txtFromDate.Text); //objLog.WriteLog("DCBStatement - V_TDATE INPUT to Stored Procedure " + txtToDate.Text); //objLog.WriteLog("DCBStatment - dtDCB(Row Count)" + dtDCB.Rows.Count); objLog.WriteLog("DCBStatement - V_BRANCH:" + ddlBranch.SelectedValue + "V_LSCHEME :" + sOD + "V_OSCHEME:" + sLoan + "V_TYPE:" + rblPriOrInt.SelectedValue + "V_FDATE:" + txtFromDate.Text + "V_TDATE:" + txtToDate.Text); if (dtDCB.Rows.Count > 0) { dtDetails.Columns.Add(new DataColumn("SlNo", typeof(string))); dtDetails.Columns.Add(new DataColumn("LoanNo", typeof(string))); dtDetails.Columns.Add(new DataColumn("Name", typeof(string))); dtDetails.Columns.Add(new DataColumn("Arr Dmd", typeof(string))); dtDetails.Columns.Add(new DataColumn("Crnt Dmd", typeof(string))); dtDetails.Columns.Add(new DataColumn("Tot Dmd", typeof(string))); dtDetails.Columns.Add(new DataColumn("Arr Coln", typeof(string))); dtDetails.Columns.Add(new DataColumn("Crnt Coln", typeof(string))); dtDetails.Columns.Add(new DataColumn("Future Coln", typeof(string))); dtDetails.Columns.Add(new DataColumn("Tot Coln", typeof(string))); dtDetails.Columns.Add(new DataColumn("Arr Bal", typeof(string))); dtDetails.Columns.Add(new DataColumn("Cur Bal", typeof(string))); dtDetails.Columns.Add(new DataColumn("Tot Bal", typeof(string))); dtDetails.Columns.Add(new DataColumn("BrName", typeof(string))); } foreach (DataRow dr in dtDCB.Rows) { row = dtDetails.NewRow(); dblSlNo = dblSlNo + 1; row["SlNo"] = dblSlNo; if ((!DBNull.Value.Equals(dr["C_AccNo"])) || (!DBNull.Value.Equals(dr["C_AccNo"]))) { row["LoanNo"] = dr["C_ABBR"] + " " + dr["C_AccNo"]; } if (!DBNull.Value.Equals(dr["C_NAME"])) { row["Name"] = dr["C_NAME"]; } if (!DBNull.Value.Equals(dr["C_ERDEM"])) { row["Arr Dmd"] = String.Format("{0:0.00}", dr["C_ERDEM"]); dblTotErlierDemand = Convert.ToDouble(dr["C_ERDEM"]); dblTotErDemand += dblTotErlierDemand; } if (!DBNull.Value.Equals(dr["C_PRDEM"])) { row["Crnt Dmd"] = String.Format("{0:0.00}", dr["C_PRDEM"]); dblTotPresentDemand = Convert.ToDouble(dr["C_PRDEM"]); dblTotPrDemand += dblTotPresentDemand; } row["Tot Dmd"] = String.Format("{0:0.00}", dblTotErlierDemand + dblTotPresentDemand); dblgrdTotdmd = Convert.ToDouble(row["Tot Dmd"]); dblgrdTotdemand += dblgrdTotdmd; if (!DBNull.Value.Equals(dr["C_ERCOL"])) { row["Arr Coln"] = String.Format("{0:0.00}", dr["C_ERCOL"]); dblGTotErlierCollection = Convert.ToDouble(dr["C_ERCOL"]); dblGTotErCollection += dblGTotErlierCollection; } if (!DBNull.Value.Equals(dr["C_PRCOL"])) { row["Crnt Coln"] = String.Format("{0:0.00}", dr["C_PRCOL"]); dblTotPresentCollection = Convert.ToDouble(dr["C_PRCOL"]); dblTotPrCollection += dblTotPresentCollection; } if (!DBNull.Value.Equals(dr["C_ADVCOL"])) { row["Future Coln"] = String.Format("{0:0.00}", dr["C_ADVCOL"]); dblTotFutureCollection = Convert.ToDouble(dr["C_ADVCOL"]); dblTotFuCollection += dblTotFutureCollection; } row["Tot Coln"] = String.Format("{0:0.00}", dblGTotErlierCollection + dblTotPresentCollection + dblTotFutureCollection); dblgrdTotColl = Convert.ToDouble(row["Tot Coln"]); dblgrdTotCollection += dblgrdTotColl; if (!DBNull.Value.Equals(dr["C_ERBAL"])) { row["Arr Bal"] = String.Format("{0:0.00}", dr["C_ERBAL"]); dblTotErlierBalance = Convert.ToDouble(dr["C_ERBAL"]); dblTotErBalance += dblTotErlierBalance; } if (!DBNull.Value.Equals(dr["C_PRBAL"])) { row["Cur Bal"] = String.Format("{0:0.00}", dr["C_PRBAL"]); dblTotPresentBalance = Convert.ToDouble(dr["C_PRBAL"]); dblTotPrBalance += dblTotPresentBalance; } row["Tot Bal"] = String.Format("{0:0.00}", dblTotErlierBalance + dblTotPresentBalance); dblgrdTotBal = Convert.ToDouble(row["Tot Bal"]); dblgrdTotBalance += dblgrdTotBal; if (!DBNull.Value.Equals(dr["C_BNO"])) { row["BrName"] = dr["C_BNO"]; //DataTable dtBranch = new DataTable(); //string strSql = "", strbrnchname = ""; //strSql = " select * from branch where bran_sno= " + dr["C_BNO"]; //dtBranch = objDataFetch.DatatablePassSQL(strSql); //if (dtBranch.Rows.Count > 0) //{ // strbrnchname = dtBranch.Rows[0]["BRAN_NAME"].ToString(); //} //row["BrName"] = strbrnchname; } dtDetails.Rows.Add(row); } row = dtDetails.NewRow(); row["Name"] = "GRAND TOTAL"; row["Arr Dmd"] = (String.Format("{0:0.00}", dblTotErDemand)); row["Crnt Dmd"] = (String.Format("{0:0.00}", dblTotPrDemand)); row["Tot Dmd"] = (String.Format("{0:0.00}", dblgrdTotdemand)); row["Arr Coln"] = (String.Format("{0:0.00}", dblGTotErCollection)); row["Crnt Coln"] = (String.Format("{0:0.00}", dblTotPrCollection)); row["Future Coln"] = (String.Format("{0:0.00}", dblTotFuCollection)); row["Tot Coln"] = (String.Format("{0:0.00}", dblgrdTotCollection)); row["Arr Bal"] = (String.Format("{0:0.00}", dblTotErBalance)); row["Cur Bal"] = (String.Format("{0:0.00}", dblTotPrBalance)); row["Tot Bal"] = (String.Format("{0:0.00}", dblgrdTotBalance)); dtDetails.Rows.Add(row); lblBank.Visible = true; lblBranch.Visible = true; lblHeading.Visible = true; lblBank.Text = global.BankName(); lblBranch.Text = Session["LoginBranchName"].ToString().Trim(); lblHeading.Text = "DCB STATEMENT REPORT[CBS] From " + txtFromDate.Text + " TO " + txtToDate.Text + ""; gvDCB.DataSource = dtDetails; gvDCB.DataBind(); Session["dtDetails"] = dtDetails; objFrmPt.FormatGridView(gvDCB); GridPrint(gvDCB); ViewState["Pagename"] = "DCB STATEMENT REPORT"; imgxl0.Visible = true; } catch (Exception ex) { objLog.WriteLog(ex.Message); ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert('" + ex.Message + "')</script>"); } finally { objLog.WriteLog("DCBStatment.aspx-->btnOK_Click() Event Reached finally block without any exceptions."); dtDCB.Dispose(); dtDetails.Dispose(); } }
protected void btnOK_Click(object sender, EventArgs e) { DataTable dtDetails = new DataTable(); DateTime temp; string sDeposit = ""; OracleConnection oraConn; oraConn = objDataFetch.getSingletonConnectionInstance(); OracleCommand cmd = new OracleCommand(); try { if (!(DateTime.TryParse(txtDate.Text, out temp))) { ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert ('Enter a Valid Date.') </script>"); return; } if (txtBalance.Text == string.Empty) { ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert ('Please enter the Balance and Proceed.') </script>"); return; } if (Convert.ToDouble(txtBalance.Text) == 0) { ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert ('Balance Amount should be greater than Zero.') </script>"); return; } if (chkScheme.SelectedValue == "") { ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert ('Select atleast one Scheme and Proceed.') </script>"); return; } for (int i = 0; i < chkScheme.Items.Count; i++) { if (chkScheme.Items[i].Selected) { sDeposit += chkScheme.Items[i].Value.Trim() + ","; } } sDeposit = sDeposit.Remove(sDeposit.Length - 1, 1) + ""; cmd.Connection = oraConn; cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.CommandText = "HEAD.DICGC_REPORT"; // cmd.Parameters.Add(new OracleParameter("branch", OracleType.Number)).Value =Convert.ToInt16( ddlBranch.SelectedValue); if (rblBrnchConsol.SelectedValue.ToUpper().Trim() == "C") { cmd.Parameters.Add("branch", OracleType.Number).Value = DBNull.Value; } else { cmd.Parameters.Add("branch", OracleType.Number).Value = ddlBranch.SelectedValue; } cmd.Parameters.Add(new OracleParameter("schemes", OracleType.VarChar)).Value = sDeposit.Trim(); cmd.Parameters.Add(new OracleParameter("asdate", OracleType.DateTime)).Value = String.Format("{0:dd/MM/yyyy}", txtDate.Text); cmd.Parameters.Add(new OracleParameter("balance", OracleType.Number)).Value = Convert.ToDouble(txtBalance.Text); cmd.Parameters.Add(new OracleParameter("dicgccur", OracleType.Cursor)).Direction = ParameterDirection.Output; OracleDataAdapter adp = new OracleDataAdapter(cmd); adp.Fill(dtDetails); if (dtDetails.Rows.Count > 0) { pnlGrid.Visible = true; lblBank.Visible = true; lblBranch.Visible = true; lblHeading.Visible = true; lblBank.Text = global.BankName(); lblBranch.Text = Session["LoginBranchName"].ToString().Trim(); lblHeading.Text = "DICGC REPORT AS ON " + txtDate.Text + ""; gvDetails.DataSource = dtDetails; gvDetails.DataBind(); Session["dtDetails"] = dtDetails; objFrmPt.FormatGridView(gvDetails); GridPrint(gvDetails); ViewState["Pagename"] = "DICGCREPORT"; imgxl0.Visible = true; } else { ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert('Data Not Found.')</script>"); imgxl0.Visible = false; pnlGrid.Visible = false; return; } } catch (Exception ex) { string g = ex.Message + ex; g = Regex.Replace(g, "[^a-zA-Z0-9_]+", " "); objLog.WriteLog("DICGCRep.aspx-->Exception in btnOK_Click() Event" + g); ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert('" + g + "')</script>"); return; } finally { dtDetails.Dispose(); objLog.WriteLog("DICGCRep.aspx-->btnOK_Click() Event Reached finally block without any exceptions."); } }
protected void Page_Load(object sender, EventArgs e) { global.checkSession(); if (!Page.IsPostBack) { if (Session["Title"] != null) { Page.Title = "General Ledger"; } strBrn = Request.QueryString["branch"]; lblbranch.Text = "Branch:" + strBrn; strComp = Request.QueryString["Comp"]; lblbank.Text = strComp; strHead = Request.QueryString["Head"]; lblrep.Text = strHead; GlobalConstants.sd = Request.QueryString["gsd"]; if (Session["Clearing"] != null) { clrdisdt = (DataTable)Session["Clearing"]; gv.DataSource = clrdisdt; gv.DataBind(); FormatRpt objgrd = new FormatRpt(); objgrd.FormatGridView(gv); ViewState["datatable"] = clrdisdt; Session["Clearing"] = null; } if (Session["clearingbnk"] != null) { clrdisdt = (DataTable)Session["clearingbnk"]; gv.DataSource = clrdisdt; gv.DataBind(); FormatRpt objgrd = new FormatRpt(); objgrd.FormatGridView(gv); ViewState["datatable"] = clrdisdt; Session["clearingbnk"] = null; } if (Session["ddissue"] != null) { clrdisdt = (DataTable)Session["ddissue"]; gv.DataSource = clrdisdt; gv.DataBind(); FormatRpt objgrd = new FormatRpt(); objgrd.FormatGridView(gv); ViewState["datatable"] = clrdisdt; Session["ddissue"] = null; } if (Session["generaldetl"] != null) { lblgl.Visible = true; lblgln.Visible = true; lblgl.Text = GlobalConstants.Opening; clrdisdt = (DataTable)Session["generaldetl"]; gv.DataSource = clrdisdt; gv.DataBind(); FormatRpt objgrd = new FormatRpt(); objgrd.FormatGridView(gv); ViewState["datatable"] = clrdisdt; Session["generaldetl"] = null; } if (Session["generalsum"] != null) { lblgl.Visible = true; lblgln.Visible = true; lblgl.Text = GlobalConstants.Opening; clrdisdt = (DataTable)Session["generalsum"]; gv.DataSource = clrdisdt; gv.DataBind(); FormatRpt objgrd = new FormatRpt(); objgrd.FormatGridView(gv); ViewState["datatable"] = clrdisdt; Session["generalsum"] = null; } if (Session["new"] != null) { //lblgl.Visible = true; // lblgln.Visible = true; //lblgl.Text = GlobalConstants.Opening; clrdisdt = (DataTable)Session["new"]; gv.DataSource = clrdisdt; gv.ShowHeader = false; gv.DataBind(); FormatRpt objgrd = new FormatRpt(); objgrd.FormatGridView(gv); ViewState["datatable"] = clrdisdt; Session["new"] = null; } } }
protected void Page_Load(object sender, EventArgs e) { if (Session.Contents.Count == 0) { Response.Redirect("ShowMessage.aspx?msg=" + GlobalConstants.msg); } else { if (!IsPostBack) { if (Session["table"] != null) { DataTable dtnew = new DataTable(); dtnew = (DataTable)Session["table"]; int sno = 1; for (int j = 0; j < dtnew.Rows.Count; j++) { dtnew.Rows[j]["Sno"] = sno++; double amt = Convert.ToDouble(dtnew.Rows[j]["TRND_AMOUNT"]); dtnew.Rows[j]["TRND_AMOUNT"] = String.Format("{0:0.00}", Convert.ToDouble(dtnew.Rows[j]["TRND_AMOUNT"])); } DataRow row = dtnew.NewRow(); string stramt = String.Format("{0:0.00}", Convert.ToDouble(dtnew.Compute("Sum(TRND_AMOUNT)", ""))); row["TRND_AMOUNT"] = String.Format("{0:0.00}", Convert.ToDouble(dtnew.Compute("Sum(TRND_AMOUNT)", ""))); row["TRND_INSTRUMENTNUMBER"] = "T O T A L"; dtnew.Rows.Add(row); //*******total******* //********amount conversion*********** MultiCurrency currenc = new MultiCurrency(Criteria.Indian); string number = stramt; string[] ss = number.Split('.'); if (ss.Length == 1) { number = number + ".00"; } string[] amount = number.Split('.'); string AmountInWords = currenc.ConvertToWord(amount[0]); string paises; AmountInWords = AmountInWords + " Rupees"; if (int.Parse(amount[1]) == 0) { amount[1] = "00"; paises = ""; } else { paises = currenc.ConvertToWord(amount[1]); paises = " And " + paises + " Paises"; } AmountInWords = AmountInWords + paises; //**************** lblManager.Text = Session["Manager"].ToString(); Label1.Text = global.BankName(); Label6.Text = Label1.Text; Label5.Text = DateTime.Now.ToString(); lblAmount.Text = AmountInWords.ToString(); Label2.Text = Session["branch"].ToString(); Label3.Text = Session["frmdate"].ToString(); Label4.Text = Session["todate"].ToString(); lblFrmDate.Text = Session["frmdate"].ToString(); lblToDate.Text = Session["todate"].ToString(); GridView1.DataSource = dtnew; GridView1.DataBind(); objfrmpt.FormatGridView(GridView1); } } } }
protected void Page_Load(object sender, EventArgs e) { objLog.WriteLog("DBTL_LogDisp : display function : "); if (Session.Contents.Count == 0) { Response.Redirect("ShowMessage.aspx?msg=" + GlobalConstants.msg); } else { try { if (!IsPostBack) { OracleConnection oraConn = new OracleConnection(Session["constring"].ToString()); if (oraConn.State != ConnectionState.Open) { oraConn.Open(); } ViewState["Pagename"] = null; if (Session["Display"] != null) { objLog.WriteLog("DBTL_LogDisp :-Session Display"); ViewState["Pagename"] = "DBTL_Log"; dtDisplay = (DataTable)Session["Display"]; } sSql = "Select SITP_TEXTVALUE From Siteparameters Where SITP_NAME = 'COMPANY NAME'"; OracleDataAdapter odaC = new OracleDataAdapter(sSql, oraConn); odaC.Fill(dtcom); if (dtcom.Rows.Count != 0) { strBnkName = dtcom.Rows[0]["SITP_TEXTVALUE"].ToString(); } lblBank.Text = strBnkName; if (Session["LoginBranchName"] != null) { lblBranch.Text = Session["LoginBranchName"].ToString(); } if (Session["Heading"] != null) { lblRptHead.Text = Session["Heading"].ToString(); } if (Session["NonCredit"] != null) { lblNonCre.Text = Session["NonCredit"].ToString(); } if (Session["Credit"] != null) { lblCredit.Text = Session["Credit"].ToString(); } if (dtDisplay.Rows.Count > 0) { gvDBTL.DataSource = dtDisplay; gvDBTL.DataBind(); Session["datatable"] = dtDisplay; Session["Display"] = null; objFrmPt.FormatGridView(gvDBTL); GridPrint(gvDBTL); } } } catch (Exception ex) { objLog.WriteLog("DBTL_LogDisp Exception in PageLoad : " + ex.Message); ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert('" + ex.Message + "')</script>"); } finally { if (oraConn.State == ConnectionState.Open) { oraConn.Close(); } oraConn.Dispose(); OracleConnection.ClearAllPools(); } } }