protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
         this.ObjectDataSource2.SelectParameters["ClientID"].DefaultValue = loanApp.getClientID(MySessionManager.AppID).ToString();
         this.rvPreagreement.DataBind();
         this.rvPreagreement.LocalReport.Refresh();
     }
     catch (Exception ex) { }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     try 
     {
         LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
         this.ObjectDataSource2.SelectParameters["ClientID"].DefaultValue = loanApp.getClientID(MySessionManager.AppID).ToString();
         this.rvPreagreement.DataBind();
         this.rvPreagreement.LocalReport.Refresh();
       
     }
     catch (Exception ex) { }
 }
Exemple #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (MySessionManager.CurrentUser == null)
        {
            Response.Redirect("~/logout.aspx");
        }
        LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
        setNotifications();
        showLoanAppInfo();
        setUrls();
        if (Request.QueryString["id"] == null)
        {
        }
        else
        {
            string EncID = Request.QueryString["id"];
            int    DecID = Convert.ToInt32(MyEncryption.Decrypt(EncID, "12345678910"));
            MySessionManager.AppID    = DecID;
            MySessionManager.ClientID = Convert.ToInt32(loanApp.getClientID(MySessionManager.AppID));
            showLoanAppInfo();
        }
        if (!(Request.QueryString["ops"] == null))
        {
            if (!(Request.QueryString["tab"] == null))
            {
                if (!(Request.QueryString["tab"] == ""))
                {
                    currentTab = int.Parse(Request.QueryString["tab"]);
                }
                else
                {
                    currentTab = Convert.ToInt32(MySessionManager.CurrentTab);
                }
                ops = Request.QueryString["ops"].ToString();
                setTab();
                MySessionManager.CurrentTab = currentTab.ToString();
                MySessionManager.OpsTab     = "load";

                string urlpath = util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "tab");
                urlpath = util.RemoveQueryStringByKey(urlpath, "ops");
                Response.Redirect(urlpath);
            }
            else
            {
                if (!(Request.QueryString["tab"] == ""))
                {
                    currentTab = int.Parse(Request.QueryString["tab"]);
                }
                else
                {
                    currentTab = 0;
                }

                ops = "load";
                setTab();

                MySessionManager.CurrentTab = currentTab.ToString();
                MySessionManager.OpsTab     = "load";
                util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "tab");
                util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "ops");
            }
        }
        else
        {
            ops = MySessionManager.OpsTab.ToString();

            //For handling the tabs
            if (!(MySessionManager.CurrentTab == ""))
            {
                currentTab = int.Parse(MySessionManager.CurrentTab);
            }
            else
            {
                currentTab = 0;
            }

            setTab();
        }
        if ((!(util.alert() == "")) && (MySessionManager.skipAlert == 0))
        {
            this.pAlertmsg.InnerText = util.alert();
            // Define the name and type of the client scripts on the page.
            String csname1 = "PopupScript";
            String csname2 = "ButtonClickScript";
            Type   cstype  = this.GetType();

            // Get a ClientScriptManager reference from the Page class.
            ClientScriptManager cs = Page.ClientScript;

            // Check to see if the startup script is already registered.
            if (!cs.IsStartupScriptRegistered(cstype, csname1))
            {
                String cstext1 = "alertMessage();";
                cs.RegisterStartupScript(cstype, csname1, cstext1, true);
            }
            MySessionManager.skipAlert = 1;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
        setNotifications();
       
        if (!(this.IsPostBack))
        {
            setUrls();
           
        }
        #region QueryStringBlock
        if (Request.QueryString["id"] == null)
        {
        }
        else
        {
            string EncID = Request.QueryString["id"];
            int DecID = Convert.ToInt32(MyEncryption.Decrypt(EncID, "12345678910"));
            MySessionManager.AppID = DecID;
            //int DecID = Convert.ToInt32(EncID);

            MySessionManager.ClientID = Convert.ToInt32(loanApp.getClientID(MySessionManager.AppID));

        }

        LoanType = Convert.ToInt32(loanApp.GetLoanType(MySessionManager.AppID, MySessionManager.ClientID));
        setLoanTypeTabs(LoanType);
        showLoanAppInfo();

        if (!(Request.QueryString["ops"] == null))
        {
            if (!(Request.QueryString["tab"] == null))
            {
                if (!(Request.QueryString["tab"] == ""))
                    currentTab = int.Parse(Request.QueryString["tab"]);
                else
                    currentTab = Convert.ToInt32(MySessionManager.CurrentTab);
                ops = Request.QueryString["ops"].ToString();
                setTab(currentTab);
                MySessionManager.CurrentTab = currentTab.ToString();
                MySessionManager.OpsTab = "load";

                string urlpath = util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "tab");
                urlpath = util.RemoveQueryStringByKey(urlpath, "ops");
                Response.Redirect(urlpath);
            }
            else
            {
                if (!(Request.QueryString["tab"] == ""))
                    currentTab = int.Parse(Request.QueryString["tab"]);
                else
                    if (LoanType == 2 || LoanType == 3)
                        currentTab = 2;
                    else
                        currentTab = 0;

                ops = "load";
                setTab(currentTab);

                MySessionManager.CurrentTab = currentTab.ToString();
                MySessionManager.OpsTab = "load";
                util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "tab");
                util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "ops");
            }
        }
        else
        {
            ops = MySessionManager.OpsTab.ToString();

            //For handling the tabs
            if (!(MySessionManager.CurrentTab == ""))

                currentTab = int.Parse(MySessionManager.CurrentTab);
            else
                if (LoanType == 2 || LoanType == 3)
                {
                    currentTab = 2;
                    MySessionManager.CurrentTab = currentTab.ToString();
                }
                else
                {
                    currentTab = 0;
                    MySessionManager.CurrentTab = currentTab.ToString();
                }
            setTab(currentTab);
        } 
        #endregion

        if ((!(util.alert() == "")) && (MySessionManager.skipAlert == 0))
        {
            this.pAlertmsg.InnerText = util.alert();
            // Define the name and type of the client scripts on the page.
            String csname1 = "PopupScript";
            String csname2 = "ButtonClickScript";
            Type cstype = this.GetType();

            // Get a ClientScriptManager reference from the Page class.
            ClientScriptManager cs = Page.ClientScript;

            // Check to see if the startup script is already registered.
            if (!cs.IsStartupScriptRegistered(cstype, csname1))
            {
                String cstext1 = "alertMessage();";
                cs.RegisterStartupScript(cstype, csname1, cstext1, true);
            }
            MySessionManager.skipAlert = 1;
        }

    }
    protected void Page_Load(object sender, EventArgs e)
    {
        setUrls();
        if (MySessionManager.CurrentUser == null)
        {
            Response.Redirect("~/logout.aspx");
        }
        LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter();

        try
        {
            mainDSTableAdapters.NotificationCountTableAdapter tblCounter = new mainDSTableAdapters.NotificationCountTableAdapter();
            mainDS.NotificationCountRow itemcount = tblCounter.NotificationCount(MySessionManager.CurrentUser.BranchID, MySessionManager.CurrentUser.UserID, MySessionManager.CurrentUser.TeamID)[0];

            this.pendingRecInfo.InnerText = (Convert.ToInt32(itemcount.receipts.ToString())).ToString();
            this.pendingDisInfo.InnerText = (Convert.ToInt32(itemcount.disbursementI.ToString()) + Convert.ToInt32(itemcount.disbursementII.ToString()) + Convert.ToInt32(itemcount.disbursementIII.ToString())).ToString();
        }
        catch (Exception ex)
        {

        }

        setPanelsOff();
        showLoanAppInfo();


        #region QueryStringSection
        if (Request.QueryString["id"] == null)
        {
        }
        else
        {
            string EncID = Request.QueryString["id"];
            int DecID = Convert.ToInt32(MyEncryption.Decrypt(EncID, "12345678910"));
            MySessionManager.AppID = DecID;
            MySessionManager.ClientID = Convert.ToInt32(loanApp.getClientID(MySessionManager.AppID));
        }

        if (!(Request.QueryString["ops"] == null))
        {
            if (!(Request.QueryString["tab"] == null))
            {
                if (!(Request.QueryString["tab"] == ""))
                    currentTab = int.Parse(Request.QueryString["tab"]);
                else
                    currentTab = Convert.ToInt32(MySessionManager.CurrentTab);
                ops = Request.QueryString["ops"].ToString();
                setPanels(currentTab);
                MySessionManager.CurrentTab = currentTab.ToString();
                MySessionManager.OpsTab = "load";

                string urlpath = util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "tab");
                urlpath = util.RemoveQueryStringByKey(urlpath, "ops");
                Response.Redirect(urlpath);
            }
            else
            {
                if (!(Request.QueryString["tab"] == ""))
                    currentTab = int.Parse(Request.QueryString["tab"]);
                else
                    currentTab = 0;

                ops = "load";
                setPanels(currentTab);

                MySessionManager.CurrentTab = currentTab.ToString();
                MySessionManager.OpsTab = "load";
                util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "tab");
                util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "ops");
            }
        }
        else
        {
            ops = MySessionManager.OpsTab.ToString();

            //For handling the tabs
            if (!(MySessionManager.CurrentTab == ""))

                currentTab = int.Parse(MySessionManager.CurrentTab);
            else
                currentTab = 0;

            setPanels(currentTab);
        } 
        #endregion

        if ((!(util.alert() == "")) && (MySessionManager.skipAlert == 0))
        {
            this.pAlertmsg.InnerText = util.alert();
            // Define the name and type of the client scripts on the page.
            String csname1 = "PopupScript";
            String csname2 = "ButtonClickScript";
            Type cstype = this.GetType();

            // Get a ClientScriptManager reference from the Page class.
            ClientScriptManager cs = Page.ClientScript;

            // Check to see if the startup script is already registered.
            if (!cs.IsStartupScriptRegistered(cstype, csname1))
            {
                String cstext1 = "alertMessage();";
                cs.RegisterStartupScript(cstype, csname1, cstext1, true);
            }
            MySessionManager.skipAlert = 1;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
       
        if (MySessionManager.AppID > 0)
        {
            this.itemLoanApp.Visible = true;
            this.ItemLoanAccount.Visible = false;
            LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
            MySessionManager.ClientID = Convert.ToInt32(loanApp.getClientID(MySessionManager.AppID));

            try
            {
                mainDSTableAdapters.GetApplicationInfoTableAdapter appinfo = new mainDSTableAdapters.GetApplicationInfoTableAdapter();
                mainDS.GetApplicationInfoDataTable tblAppInfo = appinfo.GetApplicationInfo(MySessionManager.AppID);
                if (tblAppInfo.Rows.Count > 0)
                {
                    this.btnEditApp.HRef = setUrls(MySessionManager.AppID);
                    this.btnViewAppTracker.HRef = "~/pages/applicationtracker.aspx?id=" + MyEncryption.Encrypt(MySessionManager.AppID.ToString(), "12345678910");
                    if(tblAppInfo[0].IsdatLoanAmountNull()==false){this.lnAmt.InnerText = tblAppInfo[0].datLoanAmount.ToString("c").Replace("$", "");}
                    if (tblAppInfo[0].IsdatLoanTypeNull() == false) { this.lnType.InnerText = tblAppInfo[0].datLoanType.ToString(); }
                    if (tblAppInfo[0].IsdatApplicationStatusNull() == false) { this.lnAppStatus.InnerText = tblAppInfo[0].datApplicationStatus.ToString(); }
                    if (tblAppInfo[0].IsdatDurationNull() == false) { this.lnDuration.InnerText = tblAppInfo[0].datDuration.ToString() + " month(s)"; }
                    if (tblAppInfo[0].IsdatBranchNull() == false) { this.lnAppBranch.InnerText = tblAppInfo[0].datBranch.ToString(); }
                    if (tblAppInfo[0].IsdatApplicationDateNull() == false) { this.lnAppDate.InnerText = tblAppInfo[0].datApplicationDate.ToLongDateString(); }
                   
                }

            }
            catch (Exception ex) { }
        }
        else if(MySessionManager.AccountID > 0)
        {
            this.ItemLoanAccount.Visible = true;
            this.itemLoanApp.Visible = false;
            LoanAccountDSTableAdapters.GetLoanAccountTableAdapter loanAcc = new LoanAccountDSTableAdapters.GetLoanAccountTableAdapter();
            MySessionManager.ClientID = Convert.ToInt32(loanAcc.GetClientIDFromAcc(Convert.ToInt32(MySessionManager.AccountID)));

            try
            {
                mainDSTableAdapters.GetLoanAccountInfoTableAdapter accinfo = new mainDSTableAdapters.GetLoanAccountInfoTableAdapter();
                mainDS.GetLoanAccountInfoDataTable tblAccInfo = accinfo.GetLoanAccountInfo(Convert.ToInt32(MySessionManager.AccountID));
                if (tblAccInfo.Rows.Count > 0)
                {
                    if (tblAccInfo[0].IsdatOutstandingAmountNull() == false) { this.lnOutstanding.InnerText = tblAccInfo[0].datOutstandingAmount.ToString("c").Replace("$", ""); }
                    if (tblAccInfo[0].IsdatStartDateNull() == false) { this.lnStartDate.InnerText = tblAccInfo[0].datStartDate.ToLongDateString(); }
                    if (tblAccInfo[0].IsdatEndDateNull() == false) { this.lnEndDate.InnerText = tblAccInfo[0].datEndDate.ToLongDateString(); }
                    if (tblAccInfo[0].IsdatBranchNull() == false) { this.lnAccBranch.InnerText = tblAccInfo[0].datBranch.ToString(); }
                    this.btnTransactions.HRef = "~/pages/transactions.aspx?id" + MyEncryption.Encrypt(MySessionManager.AccountID.ToString(), "12345678910") + "&action=entry";
                    this.btnViewStatement.HRef = "~/pages/loanaccount/loanaccountdetails.aspx?id" + MyEncryption.Encrypt(MySessionManager.AccountID.ToString(), "12345678910") + "&action=2";
                    this.btnMonitorAccount.HRef = "~/pages/loanaccount/loanaccountdetails.aspx?id" + MyEncryption.Encrypt(MySessionManager.AccountID.ToString(), "12345678910") + "&action=1";

                    
                }

            }
            catch (Exception ex) { }


        }

        try
        {
            mainDSTableAdapters.GetClientInfoTableAdapter clientInfo = new mainDSTableAdapters.GetClientInfoTableAdapter();
            mainDS.GetClientInfoDataTable tblClientInfo = clientInfo.GetClientInfo(MySessionManager.ClientID);
            if (tblClientInfo.Rows.Count > 0)
            {
                if (tblClientInfo[0].IsdatClientNameNull() == false) { clientname.InnerText = tblClientInfo[0].datClientName.ToString(); }
                if (tblClientInfo[0].IsdatClientNumberNull() == false) {clientNo.InnerText = tblClientInfo[0].datClientNumber.ToString();}
                if (tblClientInfo[0].IsdatMobileNumber1Null() == false) { clMobile.InnerText = tblClientInfo[0].datMobileNumber1.ToString(); }
            }
        }
        catch (Exception ex) { }   
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (MySessionManager.AppID > 0)
        {
            this.itemLoanApp.Visible     = true;
            this.ItemLoanAccount.Visible = false;
            LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
            MySessionManager.ClientID = Convert.ToInt32(loanApp.getClientID(MySessionManager.AppID));

            try
            {
                mainDSTableAdapters.GetApplicationInfoTableAdapter appinfo = new mainDSTableAdapters.GetApplicationInfoTableAdapter();
                mainDS.GetApplicationInfoDataTable tblAppInfo = appinfo.GetApplicationInfo(MySessionManager.AppID);
                if (tblAppInfo.Rows.Count > 0)
                {
                    this.btnEditApp.HRef        = setUrls(MySessionManager.AppID);
                    this.btnViewAppTracker.HRef = "~/pages/applicationtracker.aspx?id=" + MyEncryption.Encrypt(MySessionManager.AppID.ToString(), "12345678910");
                    if (tblAppInfo[0].IsdatLoanAmountNull() == false)
                    {
                        this.lnAmt.InnerText = tblAppInfo[0].datLoanAmount.ToString("c").Replace("$", "");
                    }
                    if (tblAppInfo[0].IsdatLoanTypeNull() == false)
                    {
                        this.lnType.InnerText = tblAppInfo[0].datLoanType.ToString();
                    }
                    if (tblAppInfo[0].IsdatApplicationStatusNull() == false)
                    {
                        this.lnAppStatus.InnerText = tblAppInfo[0].datApplicationStatus.ToString();
                    }
                    if (tblAppInfo[0].IsdatDurationNull() == false)
                    {
                        this.lnDuration.InnerText = tblAppInfo[0].datDuration.ToString() + " month(s)";
                    }
                    if (tblAppInfo[0].IsdatBranchNull() == false)
                    {
                        this.lnAppBranch.InnerText = tblAppInfo[0].datBranch.ToString();
                    }
                    if (tblAppInfo[0].IsdatApplicationDateNull() == false)
                    {
                        this.lnAppDate.InnerText = tblAppInfo[0].datApplicationDate.ToLongDateString();
                    }
                }
            }
            catch (Exception ex) { }
        }
        else if (MySessionManager.AccountID > 0)
        {
            this.ItemLoanAccount.Visible = true;
            this.itemLoanApp.Visible     = false;
            LoanAccountDSTableAdapters.GetLoanAccountTableAdapter loanAcc = new LoanAccountDSTableAdapters.GetLoanAccountTableAdapter();
            MySessionManager.ClientID = Convert.ToInt32(loanAcc.GetClientIDFromAcc(Convert.ToInt32(MySessionManager.AccountID)));

            try
            {
                mainDSTableAdapters.GetLoanAccountInfoTableAdapter accinfo = new mainDSTableAdapters.GetLoanAccountInfoTableAdapter();
                mainDS.GetLoanAccountInfoDataTable tblAccInfo = accinfo.GetLoanAccountInfo(Convert.ToInt32(MySessionManager.AccountID));
                if (tblAccInfo.Rows.Count > 0)
                {
                    if (tblAccInfo[0].IsdatOutstandingAmountNull() == false)
                    {
                        this.lnOutstanding.InnerText = tblAccInfo[0].datOutstandingAmount.ToString("c").Replace("$", "");
                    }
                    if (tblAccInfo[0].IsdatStartDateNull() == false)
                    {
                        this.lnStartDate.InnerText = tblAccInfo[0].datStartDate.ToLongDateString();
                    }
                    if (tblAccInfo[0].IsdatEndDateNull() == false)
                    {
                        this.lnEndDate.InnerText = tblAccInfo[0].datEndDate.ToLongDateString();
                    }
                    if (tblAccInfo[0].IsdatBranchNull() == false)
                    {
                        this.lnAccBranch.InnerText = tblAccInfo[0].datBranch.ToString();
                    }
                    this.btnTransactions.HRef   = "~/pages/transactions.aspx?id" + MyEncryption.Encrypt(MySessionManager.AccountID.ToString(), "12345678910") + "&action=entry";
                    this.btnViewStatement.HRef  = "~/pages/loanaccount/loanaccountdetails.aspx?id" + MyEncryption.Encrypt(MySessionManager.AccountID.ToString(), "12345678910") + "&action=2";
                    this.btnMonitorAccount.HRef = "~/pages/loanaccount/loanaccountdetails.aspx?id" + MyEncryption.Encrypt(MySessionManager.AccountID.ToString(), "12345678910") + "&action=1";
                }
            }
            catch (Exception ex) { }
        }

        try
        {
            mainDSTableAdapters.GetClientInfoTableAdapter clientInfo = new mainDSTableAdapters.GetClientInfoTableAdapter();
            mainDS.GetClientInfoDataTable tblClientInfo = clientInfo.GetClientInfo(MySessionManager.ClientID);
            if (tblClientInfo.Rows.Count > 0)
            {
                if (tblClientInfo[0].IsdatClientNameNull() == false)
                {
                    clientname.InnerText = tblClientInfo[0].datClientName.ToString();
                }
                if (tblClientInfo[0].IsdatClientNumberNull() == false)
                {
                    clientNo.InnerText = tblClientInfo[0].datClientNumber.ToString();
                }
                if (tblClientInfo[0].IsdatMobileNumber1Null() == false)
                {
                    clMobile.InnerText = tblClientInfo[0].datMobileNumber1.ToString();
                }
            }
        }
        catch (Exception ex) { }
    }