コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session.Contents.Count == 0)
        {
            Response.Redirect("ShowMessage.aspx?msg=" + GlobalConstants.msg);
        }
        else
        {
            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(ddlFromDay, ddlFromMonth, ddlFromYear);

                    Bal.Gen objFillToDate = new Bal.Gen();
                    objFillToDate.Call_Date(ddlToDay, ddlToMonth, ddlToYear);

                    OracleConnection con = new OracleConnection(Session["constring"].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();//BY NAYANA
                    // ddlBranch.Enabled = true;

                    if (!global.Valid_Activity(30005))
                    {
                        ddlBranch.Enabled = false;
                    }
                    else
                    {
                        ddlBranch.Enabled = true;
                    }
                    ddlBranch.Enabled = false;
                }
            }
            catch (Exception ex)
            {
                objLog.WriteLog(ex.Message);
                ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert('" + ex.Message + "')</script>");
            }
        }
    }
コード例 #2
0
    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 = objFill.BranchFill();
                    objDataFetch.FillDdl(sSQL, ddlBranch, "BRAN_SNO", "BRAN_NAME");
                    ddlBranch.SelectedValue = Session["BranchLogin"].ToString();
                    ddlBranch.Enabled       = false;
                    txtAbbr.Focus();
                    Bal.Gen objfilldate = new Bal.Gen();
                    objfilldate.Call_Date(ddfrmday, ddfrmMonth, ddfrmYear);
                    Bal.Gen objfilldate1 = new Bal.Gen();
                    objfilldate1.Call_Date(ddtoday, ddtoMonth, ddtoYear);
                }
                strdtfrm = ddfrmday.SelectedItem.Value + "-" + ddfrmMonth.SelectedItem.Text + "-" + ddfrmYear.SelectedItem.Value;
                strdtTo  = ddtoday.SelectedItem.Value + "-" + ddtoMonth.SelectedItem.Text + "-" + ddtoYear.SelectedItem.Value;
                objLog.WriteLog("HousingLoan.aspx: strdtfrm=" + strdtfrm);
                objLog.WriteLog("HousingLoan.aspx: strdtTo=" + strdtTo);
            }
            catch (Exception ex)
            {
                objLog.WriteLog("HousingLoan 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();
            }
        }
    }
コード例 #3
0
    protected void FillLoad()
    {
        OracleConnection oraConn = new OracleConnection(Session["constring"].ToString());

        if (oraConn.State != ConnectionState.Open)
        {
            oraConn.Open();
        }

        Bal.Gen objFillFromDate = new Bal.Gen();
        objFillFromDate.Call_Date(ddFromDay, ddFromMonth, ddFromYear);

        Bal.Gen objFillDate = new Bal.Gen();
        objFillDate.Call_Date(ddlVchrDay, ddlVchrMonth, ddlVchrYear);

        strSql = "select bran_sno,bran_name from MASTER.branch";
        objDataFetch.loginconnection = Session["constring"].ToString();
        objDataFetch.FillDdl(strSql, ddlBranch, "BRAN_SNO", "BRAN_NAME");
        ddlBranch.SelectedValue = Session["BranchLogin"].ToString();

        //rblTypes.SelectedValue = "LOAN";

        strSql = "SELECT LSCH_ABBREV,LSCH_DES FROM LOANSCHEMESETUP WHERE LSCH_BRANCH=" + ddlBranch.SelectedValue;
        OracleDataAdapter odaScheme = new OracleDataAdapter(strSql, oraConn);

        odaScheme.Fill(dtScheme);

        if (dtScheme.Rows.Count <= 0)
        {
            ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert ('No Scheme found...') </script>");
            return;
        }

        ddlScheme.DataSource     = dtScheme;
        ddlScheme.DataValueField = "LSCH_ABBREV";
        ddlScheme.DataTextField  = "LSCH_DES";
        ddlScheme.DataBind();
        ddlScheme.Items.Insert(0, new ListItem("---select the scheme---"));
        oraConn.Close();
        objlog.WriteLog("LoanInsuranceDebit: strSql: " + strSql);
    }
コード例 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // WriteLog("general Ledger.aspx:Page_Load");
        if (Session.Contents.Count == 0)
        {
            Response.Redirect("ShowMessage.aspx?msg=" + GlobalConstants.msg);
        }
        else
        {
            if (!Page.IsPostBack)
            {
                OracleConnection oraConn = new OracleConnection(Session["constring"].ToString());

                // WriteLog("Session-constring" + Session["constring"].ToString());

                if (oraConn.State != ConnectionState.Open)
                {
                    oraConn.Open();
                }

                strSQL = "select bran_sno,bran_name from MASTER.branch ORDER BY bran_sno";
                OracleDataAdapter oda = new OracleDataAdapter(strSQL, oraConn);
                WriteLog("strSQL" + strSQL);

                oda.Fill(dtBranch);
                ddBranch.DataSource     = dtBranch;
                ddBranch.DataTextField  = "bran_name";
                ddBranch.DataValueField = "bran_sno";
                ddBranch.DataBind();
                ddBranch.SelectedValue = (GlobalConstants.branchname.ToString());



                Bal.Gen objfilldate = new Bal.Gen();
                objfilldate.Call_Date(ddfrmday, ddfrmMonth, ddfrmYear);

                Bal.Gen objfilldate1 = new Bal.Gen();
                objfilldate1.Call_Date(ddtoday, ddtoMonth, ddtoYear);


                strSQL = "select ACCM_DESCRIPTION , ACCM_SNO ";
                strSQL = strSQL + " From accountmaster";
                strSQL = strSQL + " order by ACCM_DESCRIPTION";
                WriteLog("strSQL" + strSQL);

                OracleDataAdapter odascheme = new OracleDataAdapter(strSQL, oraConn);
                odascheme.Fill(dtscheme);
                ddschemeName.DataSource     = dtscheme;
                ddschemeName.DataTextField  = "ACCM_DESCRIPTION";
                ddschemeName.DataValueField = "ACCM_SNO";
                ddschemeName.DataBind();
                //=Added on 9/04/2014 by husna
                if (!objValid.Valid_Activity(30005, Session["gblnSupervisor"].ToString(), oraConn, Convert.ToInt32(Session["gUserId"])))
                {
                    ddBranch.Enabled = false;
                }
                else
                {
                    ddBranch.Enabled = true;
                }
            }

            strdtfrm = ddfrmday.SelectedItem.Value + "-" + ddfrmMonth.SelectedItem.Text + "-" + ddfrmYear.SelectedItem.Value;
            strdtTo  = ddtoday.SelectedItem.Value + "-" + ddtoMonth.SelectedItem.Text + "-" + ddtoYear.SelectedItem.Value;
            WriteLog("strdtfrm" + strdtfrm);
            WriteLog("strdtTo" + strdtfrm);
        }
    }
コード例 #5
0
    protected void FillLoad()
    {
        DataTable dtLoanList = new DataTable();
        DataTable dtListOD   = new DataTable();

        if (Session["constring"] != null)
        {
            oraConn = new OracleConnection(Session["constring"].ToString());
            if (oraConn.State != ConnectionState.Open)
            {
                oraConn.Open();
            }
        }
        try
        {
            Bal.Gen objFillFromDate = new Bal.Gen();
            objFillFromDate.Call_Date(ddFromDay, ddFromMonth, ddFromYear);

            Bal.Gen objFillDate = new Bal.Gen();
            objFillDate.Call_Date(ddlPostingDay, ddlPostingMonth, ddlPostingYear);

            strSql = objLoanInsurance.BranchFill();
            objDataFetch.FillDdl(strSql, ddlBranch, "BRAN_SNO", "BRAN_NAME");
            ddlBranch.SelectedValue = Session["BranchLogin"].ToString();

            PanelOD.Visible = false;
            strSql          = objLoanInsurance.LoanFill(ddlBranch.SelectedValue);
            OracleDataAdapter oDaLoan = new OracleDataAdapter(strSql, oraConn);
            oDaLoan.Fill(dtLoanList);

            if (dtLoanList.Rows.Count <= 0)
            {
                ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert ('No Loan Scheme Found...') </script>");
                return;
            }
            chkList.DataSource     = dtLoanList;
            chkList.DataValueField = "LSCH_ABBREV";
            chkList.DataTextField  = "LSCH_DES";
            chkList.DataBind();
            oraConn.Close();

            strSql = objLoanInsurance.ODFill(ddlBranch.SelectedValue);
            OracleDataAdapter oDaOD = new OracleDataAdapter(strSql, oraConn);
            oDaOD.Fill(dtListOD);

            if (dtListOD.Rows.Count <= 0)
            {
                ClientScript.RegisterStartupScript(Page.GetType(), "VALIDATION", "<script language='javascript'>alert ('No OD Scheme Found...') </script>");
                return;
            }
            chkListOd.DataSource     = dtListOD;
            chkListOd.DataValueField = "ODST_ABBR";
            chkListOd.DataTextField  = "ODST_NAME";
            chkListOd.DataBind();
        }
        catch (Exception ex)
        {
            objLog.WriteLog("LoanInsrnceAutoPosting Exception in FillLoad : " + ex.Message);
            ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('" + ex.Message + "')</script>");
        }
        finally
        {
            if (oraConn.State == ConnectionState.Open)
            {
                oraConn.Close();
            }
            oraConn.Dispose();
            dtLoanList.Dispose();
            dtListOD.Dispose();
            OracleConnection.ClearAllPools();
        }
    }