protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindGrid();
                BindTemplStageDDL(ddlTemplStageSel1, ddlTemplStageSel2);
                ddlLoanTypeSel.Attributes.Add("onchange", string.Format("loanTypeChanged(this, '{0}', '{1}', '{2}')",
                                                                        ddlTemplStageSel1.ClientID, ddlTemplStageSel2.ClientID, hiTemplStageSel.ClientID));
                ddlTemplStageSel1.Attributes.Add("onchange", string.Format("ddlTemplStageChanged(this, '{0}')",
                                                                           hiTemplStageSel.ClientID));
                ddlTemplStageSel2.Attributes.Add("onchange", string.Format("ddlTemplStageChanged(this, '{0}')",
                                                                           hiTemplStageSel.ClientID));
                Model.Company_General compayGen = cG.GetModel();
                if (!compayGen.EnableMarketing)
                {
                    this.ckbEnableMarketing.Enabled = false;
                    this.lbtnAdd.Enabled            = false;
                }

                Model.Users userInfo = UsersManager.GetModel(CurrUser.iUserID);
                if (null == userInfo)
                {
                    LPLog.LogMessage(LogType.Logerror, string.Format("User Personalization: User with id {0} does not exist.", CurrUser.iUserID));
                    ClientFun("unknowerrormsg", "alert('User does not exists, unknow error.');");
                }
                this.ckbEnableMarketing.Checked = userInfo.MarketingAcctEnabled;
            }
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!CurrUser.userRole.CompanySetup)
                {
                    Response.Redirect("../Unauthorize.aspx");
                    Response.End();
                }
                else
                {
                    this.DoInitData();
                }

                if (!CurrUser.userRole.SetUserGoals)
                {
                    this.lbtnSetGoals.Enabled = false;
                }

                BLL.Company_General   comGeneral = new BLL.Company_General();
                Model.Company_General company    = comGeneral.GetModel();
                if (null != company)
                {
                    this.hiPrefix.Value = company.AD_OU_Filter;
                }

                BindGrid();
            }
        }
Example #3
0
        const int ROLEID_LO            = 3; // Loan Officer RoleId

        protected void Page_Load(object sender, EventArgs e)
        {
            Model.Users userInfo = UsersManager.GetModel(CurrUser.iUserID);
            if (!IsPostBack)
            {
                if (!CurrUser.userRole.CustomUserHome)
                {
                    this.ckbCompanyCalendar.Enabled              = false;
                    this.ckbRatesSummary.Enabled                 = false;
                    this.ckbPipelineChart.Enabled                = false;
                    this.ckbGoalsChart.Enabled                   = false;
                    this.ckbSalesBreakdownChart.Enabled          = false;
                    this.ckbOverdueTasks.Enabled                 = false;
                    this.ckbOrgProductionChart.Enabled           = false;
                    this.ckbAnnouncements.Enabled                = false;
                    this.ckbOrgProductSaleBreakdownChart.Enabled = false;
                    this.ckbExchangeInbox.Enabled                = false;
                    this.ckbExchangeCalendar.Enabled             = false;
                }

                if (ROLEID_EXECUTIVE != CurrUser.iRoleID && ROLEID_BRANCHMANAGER != CurrUser.iRoleID)
                {
                    this.ckbSalesBreakdownChart.Enabled          = false;
                    this.ckbOrgProductionChart.Enabled           = false;
                    this.ckbOrgProductSaleBreakdownChart.Enabled = false;
                    ClientFun("isneedcheck", "needCheckAllChart = false;");
                }

                if (ROLEID_LO == CurrUser.iRoleID && CurrUser.userRole.SetOwnGoals)
                {
                    this.btnSetGoals.OnClientClick = string.Format("showUserGoalsSetupWin('{0}'); return false;", CurrUser.iUserID);
                }
                else
                {
                    this.btnSetGoals.Enabled = false;
                }
                Model.UserPipelineColumns userPipelineCols = UserPipelineColsManager.GetModel(CurrUser.iUserID);
                Model.UserProspectColumns userProspectCols = UserProspectColsManager.GetModel(CurrUser.iUserID);
                Model.UserHomePref        userHomePref     = UserHomePrefManager.GetModel(CurrUser.iUserID);
                if (null == userInfo)
                {
                    LPLog.LogMessage(LogType.Logerror, string.Format("User Personalization: User with id {0} does not exist.", CurrUser.iUserID));
                    ClientFun("unknowerrormsg", "ShowMsg('unknowerror');");
                }
                Model.Company_General company = comGeneral.GetModel();
                if (null != company)
                {
                    this.hiPrefix.Value = company.AD_OU_Filter;
                }
                this.lbUserName.Text = string.Format("{0} {1}", userInfo.FirstName, userInfo.LastName);
                this.lbEmail.Text    = userInfo.EmailAddress;
                //this.tbPWD.Text = userInfo.Password;
                //this.tbPWDCfm.Text = userInfo.Password;
                this.hiUsername.Value  = userInfo.Username;
                this.hiFirstName.Value = userInfo.FirstName;
                this.hiLastName.Value  = userInfo.LastName;

                #region show my picture neo

                if (userInfo.UserPictureFile == null)
                {
                    this.imgUserPhoto.ImageUrl = string.Format("~/_layouts/LPWeb/Settings/GetUserPicture.aspx?t={0}", DateTime.Now.Ticks);
                }
                else
                {
                    this.imgUserPhoto.ImageUrl = string.Format("~/_layouts/LPWeb/Settings/GetUserPicture.aspx?uid={0}&t={1}", this.CurrUser.iUserID.ToString(), DateTime.Now.Ticks);
                }

                #endregion

                // My Signature
                this.txtSignature.Text = userInfo.Signature;

                ListItem item = this.ddlLoanPerPage.Items.FindByValue(userInfo.LoansPerPage.ToString());
                if (null != item)
                {
                    this.ddlLoanPerPage.ClearSelection();
                    item.Selected = true;
                }

                if (null != userPipelineCols)
                {
                    SetUserPipelineColumnsInfo(userPipelineCols);
                }
                if (null != userProspectCols)
                {
                    SetUserProspectColumnsInfo(userProspectCols);
                }
                if (null != userHomePref)
                {
                    SetUserHomePrefInfo(userHomePref);
                }
            }

            // password area
            if (string.IsNullOrEmpty(userInfo.Password))
            {
                this.trPwd.Attributes.CssStyle.Add("display", "none");
                this.lbtnChangePwd.Attributes.CssStyle.Add("display", "");
                this.lbtnChangePwd.Text = "Store your password";
                this.lbtnCancelPwd.Attributes.CssStyle.Add("display", "none");
            }
            else
            {
                this.trPwd.Attributes.CssStyle.Add("display", "none");
                this.lbtnChangePwd.Attributes.CssStyle.Add("display", "");
                this.lbtnCancelPwd.Attributes.CssStyle.Add("display", "none");
            }
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            LPWeb.Common.LoginUser login = new Common.LoginUser();
            if (!login.userRole.CompanySetup || !login.userRole.OtherLoanAccess)
            {
                hfdUserPre.Value = "0";
            }
            else
            {
                hfdUserPre.Value = "1";
            }
            //LPWeb.BLL.Users bllUser = new LPWeb.BLL.Users();
            //LPWeb.BLL.Roles bllRole = new LPWeb.BLL.Roles();
            //LPWeb.Model.Roles modelRole = new LPWeb.Model.Roles();

            ////string sLoginUserId = HttpContext.Current.User.Identity.Name;
            //string sLoginUserId = "SPSTESTLO2_2B1";// "SPSTESTReg1Ex";//todo:hard-code
            //if (sLoginUserId.IndexOf("\\") >= 0)
            //{
            //    sLoginUserId = sLoginUserId.Substring(sLoginUserId.LastIndexOf("\\") + 1);
            //}

            //DataTable dtUserInfo = bllUser.GetUserList(" AND Username='******'");
            //if (dtUserInfo == null || dtUserInfo.Rows.Count == 0)
            //{
            //    HttpContext.Current.Response.Redirect("../NoPermission.htm");
            //    return;
            //}

            //int roleID = Convert.ToInt32(dtUserInfo.Rows[0]["RoleId"].ToString());
            //if (roleID != 0)
            //{
            //    modelRole = bllRole.GetModel(roleID);
            //}

            //if (!modelRole.CompanySetup || !modelRole.OtherLoanAccess)
            //{
            //    hfdUserPre.Value = "0";
            //}
            //else
            //{
            //    hfdUserPre.Value = "1";
            //}

            List <Int32> LUserRecentList = login.RecentItems;

            foreach (var recentItem in LUserRecentList)
            {
                var    _bUserRecentItems = new BLL.UserRecentItems();
                string sBorrowerName     = _bUserRecentItems.GetUserRecentItemsBorrowerInfo(Convert.ToInt32(recentItem));
                string sLoanStatus       = _bUserRecentItems.GetLoanStatusbyFileID(Convert.ToInt32(recentItem));
                string sCurrentPageURL   = Request.Url.AbsoluteUri;

                if (sLoanStatus == "Prospect")
                {
                    if (sCurrentPageURL.IndexOf("FileID=") > -1)
                    {
                        sCurrentPageURL = "";
                    }

                    if (sBorrowerName.Trim() != string.Empty)
                    {
                        sUserRecentItems += "<li class='static'><a class='static menu-item' href='../Prospect/ProspectLoanDetails.aspx?FileID=" + recentItem + "&FileIDs=" + recentItem + "&FromPage=" + sCurrentPageURL + "'>";
                        sUserRecentItems += "<span class='additional-background'><span class='menu-item-text'>" + sBorrowerName + "</span></span></a></li>";

                        sHomePageUserRecentItems += "<li class='static'><a class='static menu-item' href='Prospect/ProspectLoanDetails.aspx?FileID=" + recentItem + "&FileIDs=" + recentItem + "&FromPage=" + sCurrentPageURL + "'>";
                        sHomePageUserRecentItems += "<span class='additional-background'><span class='menu-item-text'>" + sBorrowerName + "</span></span></a></li>";
                    }
                }
                else
                {
                    if (sCurrentPageURL.IndexOf("fieldid=") > -1)
                    {
                        sCurrentPageURL = "";
                    }

                    if (sBorrowerName.Trim() != string.Empty)
                    {
                        sUserRecentItems += "<li class='static'><a class='static menu-item' href='../LoanDetails/LoanDetails.aspx?fieldid=" + recentItem + "&fieldids=" + recentItem + "&FromPage=" + sCurrentPageURL + "'>";
                        sUserRecentItems += "<span class='additional-background'><span class='menu-item-text' >" + sBorrowerName + "</span></span></a></li>";

                        sHomePageUserRecentItems += "<li class='static'><a class='static menu-item' href='LoanDetails/LoanDetails.aspx?fieldid=" + recentItem + "&fieldids=" + recentItem + "&FromPage=" + sCurrentPageURL + "'>";
                        sHomePageUserRecentItems += "<span class='additional-background'><span class='menu-item-text' >" + sBorrowerName + "</span></span></a></li>";
                    }
                }
            }


            if (!IsPostBack)
            {
                try
                {
                    // set welcome info
                    BLL.Company_General   comGeneral = new BLL.Company_General();
                    Model.Company_General company    = comGeneral.GetModel();
                    if (null != company)
                    {
                        this.literalComName.Text = string.Format("Welcome to the {0} Portal! ", company.Name);
                    }
                }
                catch
                { }
            }

            // 获取Company_General
            LPWeb.BLL.Company_General   bllCompanyGeneral = new LPWeb.BLL.Company_General();
            LPWeb.Model.Company_General modCompanyGeneral = bllCompanyGeneral.GetModel();

            this.sMyEmailInboxURL = modCompanyGeneral.MyEmailInboxURL;
            this.sMyCalendarURL   = modCompanyGeneral.MyCalendarURL;
            this.sRatesURL        = modCompanyGeneral.RatesURL;
        }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!CurrUser.userRole.CompanySetup)
                {
                    Response.Redirect("../Unauthorize.aspx");
                    Response.End();
                }

                this.imgUserPic.Attributes.Add("onload", string.Format("resizeImage('{0}')", this.imgUserPic.ClientID));
                // get UserId from query string
                int nUserId = -1;
                if (!int.TryParse(Request.QueryString["uid"], out nUserId))
                {
                    nUserId = -1;
                }
                if (-1 == nUserId)
                {
                    UserId = null;
                }
                else
                {
                    UserId = nUserId;
                }

                BLL.Company_General   comGeneral = new BLL.Company_General();
                Model.Company_General company    = comGeneral.GetModel();
                if (null != company)
                {
                    this.lbPrefix.Text = company.AD_OU_Filter;
                }

                // bind User Loan Rep gridview
                BindLoanRep();

                // bind Group gridview
                BindGroup();

                // bind Role dropdown list
                BLL.Roles RolesManager = new BLL.Roles();
                DataSet   dsRoles      = RolesManager.GetList(string.Empty);
                this.ddlRole.DataSource     = dsRoles;
                this.ddlRole.DataValueField = "RoleId";
                this.ddlRole.DataTextField  = "Name";
                this.ddlRole.DataBind();
                this.ddlRole.Items.Insert(0, new ListItem("Please Select", ""));
                Mode = Request.QueryString["mode"];
                if ("0" == Mode)
                {
                    this.btnDelete.Enabled = false;
                    this.btnClone.Enabled  = false;
                }
                if ("1" == Mode)
                {
                    // Load user info
                    if (!UserId.HasValue)
                    {
                        // if no UserId,thorw exception
                        LPLog.LogMessage(LogType.Logerror, "Invalid UserId");
                        throw new Exception("Invalid UserId");
                    }
                    else
                    {
                        Model.Users user = UsersManager.GetModel(UserId.Value);
                        if (null == user)
                        {
                            LPLog.LogMessage(LogType.Logerror, string.Format("Cannot find the user with UserId = {0}", UserId.Value));
                        }
                        else
                        {
                            this.ckbEnabled.Checked = user.UserEnabled;
                            this.tbUserName.Text    = user.Username;
                            this.tbEmail.Text       = user.EmailAddress;
                            this.tbFirstName.Text   = user.FirstName;
                            this.tbLastName.Text    = user.LastName;
                            ListItem item = this.ddlRole.Items.FindByValue(user.RoleId.ToString());
                            if (null != item)
                            {
                                this.ddlRole.ClearSelection();
                                item.Selected = true;
                            }
                            this.hiUserLoanCount.Value    = LoanTeamManager.GetUserLoanCount(UserId.Value).ToString();
                            this.hiUserContactCount.Value = ContactUsersManager.GetUserContactCount(UserId.Value).ToString();

                            //gdc 20110606 Add
                            this.txbPhone.Text = user.Phone;
                            this.txbFax.Text   = user.Fax;
                            this.txbCell.Text  = user.Cell;

                            this.txbBranchManagerCompensation.Text   = user.BranchMgrComp.ToString("00.000");
                            this.txbDivisionManagerCompensation.Text = user.DivisionMgrComp.ToString("00.000");
                            this.txbLoanOfficerCompenstation.Text    = user.LOComp.ToString("00.000");
                            this.txbRegionalManagerCompensation.Text = user.RegionMgrComp.ToString("00.000");

                            //ExchangePassword
                            this.txbExchangePassword.Text = user.ExchangePassword;
                            this.txbExchangePassword.Attributes.Add("value", user.ExchangePassword);
                        }
                    }
                }

                if (UserId.HasValue && Mode == "1")
                {
                    this.tbUserName.Enabled   = false;
                    this.tbUserName.BackColor = System.Drawing.Color.LightGray;
                }
                else
                {
                    this.tbUserName.Enabled   = true;
                    this.tbUserName.BackColor = System.Drawing.Color.Transparent;
                }
            }
        }
Example #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Model.Users userInfo = UsersManager.GetModel(CurrUser.iUserID);
                if (null == userInfo)
                {
                    LPLog.LogMessage(LogType.Logerror, string.Format("User Personalization: User with id {0} does not exist.", CurrUser.iUserID));
                    ClientFun("unknowerrormsg", "alert('User does not exists, unknow error.');");
                }
                if (CurrUser.userRole.SetOwnGoals || CurrUser.userRole.SetUserGoals)
                {
                    this.btnSetGoals.OnClientClick = string.Format("showUserGoalsSetupWin('{0}'); return false;", CurrUser.iUserID);
                }
                else
                {
                    this.btnSetGoals.Enabled = false;
                }
                Model.Company_General company = comGeneral.GetModel();
                if (null != company)
                {
                    this.hiPrefix.Value = company.AD_OU_Filter;
                }
                this.lbUserName.Text   = string.Format("{0} {1}", userInfo.FirstName, userInfo.LastName);
                this.lbEmail.Text      = userInfo.EmailAddress;
                this.hiUsername.Value  = userInfo.Username;
                this.hiFirstName.Value = userInfo.FirstName;
                this.hiLastName.Value  = userInfo.LastName;

                this.txbCell.Text       = userInfo.Cell;
                this.txbFax.Text        = userInfo.Fax;
                this.txbPhone.Text      = userInfo.Phone;
                this.txbLicense.Text    = userInfo.LicenseNumber;
                this.txbExchangPwd.Text = userInfo.ExchangePassword;
                this.txbExchangPwd.Attributes.Add("value", userInfo.ExchangePassword);

                //gdc CR43
                this.txbNMLS.Text = userInfo.NMLS;

                #region show my picture neo

                this.imgUserPhoto.Attributes.Add("onload", string.Format("resizeImage('{0}')", this.imgUserPhoto.ClientID));

                #endregion

                // My Signature
                this.txtSignature.Text = userInfo.Signature;

                // password area
                if (string.IsNullOrEmpty(userInfo.Password))
                {
                    this.trPwd.Attributes.CssStyle.Add("display", "none");
                    this.lbtnChangePwd.Attributes.CssStyle.Add("display", "");
                    this.lbtnChangePwd.Text = "Store your password";
                    this.lbtnCancelPwd.Attributes.CssStyle.Add("display", "none");
                }
                else
                {
                    this.trPwd.Attributes.CssStyle.Add("display", "none");
                    this.lbtnChangePwd.Attributes.CssStyle.Add("display", "");
                    this.lbtnCancelPwd.Attributes.CssStyle.Add("display", "none");
                }


                BindLicensesList();
            }
        }