Beispiel #1
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();
            }
        }
Beispiel #2
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;
        }
Beispiel #3
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;
                }
            }
        }