/// <summary> /// bind UserProspectColumns Info /// </summary> /// <param name="pipelineCols"></param> private bool SetUserProspectColumnsInfo(Model.UserProspectColumns prospectCols) { this.ckbpvBranch.Checked = prospectCols.Pv_Branch; this.ckbpvCreate.Checked = prospectCols.Pv_Created; this.ckbpvLeadSource.Checked = prospectCols.Pv_Leadsource; this.ckbpvLoanOfficer.Checked = prospectCols.Pv_Loanofficer; // this.ckbpvProgress.Checked = prospectCols.Pv_Progress; this.ckbpvRefCode.Checked = prospectCols.Pv_Refcode; this.ckbpvReferral.Checked = prospectCols.Pv_Referral; this.ckbpvPartner.Checked = prospectCols.Pv_Partner; this.ckblvAmount.Checked = prospectCols.Lv_Amount; this.ckblvBranch.Checked = prospectCols.Lv_Branch; this.ckblvEstClose.Checked = prospectCols.Lv_Estclose; this.ckblvLeadSource.Checked = prospectCols.Lv_Leadsource; this.ckblvLien.Checked = prospectCols.Lv_Lien; this.ckblvLoanOfficer.Checked = prospectCols.Lv_Loanofficer; this.ckblvLoanProgram.Checked = prospectCols.Lv_Loanprogram; this.ckblvPointFilename.Checked = prospectCols.Lv_Pointfilename; this.ckblvProgress.Checked = prospectCols.Lv_Progress; this.ckblvRanking.Checked = prospectCols.Lv_Ranking; this.ckblvRate.Checked = prospectCols.Lv_Rate; this.ckblvRefCode.Checked = prospectCols.Lv_Refcode; this.ckblvReferral.Checked = prospectCols.Lv_Referral; this.ckblvPartner.Checked = prospectCols.Lv_Partner; this.chklvLastComplStage.Checked = prospectCols.LastCompletedStage; this.chklvLastStageComplDate.Checked = prospectCols.LastStageComplDate; return(true); }
/// <summary> /// load UserProspectColumns Personalization Info /// </summary> /// <param name="pipelineCols"></param> private bool GetUserProspectColumnsInfo(ref Model.UserProspectColumns prospectCols) { prospectCols.Pv_Created = this.ckbpvCreate.Checked; prospectCols.Pv_Leadsource = this.ckbpvLeadSource.Checked; prospectCols.Pv_Branch = this.ckbpvBranch.Checked; prospectCols.Pv_Loanofficer = this.ckbpvLoanOfficer.Checked; prospectCols.Pv_Refcode = this.ckbpvRefCode.Checked; // prospectCols.Pv_Progress = this.ckbpvProgress.Checked; prospectCols.Lv_Amount = this.ckblvAmount.Checked; prospectCols.Lv_Branch = this.ckblvBranch.Checked; prospectCols.Lv_Estclose = this.ckblvEstClose.Checked; prospectCols.Lv_Leadsource = this.ckblvLeadSource.Checked; prospectCols.Lv_Lien = this.ckblvLien.Checked; prospectCols.Lv_Loanofficer = this.ckblvLoanOfficer.Checked; prospectCols.Lv_Loanprogram = this.ckblvLoanProgram.Checked; prospectCols.Lv_Pointfilename = this.ckblvPointFilename.Checked; prospectCols.Lv_Progress = this.ckblvProgress.Checked; prospectCols.Lv_Ranking = this.ckblvRanking.Checked; prospectCols.Lv_Rate = this.ckblvRate.Checked; prospectCols.Lv_Refcode = this.ckblvRefCode.Checked; prospectCols.Pv_Referral = this.ckbpvReferral.Checked; prospectCols.Pv_Partner = this.ckbpvPartner.Checked; prospectCols.Lv_Referral = this.ckblvReferral.Checked; prospectCols.Lv_Partner = this.ckblvPartner.Checked; prospectCols.LastCompletedStage = this.chklvLastComplStage.Checked; prospectCols.LastStageComplDate = this.chklvLastStageComplDate.Checked; return(true); }
/// <summary> /// copy user PipelineColsinfo /// </summary> /// <param name="nSourceUserID"></param> /// <param name="nDistUserID"></param> public void CopyUserPipelineColsInfo(int nSourceUserID, int nDistUserID) { Model.UserProspectColumns userPipelineCols = dal.GetModel(nSourceUserID); if (null != userPipelineCols) { userPipelineCols.UserId = nDistUserID; dal.Add(userPipelineCols); } }
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); } } }
protected void btnSave_Click(object sender, EventArgs e) { Model.Users userInfo = UsersManager.GetModel(CurrUser.iUserID); Model.UserPipelineColumns userPipelineCols = UserPipelineColsManager.GetModel(CurrUser.iUserID); Model.UserProspectColumns userProspectCols = UserProspectColsManager.GetModel(CurrUser.iUserID); Model.UserHomePref userHomePref = UserHomePrefManager.GetModel(CurrUser.iUserID); try { if (null == userInfo) { LPLog.LogMessage(LogType.Logerror, string.Format("User Personalization - Preferences: User with id {0} does not exist.", CurrUser.iUserID)); ClientFun("unknowerrmsg2", "alert('User does not exists, unknow error.');"); } if (!GetUserInfo(ref userInfo)) { ClientFun("invalidinputmsg", "alert('Invalid input!');"); return; } UsersManager.Update(userInfo); if (null == userPipelineCols) { userPipelineCols = new Model.UserPipelineColumns(); userPipelineCols.UserId = CurrUser.iUserID; GetUserPipelineColumnsInfo(ref userPipelineCols); UserPipelineColsManager.Add(userPipelineCols); } else { GetUserPipelineColumnsInfo(ref userPipelineCols); UserPipelineColsManager.Update(userPipelineCols); } if (null == userProspectCols) { userProspectCols = new Model.UserProspectColumns(); userProspectCols.UserId = CurrUser.iUserID; GetUserProspectColumnsInfo(ref userProspectCols); UserProspectColsManager.Add(userProspectCols); } else { GetUserProspectColumnsInfo(ref userProspectCols); UserProspectColsManager.Update(userProspectCols); } if (null == userHomePref) { userHomePref = new Model.UserHomePref(); userHomePref.UserId = CurrUser.iUserID; GetUserHomePrefInfo(ref userHomePref); UserHomePrefManager.Add(userHomePref); } else { GetUserHomePrefInfo(ref userHomePref); UserHomePrefManager.Update(userHomePref); } ClientFun("sucsmsg", "alert('Saved!');"); } catch (Exception ex) { PageCommon.AlertMsg(this, "Failed to save user personalization preferences info, reason:" + ex.Message); LPLog.LogMessage(LogType.Logerror, "Failed to save user personalization preferences info: " + ex.Message); return; } }
private List <string> ShowColumnsForClients() { BLL.UserProspectColumns upcBll = new UserProspectColumns(); Model.UserProspectColumns model = upcBll.GetModel(this.CurrUser.iUserID); List <string> ShowColumnsList = new List <string>(); #region ShowColumns ShowColumnsList.Add("Client"); if (model.LastCompletedStage) { ShowColumnsList.Add("LastCompletedStage"); } if (model.LastStageComplDate) { ShowColumnsList.Add("LastStageComplDate"); } #region MyRegion //if (model.Lv_Amount) //{ // ShowColumnsList.Add("Amount"); //} //if (model.Lv_Branch) //{ // ShowColumnsList.Add("Branch"); //} //if (model.Lv_Estclose) //{ // ShowColumnsList.Add("Estclose)"); //} //if (model.Lv_Leadsource) //{ // ShowColumnsList.Add("Leadsource"); //} //if (model.Lv_Lien) //{ // ShowColumnsList.Add("Lien"); //} //if (model.Lv_Loanofficer) //{ // ShowColumnsList.Add("Loan officer"); //} //if (model.Lv_Loanprogram) //{ // ShowColumnsList.Add("program"); //} //if (model.Lv_Partner) //{ // ShowColumnsList.Add("Partner"); //} //if (model.Lv_Pointfilename) //{ // ShowColumnsList.Add("filename"); //} //if (model.Lv_Progress) //{ // ShowColumnsList.Add("Progress"); //} //if (model.Lv_Ranking) //{ // ShowColumnsList.Add("Ranking"); //} //if (model.Lv_Rate) //{ // ShowColumnsList.Add("Rate"); //} //if (model.Lv_Refcode) //{ // ShowColumnsList.Add("Refcode"); //} //if (model.Lv_Referral) //{ // ShowColumnsList.Add("Referral"); //} #endregion if (model.Pv_Branch) { ShowColumnsList.Add("Branch"); } if (model.Pv_Created) { ShowColumnsList.Add("Created"); } if (model.Pv_Leadsource) { ShowColumnsList.Add("Leadsource"); } if (model.Pv_Loanofficer) // pv 与 lv 区别 有两个 loanofficer { ShowColumnsList.Add("LoanOfficer"); } if (model.Pv_Partner) { ShowColumnsList.Add("Partner"); } if (model.Pv_Progress) { ShowColumnsList.Add("Progress"); } if (model.Pv_Refcode) { ShowColumnsList.Add("Refcode"); } if (model.Pv_Referral) { ShowColumnsList.Add("Referral"); } #endregion return(ShowColumnsList); }
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 btnSave_Click(object sender, EventArgs e) { Model.Users userInfo = UsersManager.GetModel(CurrUser.iUserID); Model.UserPipelineColumns userPipelineCols = UserPipelineColsManager.GetModel(CurrUser.iUserID); Model.UserProspectColumns userProspectCols = UserProspectColsManager.GetModel(CurrUser.iUserID); Model.UserHomePref userHomePref = UserHomePrefManager.GetModel(CurrUser.iUserID); try { if (null == userInfo) { LPLog.LogMessage(LogType.Logerror, string.Format("User Personalization: User with id {0} does not exist.", CurrUser.iUserID)); ClientFun("unknowerrmsg2", "ShowMsg('unknowerror');"); return; } if (!GetUserInfo(ref userInfo)) { ClientFun("invalidinputmsg", "ShowMsg('invalidInput');"); return; } UsersManager.Update(userInfo); if (null == userPipelineCols) { userPipelineCols = new Model.UserPipelineColumns(); userPipelineCols.UserId = CurrUser.iUserID; GetUserPipelineColumnsInfo(ref userPipelineCols); UserPipelineColsManager.Add(userPipelineCols); } else { GetUserPipelineColumnsInfo(ref userPipelineCols); UserPipelineColsManager.Update(userPipelineCols); } if (null == userProspectCols) { userProspectCols = new Model.UserProspectColumns(); userProspectCols.UserId = CurrUser.iUserID; GetUserProspectColumnsInfo(ref userProspectCols); UserProspectColsManager.Add(userProspectCols); } else { GetUserProspectColumnsInfo(ref userProspectCols); UserProspectColsManager.Update(userProspectCols); } if (null == userHomePref) { userHomePref = new Model.UserHomePref(); userHomePref.UserId = CurrUser.iUserID; GetUserHomePrefInfo(ref userHomePref); UserHomePrefManager.Add(userHomePref); } else { GetUserHomePrefInfo(ref userHomePref); UserHomePrefManager.Update(userHomePref); } if (!string.IsNullOrEmpty(this.tbPWD.Text)) { try { ServiceManager sm = new ServiceManager(); using (LP2ServiceClient service = sm.StartServiceClient()) { ReqHdr hdr; UpdateADUserRequest uReq = new UpdateADUserRequest(); hdr = new ReqHdr(); hdr.UserId = CurrUser.iUserID; uReq.hdr = hdr; uReq.Command = UserMgrCommandType.ChangePassword; uReq.AD_OU_Filter = this.hiPrefix.Value; uReq.AD_User = new LP_Service.User(); uReq.AD_User.Password = this.tbPWD.Text; uReq.AD_User.Username = this.hiUsername.Value; uReq.AD_User.Firstname = this.hiFirstName.Value; uReq.AD_User.Lastname = this.hiLastName.Value; uReq.AD_User.Email = this.lbEmail.Text; UpdateADUserResponse uResponse; uResponse = service.UpdateADUser(uReq); if (!uResponse.hdr.Successful) { PageCommon.AlertMsg(this, "Failed to change password in AD, error info: " + uResponse.hdr.StatusInfo); LPLog.LogMessage(LogType.Logerror, "Failed to change password in AD, username="******"Failed to change password in AD, reason: User Manager is not running."); return; } catch (Exception ex) { PageCommon.AlertMsg(this, "Failed to change password in AD, exception info: " + ex.Message); LPLog.LogMessage(LogType.Logerror, "Failed to change password in AD, username="******", Exception:" + ex.Message); return; } } ClientFun("sucsmsg", "ShowMsg('savesuccess');"); } catch (Exception ex) { PageCommon.AlertMsg(this, "Failed to save user personalization info, reason:" + ex.Message); LPLog.LogMessage(LogType.Logerror, "Failed to save user personalization info: " + ex.Message); return; } }