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; } }
protected void Page_Load(object sender, EventArgs e) { if (Request.HttpMethod.ToLower() == "post") { UserLogin(); return; } if (Request["returnurl "] != "") { this.ReturnUrl = Request["returnurl"]; } if (Session["userInfo"] != null) { Response.Redirect("/UserInfoManager/UserCenter.aspx"); return; } if (Request.Cookies["cp1"] != null) { String name = Request.Cookies["cp1"].Value; Model.Users model = UserService.GetModel(name); if (Common.WebHelper.CheckCookie(model)) { Response.Redirect("/UserInfoManager/UserCenter.aspx"); } } }
private void ShowInfo(int Id) { Maticsoft.BLL.News bll = new Maticsoft.BLL.News(); Maticsoft.Model.News model = bll.GetModel(Id); this.lblName.Text = model.Name; BLL.NewsType BLLNewsType = new BLL.NewsType(); Model.NewsType ModelNewsType = BLLNewsType.GetModel((int)model.Fk_NewsType_Id); this.lblContents.Text = model.Contents; BLL.Users BLLUsers = new BLL.Users(); Model.Users ModelUsers = BLLUsers.GetModel((int)model.Fk_Users_Id); this.lblFk_Users_Id.Text = ModelUsers.Name; this.lblAddTime.Text = model.AddTime.ToString(); if (Session["LoginUser"] == null) { lblUser.Text = "匿名"; } else { BLL.Users bllleaveuser = new BLL.Users(); Model.Users modelleaveuser = bllleaveuser.GetModel((int)Session["LoginUser"]); lblUser.Text = modelleaveuser.TrueName; } }
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { Repeater Repeater2 = e.Item.FindControl("Repeater2") as Repeater; Label lblId = e.Item.FindControl("lblId") as Label; //BLL.Nodes nodes = new BLL.Nodes(); //List<Model.Nodes> list = nodes.GetModelList("ParentId='" + lblId.Text + "' and IsVisible='True'").OrderBy(p => p.Orders).ToList(); BLL.Users users = new BLL.Users(); Model.Users user = users.GetModel((int)Session["UsersId"]); BLL.Roles roles = new BLL.Roles(); Model.Roles role = roles.GetModel(user.Fk_Roles_Id.Value); BLL.PermisssionsNodes permisssionsNodes = new BLL.PermisssionsNodes(); List <Model.PermisssionsNodes> permisssionsNodesList = permisssionsNodes.GetModelList("Fk_Permissions_Id='" + role.Fk_Permissions_Id + "'"); List <Model.Nodes> nodes = new List <Model.Nodes>(); foreach (Model.PermisssionsNodes pn in permisssionsNodesList) { BLL.Nodes nodesBLL = new BLL.Nodes(); Model.Nodes node = nodesBLL.GetModel(pn.Fk_Nodes_Id.Value); if (node != null) { if (node.ParentId == int.Parse(lblId.Text) && node.IsVisible == true) { nodes.Add(node); } } } Repeater2.DataSource = nodes.OrderBy(p => p.Orders).ToList(); Repeater2.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UsersId"] != null) { BLL.Users users = new BLL.Users(); Model.Users user = users.GetModel((int)Session["UsersId"]); BLL.Roles roles = new BLL.Roles(); Model.Roles role = roles.GetModel(user.Fk_Roles_Id.Value); BLL.PermisssionsNodes permisssionsNodes = new BLL.PermisssionsNodes(); List <Model.PermisssionsNodes> permisssionsNodesList = permisssionsNodes.GetModelList("Fk_Permissions_Id='" + role.Fk_Permissions_Id + "'"); List <Model.Nodes> nodes = new List <Model.Nodes>(); foreach (Model.PermisssionsNodes pn in permisssionsNodesList) { BLL.Nodes nodesBLL = new BLL.Nodes(); Model.Nodes node = nodesBLL.GetModel(pn.Fk_Nodes_Id.Value); if (node != null) { if (node.ParentId == 0 && node.IsVisible == true) { nodes.Add(node); } } } Repeater1.DataSource = nodes.OrderBy(p => p.Orders).ToList(); Repeater1.DataBind(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["UsersId"] != null) { int UsersId = (int)Session["UsersId"]; BLL.Users users = new BLL.Users(); lblUsersId.Text = users.GetModel(UsersId).TrueName; } } }
private void ShowInfo(int Id) { Maticsoft.BLL.Reply bll = new Maticsoft.BLL.Reply(); Maticsoft.Model.Reply model = bll.GetModel(Id); this.lblId.Text = model.Id.ToString(); BLL.Leaveword BLLLeaveword = new BLL.Leaveword(); Model.Leaveword ModelLeaveword = BLLLeaveword.GetModel((int)model.Fk_Leaveword_Id); this.lblFk_Leaveword_Id.Text = ModelLeaveword.Id.ToString(); this.lblContents.Text = model.Contents; BLL.Users BLLUsers = new BLL.Users(); Model.Users ModelUsers = BLLUsers.GetModel((int)model.Fk_Users_Id); this.lblFk_Users_Id.Text = ModelUsers.Name; this.lblAddTimes.Text = model.AddTimes.ToString(); }
private void ShowInfo(int Id) { Maticsoft.BLL.News bll = new Maticsoft.BLL.News(); Maticsoft.Model.News model = bll.GetModel(Id); this.lblId.Text = model.Id.ToString(); this.lblName.Text = model.Name; BLL.NewsType BLLNewsType = new BLL.NewsType(); Model.NewsType ModelNewsType = BLLNewsType.GetModel((int)model.Fk_NewsType_Id); this.lblFk_NewsType_Id.Text = ModelNewsType.Name; this.lblContents.Text = model.Contents; BLL.Users BLLUsers = new BLL.Users(); Model.Users ModelUsers = BLLUsers.GetModel((int)model.Fk_Users_Id); this.lblFk_Users_Id.Text = ModelUsers.Name; this.lblAddTime.Text = model.AddTime.ToString(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["LoginUser"] == null) { tr1.Visible = true; tr2.Visible = false; } else { tr1.Visible = false; tr2.Visible = true; BLL.Users bll = new BLL.Users(); lblUsersName.Text = bll.GetModel((int)Session["LoginUser"]).TrueName; } }
protected void rptList_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Label lblleaveusername = e.Item.FindControl("lblleaveusername") as Label; string userid = lblleaveusername.Text; if (userid == "-1") { lblleaveusername.Text = "匿名"; } else { BLL.Users bll = new BLL.Users(); lblleaveusername.Text = bll.GetModel(int.Parse(lblleaveusername.Text)).TrueName; } } }
private void BindUserInfo() { if (UserId.HasValue) { 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 { tbUserName.Text = user.Username; tbFirstName.Text = user.FirstName; tbLastName.Text = user.LastName; } } }
/// <summary> /// Load prospect detail info /// </summary> private void LoadProspectData() { LPWeb.Model.Prospect prospectModel = new Model.Prospect(); try { //prospect detail info prospectModel = this.prospectMgr.GetModel(iProspectID); BLL.Contacts contactMgr = new BLL.Contacts(); LPWeb.Model.Contacts contactModel = contactMgr.GetModel(prospectModel.Contactid); this.lbProspect.Text = contactModel.LastName + ", " + contactModel.FirstName + " " + contactModel.MiddleName; this.lbSSN.Text = (contactModel.SSN.Length > 7 ? "xxx-xx-" + contactModel.SSN.Substring(7) : contactModel.SSN); if (contactModel.DOB != null && Convert.ToDateTime(contactModel.DOB).Year != 1900) { this.lbDOB.Text = Convert.ToDateTime(contactModel.DOB).ToString("MM/dd/yyyy"); } this.lbAddress.Text = contactModel.MailingAddr + ", " + contactModel.MailingCity + ", " + contactModel.MailingState + ", " + contactModel.MailingZip; BLL.Users userMgr = new BLL.Users(); if (prospectModel.Loanofficer != null) { Model.Users userModel = userMgr.GetModel(Convert.ToInt32(prospectModel.Loanofficer)); if (userModel != null) { this.lbLoanOfficer.Text = userModel.LastName + ", " + userModel.FirstName; } } //search info if (this.Request.QueryString["Type"] == null) { if (contactModel.LastName.Trim() != "") { this.tbxBrwLastName.Text = contactModel.LastName; } if (contactModel.FirstName.Trim() != "") { this.tbxBrwFirstName.Text = contactModel.FirstName; } } } catch (Exception ex) { throw ex; } }
protected void Page_Load(object sender, EventArgs e) { if (UserId.HasValue) { BLL.Users UsersManager = new BLL.Users(); Model.Users user = UsersManager.GetModel(UserId.Value); if (null != user && null != user.UserPictureFile) { Response.BinaryWrite(user.UserPictureFile); } else { ResponseDefaultPicture(); } } else { ResponseDefaultPicture(); } Response.End(); }
protected void Page_Load(object sender, EventArgs e) { if (UserId.HasValue) { BLL.Users UsersManager = new BLL.Users(); Model.Users user = UsersManager.GetModel(UserId.Value); //style="width:77px; height:77px" /> int iWidth = 77; int iHeight = 77; if (null != user && null != user.UserPictureFile) { Bitmap _Bitmap = new Bitmap(iWidth, iHeight); Graphics _Graphcis = Graphics.FromImage(_Bitmap); _Graphcis.DrawImage(System.Drawing.Image.FromStream(new MemoryStream(user.UserPictureFile)), 0, 0, iWidth, iHeight); _Graphcis.Dispose(); MemoryStream ms = new MemoryStream(); _Bitmap.Save(ms, ImageFormat.Png); ms.Flush(); byte[] bData = ms.GetBuffer(); ms.Close(); //Response.BinaryWrite(user.UserPictureFile); Response.BinaryWrite(bData); } else { ResponseDefaultPicture(); } } else { ResponseDefaultPicture(); } Response.End(); }
protected void Page_Load(object sender, EventArgs e) { #region 个人信息 if (Request.Cookies["VideoNetcookieLogin"] != null) { modelUsers = bllUsers.GetModel(Request.Cookies["VideoNetcookieLogin"]["UserAccount"]); modelPlayRight = bllPlayRight.GetModel(modelUsers.UserAccount); Account = modelUsers.UserAccount; Name = modelUsers.UserName; ExpireTime = modelPlayRight.ExpireTime; WatchRecord = modelPlayRight.WatchRecord; HeadPortrait = modelPlayRight.HeadPortrait; hidAccount.Value = modelUsers.UserAccount; hidImg.Value = modelPlayRight.HeadPortrait; return; } if (Session["userInfo"] != null) { modelUsers = (Model.Users)Session["userInfo"]; modelPlayRight = bllPlayRight.GetModel(modelUsers.UserAccount); Account = modelUsers.UserAccount; Name = modelUsers.UserName; ExpireTime = modelPlayRight.ExpireTime; WatchRecord = modelPlayRight.WatchRecord; HeadPortrait = modelPlayRight.HeadPortrait; hidImg.Value = modelPlayRight.HeadPortrait; hidAccount.Value = modelUsers.UserAccount; return; } Name = "未登录"; Account = "未登录"; ExpireTime = DateTime.Now; HeadPortrait = "b614d3bf0d897dd651f1b937b957ac8a.jpg"; WatchRecord = null; hidAccount.Value = null; #endregion }
private void CheckUserCookie() { if (Request.Cookies["cp1"] != null && Request.Cookies["cp2"] != null) { string userName = Request.Cookies["cp1"].Value; string cookiePwd = Request.Cookies["cp2"].Value; BLL.Users bll = new BLL.Users(); Model.Users user = bll.GetModel(userName); if (user != null) { string dataPass = MD5Pwd(user.LoginPwd); if (cookiePwd == dataPass) { Session["userInfo"] = user; GoPage("登陆成功"); } else { Response.Cookies["cp1"].Expires = DateTime.Now.AddDays(-1); Response.Cookies["cp2"].Expires = DateTime.Now.AddDays(-1); } } } }
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; } } }
public void ProcessRequest(HttpContext context) { string action = context.Request["action"]; switch (action) { case "newUserName": #region 修改名称 if (string.IsNullOrEmpty(context.Request["newNickName"].Trim())) { context.Response.Write("no:不能为空"); return; } if (bllUsers.GetModel(context.Request["newNickName"].Trim()) != null) { context.Response.Write("no:昵称已被占用"); return; } if (bllSensitiveLexicon.WordPattern(context.Request["newNickName"].Trim())) { context.Response.Write("no:敏感词"); return; } modelUsers = bllUsers.ExGetModel(context.Request["pastNickname"].Trim()); modelUsers.UserName = context.Request["newNickName"]; if (bllUsers.Update(modelUsers)) { context.Response.Write("ok:完成"); } else { context.Response.Write("no:更改失败"); } break; #endregion case "APPUserName": if (string.IsNullOrEmpty(context.Request["newNickName"].Trim())) { context.Response.Write("0"); return; } if (bllUsers.GetModel(context.Request["newNickName"].Trim()) != null) { context.Response.Write("0"); return; } if (bllSensitiveLexicon.WordPattern(context.Request["newNickName"].Trim())) { context.Response.Write("0"); return; } modelUsers = bllUsers.ExGetModel(context.Request["pastNickname"].Trim()); modelUsers.UserName = context.Request["newNickName"]; if (bllUsers.Update(modelUsers)) { context.Response.Write("1"); } else { context.Response.Write("0"); } break; case "NetName": try { BLL.Config bllConfig = new BLL.Config(); context.Response.Write(fastJSON.JSON.Instance.ToJSON(bllConfig.ExGetConfigValue("网站名称"))); } catch (Exception ex) { context.Response.Write("0"); } break; default: context.Response.Write("错误!13"); break; } }
public void ProcessRequest(HttpContext context) { action = context.Request["action"]; string reg = @"^[A-Za-z\d]+([-_.][A-Za-zd]+)*@([A-Za-z\d]+[-_.])+[A-Za-z\d]{2,5}$"; switch (action) { case "OKVerify": if (string.IsNullOrEmpty(context.Request["UserAccount"].Trim())) { context.Response.Write("onAccount:*账户不能为空"); return; } if (string.IsNullOrEmpty(context.Request["UserMail"].Trim())) { context.Response.Write("onMail:*邮箱不能为空"); return; } if (!Regex.IsMatch(context.Request["UserMail"].Trim(), reg)) { context.Response.Write("onMail:*输入有效的邮箱"); return; } if (string.IsNullOrEmpty(context.Request["Code"].Trim())) { context.Response.Write("onCode:*验证不能为空"); return; } if (string.IsNullOrEmpty(context.Request["ResetUserPassWord"].Trim())) { context.Response.Write("onWord:*密码不能为空"); return; } if ((string)context.Session["numberCode"] != common.MD5(common.MD5(context.Request["Code"]))) { context.Response.Write("onCode:*验证码不正确"); return; } if (!bllUsers.ExAccount(context.Request["UserAccount"])) { context.Response.Write("onAccount:*没有次用户"); return; } modelUsers = bllUsers.GetModel(context.Request["UserAccount"]); modelUsers.UserPassWord = common.MD5(common.MD5(context.Request["ResetUserPassWord"])); if (bllUsers.Update(modelUsers)) { context.Response.Write("okUrl:/Login.aspx"); } break; case "APPwrod": try { if (!Regex.IsMatch(context.Request["UserMail"].Trim(), reg)) { context.Response.Write("0"); return; } if (!bllUsers.ExAccount(context.Request["UserAccount"])) { context.Response.Write("2"); return; } modelUsers = bllUsers.GetModel(context.Request["UserAccount"]); modelUsers.UserPassWord = common.MD5(common.MD5(context.Request["ResetUserPassWord"])); if (bllUsers.Update(modelUsers)) { context.Response.Write("1"); } } catch (Exception ex) { context.Response.Write("0"); } break; case "NetName": try { BLL.Config bllConfig = new BLL.Config(); context.Response.Write(JsonConvert.SerializeObject(bllConfig.ExGetConfigValue("网站名称"))); } catch (Exception ex) { context.Response.Write("0"); } break; case "sendCode": #region 邮箱发送 string number = ""; System.Random random = new Random(); for (int i = 0; i < 5; i++) { number += (random.Next() % 10); } context.Session["numberCode"] = common.MD5(common.MD5(number)); if (bllUsers.SendCode(context.Request["UserMail"], number)) { context.Response.Write("ok"); } else { context.Response.Write("on"); } break; #endregion default: context.Response.Redirect("/Error.aspx?webPage=忘记页"); break; } }
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(); } }
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"); } }
public void ProcessRequest(HttpContext context) { BLL.Users bllUser = new BLL.Users(); Model.Users modelUsers = new Model.Users(); string UserAccount = context.Request["UserAccount"]; string UserPassWord = common.MD5(common.MD5(common.SQLFilter(context.Request["UserPassWord"]))); action = context.Request["action"]; switch (action) { case "xxx": //此处没有在ajax中发送数据如需要用请在js中调用 int UserChckbox = Convert.ToInt32(context.Request["checkboxid"]); Code = context.Session["vCode"] != null ? context.Session["vCode"].ToString() : ""; modelUsers = bllUser.GetModel(UserAccount); if (Code == common.SQLFilter(context.Request["Code"])) { if (bllUser.CheckUserInfo(UserAccount, UserPassWord, out modelUsers)) { if (modelUsers.UsersState == 1) { context.Session["userInfo"] = modelUsers; if (UserChckbox == 1) { //将登录的用户存在cookie中 cookie.Expires = DateTime.Now.AddDays(7); cookie.Values.Add("UserAccount", UserAccount); cookie.Values.Add("UserPassWord", UserPassWord); context.Response.AppendCookie(cookie); } context.Response.Write("/HomePage.aspx"); } else { context.Response.Write("no:用户被锁定和用户异常请联系站长QQ1300646029发送账号"); } } else { context.Response.Write("no:没有此用户和以注销请联系站长QQ1300646029发送我要账号附带邮箱"); } } else { context.Response.Write("no:请先输入正确的验证码和请点击验证码刷新验证码"); } break; case "APP": try { if (bllUser.CheckUserInfo(UserAccount, UserPassWord, out modelUsers)) { if (modelUsers.UsersState == 1) { Model.PlayRight modelPlayRight = new Model.PlayRight(); BLL.PlayRight bllPlayRight = new BLL.PlayRight(); modelPlayRight = bllPlayRight.GetModel(modelUsers.UserAccount); context.Response.Write(fastJSON.JSON.Instance.ToJSON(modelUsers.UserName + "," + modelUsers.UserAccount + "," + modelPlayRight.HeadPortrait)); } else { context.Response.Write("0"); } } } catch (Exception ex) { context.Response.Write("0"); } break; case "NetName": try { BLL.Config bllConfig = new BLL.Config(); context.Response.Write(fastJSON.JSON.Instance.ToJSON(bllConfig.ExGetConfigValue("网站名称"))); } catch (Exception ex) { context.Response.Write("0"); } break; default: context.Response.Write("0"); break; } }
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 lbtnDelete_Click(object sender, EventArgs e) { Dictionary <int, int> dicIDs = new Dictionary <int, int>(); // Get userid of current selected row foreach (GridViewRow row in gridUserList.Rows) { if (DataControlRowType.DataRow == row.RowType) { CheckBox ckbChecked = row.FindControl("ckbSelected") as CheckBox; if (null != ckbChecked && ckbChecked.Checked) { dicIDs.Add(row.RowIndex, (int)gridUserList.DataKeys[row.RowIndex].Value); originalUserId = (int)gridUserList.DataKeys[row.RowIndex].Value; } } } if (dicIDs.Count > 0) { ReassignProspect(originalUserId); try { // get all loans assigned to this user, dicIDs must have only one item in this case DataSet dsUserLoan = LoanTeamManager.GetUserLoan(dicIDs.FirstOrDefault().Value); int nReassignUserId = 0; if (!int.TryParse(this.hiReassignUserId.Value, out nReassignUserId)) { nReassignUserId = 0; } if (null != dsUserLoan && dsUserLoan.Tables.Count > 0 && dsUserLoan.Tables[0].Rows.Count > 0) { ServiceManager sm1 = new ServiceManager(); using (LP2ServiceClient service = sm1.StartServiceClient()) { ReassignLoanRequest req = new ReassignLoanRequest(); req.hdr = new ReqHdr(); req.hdr.SecurityToken = "SecurityToken"; //todo:check dummy data req.hdr.UserId = CurrUser.iUserID; List <ReassignUserInfo> uList = new List <ReassignUserInfo>(); Model.Users userToDelete = UsersManager.GetModel(dicIDs.FirstOrDefault().Value); ReassignUserInfo uInfo = null; foreach (DataRow drUserLoan in dsUserLoan.Tables[0].Rows) { uInfo = new ReassignUserInfo(); uInfo.FileId = int.Parse(string.Format("{0}", drUserLoan["FileId"])); uInfo.RoleId = int.Parse(string.Format("{0}", drUserLoan["RoleId"])); uInfo.NewUserId = nReassignUserId; uList.Add(uInfo); } req.reassignUsers = uList.ToArray(); ReassignLoanResponse respone = null; try { respone = service.ReassignLoan(req); if (respone.hdr.Successful) { bool st = true; int fileId = 0; int newUserId = 0; int roleId = 0; int requester = req.hdr.UserId; foreach (ReassignUserInfo u in req.reassignUsers) { fileId = u.FileId; newUserId = u.NewUserId; roleId = u.RoleId; st = LPWeb.BLL.WorkflowManager.ReassignLoan(fileId, newUserId, originalUserId, roleId, requester); } UsersManager.DeleteUsers(dicIDs.Select(i => i.Value).ToList(), CurrUser.iUserID, nReassignUserId); } else { // PageCommon.WriteJsEnd(this, string.Format("Failed to reassign loan, reason:{0}.", respone.hdr.StatusInfo), PageCommon.Js_RefreshSelf); // return; } } catch (System.ServiceModel.EndpointNotFoundException ex) { LPLog.LogMessage(ex.Message); // PageCommon.WriteJsEnd(this, "Failed to reassign loan, reason: Point Manager is not running.", PageCommon.Js_RefreshSelf); } catch (Exception exception) { LPLog.LogMessage(exception.Message); // PageCommon.WriteJsEnd(this, string.Format("Failed to reassign loan, reason:{0}.", exception.Message), PageCommon.Js_RefreshSelf); } } } else { UsersManager.DeleteUsers(dicIDs.Select(i => i.Value).ToList(), CurrUser.iUserID, nReassignUserId); } BindGrid(); } catch (Exception ex) { ClientFun(this.updatePanel, "failedtodeleteuserinad", "alert('Failed to delete the selected user account(s), please try it again.');"); //PageCommon.AlertMsg(this, "Failed to delete the selected users, please try it again."); LPLog.LogMessage(LogType.Logerror, "Failed to delete the selected user account(s): " + ex.Message); return; } try { UpdateAD(dicIDs, UserMgrCommandType.DeleteUser); } catch (Exception ex) { ClientFun(this.updatePanel, "failed to delete user in ad", string.Format("alert('Failed to delete the selected user account(s) in AD, Exception: {0}');", ex.Message.Replace("'", "\""))); //PageCommon.AlertMsg(this, "Failed to delete the selected user account in AD."); LPLog.LogMessage(LogType.Logerror, "Failed to delete the selected user account(s), exception: " + ex.Message); return; } } }