protected void Page_Load(object sender, EventArgs e) { globalSession.checkSession(); if (!IsPostBack) { try { if (Session["constring"] != null) { OracleConnection oraConn = new OracleConnection(Session["constring"].ToString()); if (oraConn.State != ConnectionState.Open) { oraConn.Open(); } } txtFromDate.Text = objGlobal.GetServerDate(); txtToDate.Text = objGlobal.GetServerDate(); txtFromDate.Focus(); } catch (Exception ex) { objLog.WriteLog("DBTL_Log :" + ex.Message); } finally { objLog.WriteLog("DBTL_Log.aspx--->Page_Load--->Page Load events Finally block Executed "); } } }
protected void Page_Load(object sender, EventArgs e) { global.checkSession(); DataTable dtList = new DataTable(); int c = 0; OracleConnection oraConn = new OracleConnection(Session["constring"].ToString()); try { if (!IsPostBack) { if (oraConn.State != ConnectionState.Open) { oraConn.Open(); } // Added by Darshan objXml.FillMetaXMLDdl(cmbBranch, "BRANCH.xml", "BRAN_SNO", "BRAN_NAME", null); cmbBranch.SelectedValue = Session["BranchLogin"].ToString(); txtfrom.Text = objGlobal.GetServerDate(); txtto.Text = objGlobal.GetServerDate(); if (Convert.ToInt16(cmbBranch.SelectedValue) == 1) { cmbBranch.Enabled = true; } else { cmbBranch.Enabled = false; } dtList.Clear(); dtList = objXml.DataTableMetadataXML("DDPOSCHEMESETUP.xml", "DDPS_ACTIVEYN='Y'"); //---------------------------- c = dtList.Rows.Count; ckhlist.Items.Clear(); ckhlist.DataSource = dtList; ckhlist.DataTextField = "DDPS_DES"; ckhlist.DataValueField = "DDPS_SNO"; ckhlist.DataBind(); } } catch (Exception ex) { g = ex.Message; g = Regex.Replace(g, "[^a-zA-Z0-9_]+", " "); objLog.WriteLog("issue.aspx: Exception in PageLoad : " + g); ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert('" + g + "')</script>"); return; } finally { oraConn.Close(); oraConn.Dispose(); dtList.Dispose(); objLog.WriteLog("issue.aspx: Page_Load-->Page Load events Finally block Executed "); } }
protected void Page_Load(object sender, EventArgs e) { global.checkSession(); OracleConnection oraConn = new OracleConnection(Session["constring"].ToString()); try { if (!IsPostBack) { if (oraConn.State != ConnectionState.Open) { oraConn.Open(); } // ADDED BY DARSHAN objXml.FillMetaXMLDdl(ddlBranch, "BRANCH.xml", "BRAN_SNO", "BRAN_NAME", null); ddlBranch.SelectedValue = Session["BranchLogin"].ToString(); txtfrom.Text = objGlobal.GetServerDate(); txtto.Text = objGlobal.GetServerDate(); if (Convert.ToInt16(ddlBranch.SelectedValue) == 1) { ddlBranch.Enabled = true; } else { ddlBranch.Enabled = false; } //--------------------- } } catch (Exception ex) { g = ex.Message; g = Regex.Replace(g, "[^a-zA-Z0-9_]+", " "); objLog.WriteLog("form c Details Exception in PageLoad() : " + g); ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert('" + g + "')</script>"); return; } finally { oraConn.Close(); oraConn.Dispose(); objLog.WriteLog("FormC.aspx: Page_Load-->Page Load events Finally block Executed "); } }
protected void Page_Load(object sender, EventArgs e) { globalSession.checkSession(); if (!IsPostBack) { DataTable dtScheme = new DataTable(); try { objXml.FillMetaXMLDdl(ddlBranch, "BRANCH.xml", "bran_sno", "bran_name", ""); if (Session["sysdate"] != null) { txtDate.Text = Session["sysdate"].ToString(); } else { txtDate.Text = objGlobal.GetServerDate(); } if (Session["BranchLogin"] != null) { ddlBranch.SelectedValue = Session["BranchLogin"].ToString(); } dtScheme = objXml.DataTableMetadataXML("DEPOSITSCHEMESETUP.XML", ""); if (dtScheme.Rows.Count > 0) { chkScheme.DataSource = dtScheme; chkScheme.DataTextField = "DSCH_NAME"; chkScheme.DataValueField = "DSCH_ABBR"; chkScheme.DataBind(); } else { ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert ('No Deposit Scheme Found...') </script>"); return; } imgxl0.Visible = false; } catch (Exception ex) { string g = ex.Message + ex; g = Regex.Replace(g, "[^a-zA-Z0-9_]+", " "); objLog.WriteLog("DICGCRep.aspx-->Exception in Page_Load() Event" + g); ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert('" + g + "')</script>"); return; } finally { objLog.WriteLog("DICGCRep.aspx-->Page_Load() Event Reached finally block without any exceptions."); dtScheme.Dispose(); } } }
//DataTable dtBranch = new DataTable(); //OracleConnection oraConn = new OracleConnection(); //OracleDataAdapter oDaBranch = new OracleDataAdapter(); protected void Page_Load(object sender, EventArgs e) { global.checkSession(); try { //OracleConnection oraConn = new OracleConnection(Session["constring"].ToString()); if (!Page.IsPostBack) { //if (oraConn.State != ConnectionState.Open) oraConn.Open(); //string strSql = ""; //Bal.Gen objFillDate = new Bal.Gen(); //objFillDate.Call_Date(ddlDay, ddlMonth, ddlYear); OracleConnection con = new OracleConnection(Session["constring"].ToString()); txtAsOnDate.Text = objGlobal.GetServerDate(); objXML.FillMetaXMLDdl(ddlBranch, "BRANCH.xml", "BRAN_SNO", "BRAN_NAME", null); ddlBranch.SelectedValue = 1.ToString(); //strSql = "select bran_sno,bran_name from MASTER.branch"; //oDaBranch = new OracleDataAdapter(strSql, con); //oDaBranch.Fill(dtBranch); //ddlBranch.DataSource = dtBranch; //ddlBranch.DataTextField = "bran_name"; //ddlBranch.DataValueField = "bran_sno"; //ddlBranch.DataBind(); //ddlBranch.SelectedValue = 1.ToString();//GlobalConstants.branchname.ToString(); //ddlBranch.Enabled = false; //if (!objValid.Valid_Activity(30005)) //{ // ddlBranch.Enabled = false; //} //else //{ // ddlBranch.Enabled = true; //} //ddlBranch.Enabled = false; } } catch (Exception ex) { g = ex.Message; g = Regex.Replace(g, "[^a-zA-Z0-9_]+", " "); objLog.WriteLog("Form1.aspx: Exception in PageLoad():" + g); ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('" + g + "')</script>"); return; } finally { objLog.WriteLog("Form1.aspx: Page_Load-->Page Load events Finally block Executed "); } }
protected void Page_Load(object sender, EventArgs e) { try { globalSession.checkSession(); if (!Page.IsPostBack) { txtFrmDt.Text = "01/01/1985"; if (Session["constring"] == null) { Response.Redirect("ShowMessage.aspx?msg=" + GlobalConstants.msg); } if (Session["constring"] != null) { oraConn = new OracleConnection(Session["constring"].ToString()); if (oraConn.State != ConnectionState.Open) { oraConn.Open(); } } Ssql = objFillScheme.BranchFill(); objDataFetch.FillDdl(Ssql, ddlBranch, "BRAN_SNO", "BRAN_NAME"); if (Session["BranchLogin"] != null) { ddlBranch.SelectedValue = Session["BranchLogin"].ToString(); } Ssql = objFillScheme.DepositFill(ddlBranch.SelectedValue); OracleDataAdapter oDaDeposit = new OracleDataAdapter(Ssql, oraConn); oDaDeposit.Fill(dtListDeposit); if (dtListDeposit.Rows.Count <= 0) { ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert ('No Deposit Scheme Found...') </script>"); return; } chkListDeposit.DataSource = dtListDeposit; chkListDeposit.DataTextField = "DSCH_NAME"; chkListDeposit.DataValueField = "DSCH_SNO"; chkListDeposit.DataBind(); txtToDt.Text = objGlb.GetServerDate(); } } catch (Exception ex) { objLog.WriteLog("AIR-ExceedingReportForDeposit.aspx: Error in Page Loading " + ex.Message); ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert('Error in Page Loading: " + ex.Message + "')</script>"); } finally { objLog.WriteLog("AIR-ExceedingReportForDeposit.aspx:Page Loaded Successfully"); } }
protected void Page_Load(object sender, EventArgs e) { global.checkSession(); OracleConnection oraConn = new OracleConnection(Session["constring"].ToString()); DataTable dtList = new DataTable(); try { if (!IsPostBack) { if (oraConn.State != ConnectionState.Open) { oraConn.Open(); } // ADDED BY DARSHAN objXml.FillMetaXMLDdl(ddlBranch, "BRANCH.xml", "BRAN_SNO", "BRAN_NAME", null); ddlBranch.SelectedValue = Session["BranchLogin"].ToString(); txtAsOnDate.Text = objGlobal.GetServerDate(); if (Convert.ToInt16(ddlBranch.SelectedValue) == 1) { ddlBranch.Enabled = true; } else { ddlBranch.Enabled = false; } dtList = objXml.DataTableMetadataXML("ODSCHEMESETUP.xml", "ODST_BRANCH=" + ddlBranch.SelectedValue); //-------------------------------------------------- chkList.DataSource = dtList; chkList.DataTextField = "ODST_NAME"; chkList.DataValueField = "ODST_ABBR"; chkList.DataBind(); } } catch (Exception ex) { g = ex.Message; g = Regex.Replace(g, "[^a-zA-Z0-9_]+", " "); objLog.WriteLog("IndividualOdOverDue.aspx: Exception in PageLoad : " + g); ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert('" + g + "')</script>"); return; } finally { dtList.Dispose(); oraConn.Close(); oraConn.Dispose(); objLog.WriteLog("IndividualOdOverDue.aspx: Page_Load-->Page Load events Finally block Executed "); } }
protected void Page_Load(object sender, EventArgs e) { globalSession.checkSession(); if (!IsPostBack) { DataTable dtScheme = new DataTable(); try { objXml.FillMetaXMLDdl(ddlBranch, "BRANCH.xml", "bran_sno", "bran_name", ""); if (Session["sysdate"] != null) { txtAsonDate.Text = Session["sysdate"].ToString(); } else { txtAsonDate.Text = objGlobal.GetServerDate(); } if (Session["BranchLogin"] != null) { ddlBranch.SelectedValue = Session["BranchLogin"].ToString(); } imgxl0.Visible = false; } catch (Exception ex) { string g = ex.Message + ex; g = Regex.Replace(g, "[^a-zA-Z0-9_]+", " "); objLog.WriteLog("DailyExcepRep.aspx-->Exception in Page_Load() Event" + g); ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert('" + g + "')</script>"); return; } finally { objLog.WriteLog("DailyExcepRep.aspx-->Page_Load() Event Reached finally block without any exceptions."); dtScheme.Dispose(); } } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { xmlObj.FillMetaXMLDdl(ddlBranch, "Branch.xml", "BRAN_SNO", "BRAN_NAME", null); if (Session["BranchLogin"] != null) { ddlBranch.SelectedValue = Session["BranchLogin"].ToString(); } txtAsDate.Text = objGlob.GetServerDate(); dtList = xmlObj.FillMetaXMLDdl(null, "DEPOSITSCHEMESETUP.xml", "", "", "DSCH_ACTIVEYN = 'Y' AND DSCH_BRANCH = '" + ddlBranch.SelectedValue + "' AND DSCH_TYPE IN (3,4)"); if (dtList.Rows.Count <= 0) { ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert ('No Deposit Scheme Found...') </script>"); return; } chkList.DataSource = dtList; chkList.DataTextField = "DSCH_NAME"; chkList.DataValueField = "DSCH_ABBR"; chkList.DataBind(); } } catch (Exception ex) { string g = ex.Message; g = Regex.Replace(g, "[^a-zA-Z0-9_]+", " "); objlog.WriteLog("DepositIntPayableReport .aspx: Exception in PageLoad():" + g); ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('" + g + "')</script>"); return; } finally { objlog.WriteLog("DepositIntPayableReport .aspx: Page_Load-->Page Load events Finally block Executed "); } }
protected void getBankDet() { string strDate = ""; string strqry = ""; DataTable dtBankDet = new DataTable(); strqry = "select * from HEAD.BANKINFO"; dtBankDet = objDataFetch.DatatablePassSQL(strqry); objLog.WriteLog("Inside Form15GAccountWise->getBankDet()->BankInfo query" + dtBankDet.Rows.Count); if (dtBankDet.Rows.Count > 0) { Session["dtBankDet"] = dtBankDet; if ((!DBNull.Value.Equals(dtBankDet.Rows[0]["BAN_NAME"].ToString()))) { objLog.WriteLog("Form15GAccountWise dtBankDet(BAN_NAME)" + dtBankDet.Rows[0]["BAN_NAME"].ToString()); lblBankName.Text = dtBankDet.Rows[0]["BAN_NAME"].ToString(); } else { lblBankName.Text = ""; } if ((!DBNull.Value.Equals(dtBankDet.Rows[0]["BAN_ADDRESS1"].ToString()))) { objLog.WriteLog("Form15GAccountWise dtBankDet(BAN_ADDRESS1)" + dtBankDet.Rows[0]["BAN_ADDRESS1"].ToString()); lblBAddress1.Text = dtBankDet.Rows[0]["BAN_ADDRESS1"].ToString(); } else { lblBAddress1.Text = ""; } if ((!DBNull.Value.Equals(dtBankDet.Rows[0]["BAN_ADDRESS2"].ToString()))) { lblBAddress2.Text = dtBankDet.Rows[0]["BAN_ADDRESS2"].ToString(); } else { lblBAddress2.Text = ""; } if ((!DBNull.Value.Equals(dtBankDet.Rows[0]["BAN_ADDRESS3"].ToString()))) { lblBAddress3.Text = dtBankDet.Rows[0]["BAN_ADDRESS3"].ToString(); lblBAddress33.Text = dtBankDet.Rows[0]["BAN_ADDRESS3"].ToString(); lblPlace1.Text = dtBankDet.Rows[0]["BAN_ADDRESS3"].ToString(); } else { lblBAddress3.Text = ""; lblBAddress33.Text = ""; lblPlace1.Text = ""; } if ((!DBNull.Value.Equals(dtBankDet.Rows[0]["BAN_STATUS"].ToString()))) { lblStatus.Text = dtBankDet.Rows[0]["BAN_STATUS"].ToString(); } else { lblStatus.Text = ""; } if ((!DBNull.Value.Equals(dtBankDet.Rows[0]["BAN_TAN"].ToString()))) { lblTan.Text = dtBankDet.Rows[0]["BAN_TAN"].ToString(); } else { lblTan.Text = ""; } if ((!DBNull.Value.Equals(dtBankDet.Rows[0]["BAN_PAN"].ToString()))) { lblBPan.Text = dtBankDet.Rows[0]["BAN_PAN"].ToString(); } else { lblBPan.Text = ""; } if ((!DBNull.Value.Equals(dtBankDet.Rows[0]["BAN_EMAIL"].ToString()))) { lblBEmail.Text = dtBankDet.Rows[0]["BAN_EMAIL"].ToString(); } else { lblBEmail.Text = ""; } if ((!DBNull.Value.Equals(dtBankDet.Rows[0]["BAN_PHONENO"].ToString()))) { lblBPhoneNo.Text = dtBankDet.Rows[0]["BAN_PHONENO"].ToString(); } else { lblBPhoneNo.Text = ""; } strDate = objGlb.GetServerDate(); lblBDate.Text = strDate.ToString(); lblBdate3.Text = strDate.ToString(); lblBDate4.Text = strDate.ToString(); lblCdate.Text = strDate.ToString(); objLog.WriteLog("Form15GAccountWise->getBankDet()->Bankinfo executed successfully"); } else { ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('Data Not Found on getBankDet()')</script>"); return; } }
protected void Page_Load(object sender, EventArgs e) { objLog.WriteLog("CheBukFormatPrint.aspx: Entered Page_Load"); 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"] = "Cheque Book Print Format"; //AK+LS 02/04/2016 serach comp name in login.Might have fetched somewhere in session //Company Name is Not taken in Session in Login page. sSql = "Select SITP_TEXTVALUE From Siteparameters Where SITP_NAME = 'COMPANY NAME'"; OracleDataAdapter odaC = new OracleDataAdapter(sSql, oraConn); odaC.Fill(dtcom); global gblSysDt = new global(); sysdate = gblSysDt.GetServerDate(); if (dtcom.Rows.Count != 0) { strBnkName = dtcom.Rows[0]["SITP_TEXTVALUE"].ToString(); } if (Session["BRanchName"] != null) { lblBranch.Text = Session["BRanchName"].ToString(); } DataTable dtPrintDetails = new DataTable(); dtPrintDetails = (DataTable)Session["PrintDetails"]; if (dtPrintDetails.Rows.Count > 0) { dtChkBukPrint.Columns.Add(new DataColumn("Cheque Sno", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("Serial No", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("City Code", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("Bank code", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("Branch Code", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("Reference Code", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("MICR Code", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("Account No.", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("Transaction Code", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("Customer Name", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("Jointholder Name", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("Jointholder Name2", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("Sign Authority", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("SA2", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("SA3", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("Address1", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("Address2", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("Address3", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("Address4", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("Address5", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("City Name", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("PINCODE", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("Res Tel No.", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("Off Tel No", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("Mob No", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("No. of Leaves", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("Book Size", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("Bearer/Order", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("At Par Y/N", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("Product Code", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("From Leaf Num", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("To Leaf Num", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("AddOpenField1", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("AddOpenField2", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("AddOpenField3", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("AddOpenField4", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("AddOpenField5", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("AddOpenField6", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("AddOpenField7", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("AddOpenField8", typeof(string))); dtChkBukPrint.Columns.Add(new DataColumn("AddOpenField9", typeof(string))); //dtChkBukPrint.Columns.Add(new DataColumn("IFSC Code", typeof(string))); //dtChkBukPrint.Columns.Add(new DataColumn("PRINTEDYN", typeof(string))); for (int i = 0; i < dtPrintDetails.Rows.Count; i++) { row = dtChkBukPrint.NewRow(); if (Session["TranCode"] != null) { dblTranCode = Convert.ToDouble(Session["TranCode"]); } if (Session["cnt"] != null) { count = Convert.ToInt16(Session["cnt"]); } //if (Session["JOINTHOLDERNAME"] != null) //{ //strJointHolderName = (Session["JOINTHOLDERNAME"].ToString()); // } row["Cheque Sno"] = dtPrintDetails.Rows[i]["CHQH_SNO"].ToString(); //Slno = Slno.ToString().PadLeft(9, '0'); //dtDepositList.Rows[i]["clms_des"].ToString().Substring(0, 25) row["Serial No"] = Slno.ToString().PadLeft(8, '0'); //AK+LS 02/04/2016 not required brackets here (dtPrintDetails.Rows[i]["CITY"].ToString()) where not doing any casting here row["City Code"] = dtPrintDetails.Rows[i]["CTY"].ToString(); row["Bank code"] = dtPrintDetails.Rows[i]["BKC"].ToString(); row["Branch Code"] = dtPrintDetails.Rows[i]["BRC"].ToString(); row["Reference Code"] = dtPrintDetails.Rows[i]["BRSID"].ToString(); row["MICR Code"] = dtPrintDetails.Rows[i]["MCRCOD"].ToString(); strAccno = dtPrintDetails.Rows[i]["COD"].ToString(); row["Account No."] = strAccno.PadLeft(16, '0'); // dblAccNo = Convert.ToDouble(strAccno.PadLeft(16, '0')); //dblAccNo = Convert.ToDouble(dtPrintDetails.Rows[i]["COD"].ToString()); //Session["ACCNO"] = dblAccNo; Session["ACCNO"] = strAccno.PadLeft(16, '0'); row["Transaction Code"] = dblTranCode; row["Customer Name"] = dtPrintDetails.Rows[i]["NAM"].ToString(); row["Jointholder Name"] = dtPrintDetails.Rows[i]["NAM"].ToString(); row["Jointholder Name2"] = ""; row["Sign Authority"] = "Authorised Signatory"; row["SA2"] = ""; row["SA3"] = ""; row["Address1"] = dtPrintDetails.Rows[i]["AD1"].ToString(); row["Address2"] = dtPrintDetails.Rows[i]["AD2"].ToString(); row["Address3"] = dtPrintDetails.Rows[i]["AD3"].ToString(); row["Address4"] = ""; row["Address5"] = ""; row["City Name"] = dtPrintDetails.Rows[i]["CSTCTY"].ToString(); row["PINCODE"] = dtPrintDetails.Rows[i]["CSTPIN"].ToString(); row["Res Tel No."] = dtPrintDetails.Rows[i]["TELR"].ToString(); row["Off Tel No"] = dtPrintDetails.Rows[i]["TELO"].ToString(); row["Mob No"] = dtPrintDetails.Rows[i]["MOB"].ToString(); row["Book Size"] = count; row["No. of Leaves"] = dtPrintDetails.Rows[i]["QPB"].ToString(); row["Bearer/Order"] = "Bearer"; //AK+LS 02/04/2016 write the logic behind this .comment and clarify. //AK+LS 02/04/2016 if one var is comapring with three different val any other reliable method is there?? if ((dblTranCode.ToString().Trim() == Convert.ToDouble("29").ToString().Trim()) || (dblTranCode.ToString().Trim() == Convert.ToDouble("30").ToString().Trim()) || (dblTranCode.ToString().Trim() == Convert.ToDouble("31").ToString().Trim())) { row["At Par Y/N"] = "Y"; } else { row["At Par Y/N"] = "N"; } row["Product Code"] = ""; row["From Leaf Num"] = dtPrintDetails.Rows[i]["CHQFROM"].ToString(); row["To Leaf Num"] = dtPrintDetails.Rows[i]["CHQTO"].ToString(); row["AddOpenField1"] = sysdate; row["AddOpenField2"] = ""; row["AddOpenField3"] = ""; row["AddOpenField4"] = ""; row["AddOpenField5"] = ""; row["AddOpenField6"] = ""; row["AddOpenField7"] = ""; row["AddOpenField8"] = ""; row["AddOpenField9"] = ""; //row["IFSC Code"] = dtPrintDetails.Rows[i]["SITP_TEXTVALUE"].ToString(); //row["PRINTEDYN"] = dtPrintDetails.Rows[i]["PRINTEDYN"].ToString(); dtChkBukPrint.Rows.Add(row); Slno = Slno + 1; } gvChkBukPrint.DataSource = dtChkBukPrint; gvChkBukPrint.DataBind(); ViewState["PrintDetails"] = dtChkBukPrint; } } } catch (Exception ex) { objLog.WriteLog("ChkBukDisp 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(); objLog.WriteLog("CheBukDisp.aspx---> Page_Load---> Page_Load event reached finally block"); //AK+LS 02/04/2016 log missing } } }
protected void Page_Load(object sender, EventArgs e) { objLog.WriteLog("HousingLoan.aspx: Entered Page_Load"); 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(); } 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(); } lblForm1.Text = strBnkName; //lblPlc.Text = strBnkName.Substring(32, 10); lblDate.Text = objGlb.GetServerDate(); lblSysDt.Text = objGlb.GetServerDate(); strSysDate = lblSysDt.Text; if (Request.QueryString["name"] != null) { lblName.Text = Request.QueryString["name"].ToString(); } if (Session["LoanName"] != null) { lblLoanName.Text = Session["LoanName"].ToString(); } //if (Request.QueryString["Interest"] != null) //{ // dblInterest = Convert.ToDouble(Request.QueryString["Interest"]); //} if (Session["PlaceName"] != null) { lblPlc.Text = Session["PlaceName"].ToString(); } if (Session["PlaceName"] != null) { lblPlc.Text = Session["PlaceName"].ToString(); } if (Session["BRanchName"] != null) { lblBranch.Text = Session["BRanchName"].ToString(); } sSQL = "Select SITP_LONGVALUE,SITP_TEXTVALUE,SITP_DOUBLEVALUE"; sSQL += " From SiteParameters"; sSQL += " Where SITP_NAME = 'FORM FIN YEAR'"; dtTempFinYr = objDataFetch.DatatablePassSQL(sSQL); lblFrmDt.Text = "01/" + "0" + dtTempFinYr.Rows[0]["SITP_LONGVALUE"].ToString() + "/" + objGlb.GetFinancialYear(Convert.ToDateTime(lblSysDt.Text), oraConn); strDate = strSysDate.Substring(3, 2); intDt = Convert.ToInt16(strDate); if (intDt < 4) { strYrDate = strSysDate.Substring(6, 4); intgSysDate = Convert.ToInt16(strYrDate); dblCurFinYear = intgSysDate; } else { strYrDate = strSysDate.Substring(6, 4); intgSysDate = Convert.ToInt16(strYrDate); dblCurFinYear = intgSysDate; } lblToDt.Text = string.Format("{0:dd/MMM/yyyy}", ("31/03/" + (dblCurFinYear))); dtLoanDisp.Columns.Add(new DataColumn("PRINCIPAL", typeof(string))); dtLoanDisp.Columns.Add(new DataColumn("INTEREST", typeof(string))); dtLoanDisp.Columns.Add(new DataColumn("TOTAL", typeof(string))); row = dtLoanDisp.NewRow(); if (Session["dblPrinciAmnt"] != null) { dblPrincipal = Convert.ToDouble(Session["dblPrinciAmnt"]); } if (Session["dblIntAmt"] != null) { dblInterest = Convert.ToDouble(Session["dblIntAmt"]); } row["PRINCIPAL"] = String.Format("{0:0.00}", dblPrincipal); row["INTEREST"] = String.Format("{0:0.00}", dblInterest); row["TOTAL"] = String.Format("{0:0.00}", dblPrincipal + dblInterest); dtLoanDisp.Rows.Add(row); gvLoanDetails.DataSource = dtLoanDisp; gvLoanDetails.DataBind(); } } catch (Exception ex) { objLog.WriteLog("HousingLoanCertificate 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(); Session["dblPrinciAmnt"] = null; Session["dblIntDue"] = null; OracleConnection.ClearAllPools(); } } //objLog.WriteLog("rptDisp_LoanIntimationLetters: display function: "); //global.checkSession(); //try //{ // if (!IsPostBack) // { // ViewState["Pagename"] = null; // if (Session["HousingLoan"] != null) // { // objLog.WriteLog("HousingLoanCertificate :-Session HousingLoan"); // ViewState["Pagename"] = "HousingLoan"; // dtDisplay = (DataTable)Session["HousingLoan"]; // } // } // if (dtDisplay.Rows.Count > 0) // { // gvRptDisp.AllowPaging = true; // gvRptDisp.PagerSettings.Mode = PagerButtons.NextPreviousFirstLast; // gvRptDisp.PageSize = 40; // gvRptDisp.PageIndexChanging += new GridViewPageEventHandler(gvRptDisp_PageIndexChanging); // if (dtLoanDisp.Rows.Count > 0) // { // dtLoanDisp.Columns.Add(new DataColumn("PRINCIPAL", typeof(string))); // dtLoanDisp.Columns.Add(new DataColumn("INTEREST", typeof(string))); // dtLoanDisp.Columns.Add(new DataColumn("TOTAL", typeof(string))); // row = dtLoanDisp.NewRow(); // if (Session["dblPrinciAmnt"] != null) // { // dblPrincipal = Convert.ToDouble(Session["dblPrinciAmnt"]); // } // if (Session["dblIntAmt"] != null) // { // dblInterest = Convert.ToDouble(Session["dblIntAmt"]); // } // row["PRINCIPAL"] = String.Format("{0:0.00}", dblPrincipal); // row["INTEREST"] = String.Format("{0:0.00}", dblInterest); // row["TOTAL"] = String.Format("{0:0.00}", dblPrincipal + dblInterest); // dtLoanDisp.Rows.Add(row); // gvRptDisp.DataSource = dtLoanDisp; // gvRptDisp.DataBind(); // this.gvRptDisp.GridLines = GridLines.Both; // } // gvRptDisp.DataSource = dtDisplay; // gvRptDisp.DataBind(); // Session["datatable"] = dtDisplay; // Session["LoanIntimationLetters"] = null; // objFrmPt.FormatGridView(gvRptDisp); // GridPrint(gvRptDisp); // } // this.gvRptDisp.GridLines = GridLines.None; //} //catch (Exception ex) //{ // objLog.WriteLog("rptDisp_LoanIntimationLetters Exception in PageLoad : " + ex.Message); // ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert('" + ex.Message + "')</script>"); //} //finally //{ // dtDisplay.Dispose(); //} }
protected void txtCCode_TextChanged(object sender, EventArgs e) { string strSql = "", strDays; int Age = 0; double dblAcNo, dblAmount = 0.00; DataTable dtFormdet = new DataTable(); DataTable dtForm15Det = new DataTable(); DateTime dTimeDate, dTimeTempDate, dTimeFromDate, dTimeSDate, dTimeToDate, dTimeDOB, dTimeServerDate; if (txtCCode.Text == string.Empty || txtAmount.Text == string.Empty || txtFromdate.Text == string.Empty || txtTodate.Text == string.Empty) { ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert ('Please fill the Details...!!') </script>"); return; } try { if (Session["constring"] != null) { oraConn = new OracleConnection(Session["constring"].ToString()); if (oraConn.State != ConnectionState.Open) { oraConn.Open(); } } dblAmount = Convert.ToDouble(txtAmount.Text); dblAcNo = Convert.ToDouble(txtCCode.Text); dTimeFromDate = Convert.ToDateTime(txtFromdate.Text); dTimeToDate = Convert.ToDateTime(txtTodate.Text); dTimeTempDate = Convert.ToDateTime(txtFromdate.Text).AddYears(1); dTimeSDate = Convert.ToDateTime("01/04/" + dTimeFromDate.Year); dTimeDate = Convert.ToDateTime("31/03/" + dTimeTempDate.Year); Session["strDate"] = dTimeFromDate; Session["dDate"] = dTimeDate; //get the client details dtForm15Det = getForm15HDet(dTimeFromDate, dTimeToDate, dblAmount, dblAcNo, oraConn); if (dtForm15Det.Rows.Count == 0) { ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('Data Not Found')</script>"); txtCCode.Text = ""; lblName.Text = ""; return; } if (dtForm15Det.Rows.Count > 0) { if ((dtForm15Det.Rows[0]["N_PAN"].ToString().Trim() == string.Empty) || (dtForm15Det.Rows[0]["N_DOB"].ToString().Trim() == string.Empty)) { ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('Not eligible')</script>"); txtCCode.Text = ""; lblName.Text = ""; return; } if (!DBNull.Value.Equals(dtForm15Det.Rows[0]["N_DOB"].ToString())) { dTimeDOB = Convert.ToDateTime(dtForm15Det.Rows[0]["N_DOB"]); objLog.WriteLog("Inside Form15HLogAccountWise->txtCCode_TextChanged()->before getserverdate"); dTimeServerDate = Convert.ToDateTime(objGlb.GetServerDate()); objLog.WriteLog("Inside Form15HLogAccountWise->txtCCode_TextChanged()->after getserverdate"); strDays = (dTimeServerDate - dTimeDOB).TotalDays.ToString(); Age = Convert.ToInt32(strDays) / 365; Session["Age"] = Age; } strSql = "SELECT FORM_TYPE FROM HEAD.FORM15H WHERE FORM_CLIENT='" + txtCCode.Text + "'"; strSql += " AND FORM_FORMDATE <= To_date('" + txtFromdate.Text + "','dd-mm-yyyy')"; strSql += " AND FORM_TODATE >= To_date('" + txtTodate.Text + "','dd-mm-yyyy')"; dtFormdet = objDataFetch.DatatablePassSQL(strSql); if (rdbtnForm15.Items[0].Selected == true) { if (dtFormdet.Rows.Count > 0) { if ((!DBNull.Value.Equals(dtFormdet.Rows[0]["FORM_TYPE"].ToString()))) { if (dtFormdet.Rows[0]["FORM_TYPE"].ToString().Trim() == "F15H") { if ((!DBNull.Value.Equals(dtForm15Det.Rows[0]["N_DOB"].ToString())) && (!DBNull.Value.Equals(dtForm15Det.Rows[0]["N_PAN"].ToString())) && (!DBNull.Value.Equals(dtForm15Det.Rows[0]["N_NAME"].ToString()))) { if (Age >= 60) { lblName.Text = dtForm15Det.Rows[0]["N_NAME"].ToString(); Session["dtForm15Det"] = dtForm15Det; } else { ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('Not eligible')</script>"); txtCCode.Text = ""; lblName.Text = ""; return; } } else { ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('Enter the Valid Client Number')</script>"); txtCCode.Text = ""; lblName.Text = ""; return; } } else { ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('This Client is not marked In Form15H Link Set Up')</script>"); txtCCode.Text = ""; lblName.Text = ""; return; } } else { ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('This Client is not marked In Form15H Link Set Up')</script>"); txtCCode.Text = ""; lblName.Text = ""; return; } } else { ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('This Client is not eligible for Form15H')</script>"); txtCCode.Text = ""; lblName.Text = ""; return; } } else { if ((!DBNull.Value.Equals(dtFormdet.Rows[0]["FORM_TYPE"].ToString()))) { if (dtFormdet.Rows[0]["FORM_TYPE"].ToString().Trim() == "F15G") { if ((dtForm15Det.Rows[0]["N_PAN"].ToString().Trim() == string.Empty) || (dtForm15Det.Rows[0]["N_DOB"].ToString().Trim() == string.Empty)) { ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('Not eligible')</script>"); txtCCode.Text = ""; lblName.Text = ""; txtCCode.Focus(); return; } if ((!DBNull.Value.Equals(dtForm15Det.Rows[0]["N_PAN"].ToString())) && (!DBNull.Value.Equals(dtForm15Det.Rows[0]["N_NAME"].ToString()))) { if ((Age < 60) && (Age > 0)) { lblName.Text = dtForm15Det.Rows[0]["N_NAME"].ToString(); Session["dtForm15Det"] = dtForm15Det; } else { ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('Not eligible')</script>"); txtCCode.Text = ""; lblName.Text = ""; return; } } else { ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('Enter The Valid Client Number')</script>"); txtCCode.Text = ""; lblName.Text = ""; return; } } else { ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('This Client is not marked In Form15G Link Set Up')</script>"); txtCCode.Text = ""; lblName.Text = ""; return; } } else { ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('This Client is not marked In Form15H Link Set Up')</script>"); txtCCode.Text = ""; lblName.Text = ""; return; } } } else { ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('Data Does Not Exists!!! Please check the client Code ')</script>"); txtCCode.Text = ""; lblName.Text = ""; return; } } catch (Exception ex) { objLog.WriteLog("Inside Form15HLogAccountWise->txtCCode_TextChanged()" + ex.Message); ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('" + ex.Message + "')</script>"); return; } finally { if (oraConn.State == ConnectionState.Open) { oraConn.Close(); } oraConn.Dispose(); OracleConnection.ClearAllPools(); dtForm15Det.Dispose(); dtFormdet.Dispose(); } }