protected void Page_Load(object sender, EventArgs e)
        {
            #region 获取Select Pipeline Point Fields

            // 未分配的和已分配到当前Group中的User
            BLL.CompanyLoanPointFields CompanyLoanPointFields = new BLL.CompanyLoanPointFields();
            DataTable dtCompanyLoanPointFieldsInfo            = CompanyLoanPointFields.GetCompanyLoanPointFieldsInfo();
            this.gridPipelinePointFieldsList.DataSource = dtCompanyLoanPointFieldsInfo;
            this.gridPipelinePointFieldsList.DataBind();


            #endregion


            if (!IsPostBack)
            {
                userHomePref = UserHomePrefManager.GetModel(CurrUser.iUserID);
                if (userHomePref == null)
                {
                    userHomePref = new Model.UserHomePref();
                }
                Model.UserPipelineColumns userPipelineCols = UserPipelineColsManager.GetModel(CurrUser.iUserID);
                BindView();
                if (null != userPipelineCols)
                {
                    SetUserPipelineColumnsInfo(userPipelineCols);
                }



                BindList();
            }
        }
        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;
                    this.ckbQuickleadform.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;");
                }

                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", "alert('User does not exists, unknow error.');");
                }

                ListItem item = this.ddlLoanPerPage.Items.FindByValue(userInfo.LoansPerPage.ToString());
                if (null != item)
                {
                    this.ddlLoanPerPage.ClearSelection();
                    item.Selected = true;
                }
                //gdc CR47
                this.cbxShowTasksInLSR.Checked = userInfo.ShowTasksInLSR;

                //gdc CR48
                this.cbxRemindTaskDue.Checked = userInfo.RemindTaskDue;

                //gdc CR48

                if (!string.IsNullOrEmpty(userInfo.TaskReminder.ToString()) && userInfo.TaskReminder.ToString() != "0")
                {
                    this.txtReminderTime.Text = userInfo.TaskReminder.ToString();
                    if (this.cbxRemindTaskDue.Checked == true)
                    {
                        txtReminderTime.Enabled = true;
                    }
                }
                else
                {
                    this.txtReminderTime.Text = "15";
                }

                if (!string.IsNullOrEmpty(userInfo.SortTaskPickList.ToString()))
                {
                    ListItem itemSortTaskPickList = this.ddlSortTaskPickList.Items.FindByValue(userInfo.SortTaskPickList.ToString());
                    if (null != itemSortTaskPickList)
                    {
                        this.ddlSortTaskPickList.ClearSelection();
                        itemSortTaskPickList.Selected = true;
                    }
                }


                if (null != userPipelineCols)
                {
                    SetUserPipelineColumnsInfo(userPipelineCols);
                }
                if (null != userProspectCols)
                {
                    SetUserProspectColumnsInfo(userProspectCols);
                }
                if (null != userHomePref)
                {
                    SetUserHomePrefInfo(userHomePref);
                }
            }
        }
Beispiel #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");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            // 获取当前用户信息
            this.CurrentUser    = new LoginUser();
            this.iCurrentUserID = CurrentUser.iUserID;

            // 默认条件
            string sWhere_DueDate = " and datediff(day, getdate(), a.DueDate) < 0";

            #region 获取 UserHomePref 信息

            BLL.UserHomePref         UserHomePrefManager = new BLL.UserHomePref();
            LPWeb.Model.UserHomePref userHomePref        = UserHomePrefManager.GetModel(this.iCurrentUserID);

            #endregion

            if (userHomePref != null && userHomePref.AlertFilter == 7)      // Overdue + Today
            {
                sWhere_DueDate = " and datediff(day, getdate(), a.DueDate) <= 0";

                this.ddlDueDateFilter.SelectedIndex = 1;
            }

            #region DueDate Filter

            // Due
            if (this.Request.QueryString["DueDate"] != null)
            {
                string sDue = this.Request.QueryString["DueDate"].ToString();

                if (sDue == "In30") // Due in the next month
                {
                    sWhere_DueDate = " and datediff(day, getdate(), a.DueDate) <= 30 and datediff(day, getdate(), a.DueDate) >=0";
                }
                else if (sDue == "In14")  // Due in the next 2 weeks
                {
                    sWhere_DueDate = " and datediff(day, getdate(), a.DueDate) <= 14 and datediff(day, getdate(), a.DueDate) >=0";
                }
                else if (sDue == "In7") // Due in the next 7 days
                {
                    sWhere_DueDate = " and datediff(day, getdate(), a.DueDate) <= 7 and datediff(day, getdate(), a.DueDate) >=0";
                }
                else if (sDue == "In1") // Due tomorrow
                {
                    sWhere_DueDate = " and datediff(day, getdate(), a.DueDate) = 1";
                }
                else if (sDue == "In0") // Due today
                {
                    sWhere_DueDate = " and datediff(day, getdate(), a.DueDate) = 0";
                }
                else if (sDue == "Overdue")
                {
                    sWhere_DueDate = " and datediff(day, getdate(), a.DueDate) < 0";
                }
                else if (sDue == "OverToday")   // Overdue + Today
                {
                    sWhere_DueDate = " and datediff(day, getdate(), a.DueDate) <= 0";
                }
            }

            #endregion

            #region 加载Alerts

            LPWeb.BLL.LoanAlerts AlertManager  = new LPWeb.BLL.LoanAlerts();
            DataTable            AlertListData = new DataTable();
            AlertListData = AlertManager.Loan_GetSimpleAlertList(this.iCurrentUserID, sWhere_DueDate);
            AlertListData.Columns.Add("HRef", typeof(string));
            foreach (DataRow dr in AlertListData.Rows)
            {
                string Url             = string.Empty;
                string CloseDialogCode = "CloseDialogCodes=sharepoint";
                if (dr["AlertType"] != DBNull.Value)
                {
                    string alertType = dr["AlertType"].ToString();
                    switch (alertType.ToLower())
                    {
                    case "rule alert":
                        Url = string.Format("LoanDetails/RuleAlertPopup.aspx?LoanID={0}&AlertID={1}&{2}", dr["FileId"].ToString(), dr["LoanAlertId"].ToString(), CloseDialogCode);
                        break;

                    case "task alert":
                        Url = string.Format("Pipeline/TaskAlertDetail.aspx?fileID={0}&LoanTaskId={1}&{2}", dr["FileId"].ToString(), dr["LoanTaskId"].ToString(), CloseDialogCode);
                        break;
                    }
                }
                dr["HRef"] = Url;
            }
            this.rpAlertList.DataSource = AlertListData;
            this.rpAlertList.DataBind();
            #endregion
        }