/// <summary> /// 当前登录用户分公司Number /// </summary> /// <returns></returns> public string GetUserCompanyNumber() { if (User.Identity.IsAuthenticated) { return(Panda_UserInfoDal.Get(GetIdentityName())["FCompanyNumber"].ToString()); } return(String.Empty); }
/// <summary> /// 当前登录用户客户名 /// </summary> /// <returns></returns> public string GetUserCustomerName() { if (User.Identity.IsAuthenticated) { return(Panda_UserInfoDal.Get(GetIdentityName())["CustomerName"].ToString()); } return(String.Empty); }
private void LoadData() { HttpCookie cookie = null; // 从Cookie中读取 - 左侧菜单类型 cookie = Request.Cookies["MenuStyle_Mvc"]; if (cookie != null) { _cookieMenuStyle = cookie.Value; } // 从Cookie中读取 - 显示模式 cookie = Request.Cookies["MenuMode_Mvc"]; if (cookie != null) { _cookieMenuMode = cookie.Value; } // 从Cookie中读取 - 语言 cookie = Request.Cookies["Language_Mvc"]; if (cookie != null) { _cookieLang = cookie.Value; } // 从Cookie中读取 - 搜索文本 cookie = Request.Cookies["SearchText_Mvc"]; if (cookie != null) { _cookieSearchText = HttpUtility.UrlDecode(cookie.Value); } ViewBag.LoginName = Panda_UserInfoDal.Get(GetIdentityName())["UserName"].ToString(); ViewBag.CookieMenuStyle = _cookieMenuStyle; ViewBag.CookieShowOnlyBase = _cookieShowOnlyBase; ViewBag.CookieIsBase = Constants.IS_BASE; ViewBag.CookieMenuMode = _cookieMenuMode; ViewBag.CookieLang = _cookieLang; ViewBag.CookieSearchText = _cookieSearchText; ViewBag.ProductVersion = "v" + GlobalConfig.ProductVersion; ViewBag.OnlineUserCount = 1; LoadTreeMenuData(); // 加载完树菜单数据后,计算标题栏文本 if (_cookieShowOnlyBase) { ViewBag.TreeMenuTitle = String.Format("系统导航({0})", _examplesCount); } else { ViewBag.TreeMenuTitle = String.Format("系统导航({0})", _examplesCount); } LoadTopTree(); }
/// <summary> /// 动作方法调用之前执行 /// </summary> /// <param name="filterContext"></param> protected override void OnActionExecuting(ActionExecutingContext filterContext) { base.OnActionExecuting(filterContext); // 如果用户已经登录,更新在线记录 if (User.Identity.IsAuthenticated) { Hashtable has = Panda_UserInfoDal.Get(GetIdentityName()); if (has != null) { UpdateOnlineUser(); } } }
/// <summary> /// 当前登录用户泵房组 /// </summary> /// <returns></returns> public string GetUserPumpGroup() { string pumpList = string.Empty; if (User.Identity.IsAuthenticated) { string group = Panda_UserInfoDal.Get(GetIdentityName())["UserPumpGroup"].ToString(); DataTable dt = Panda_PGroupDal.SearchGroupPump(" and a.GroupID='" + group + "'"); for (int i = 0; i < dt.Rows.Count; i++) { pumpList = pumpList + "'" + dt.Rows[i]["PumpID"] + "',"; } return(pumpList.Substring(0, pumpList.LastIndexOf(','))); } return(String.Empty); }
public ActionResult btnSave_OnClick() { // 检查当前密码是否正确 string oldPass = Request["tbxOldPassword"]; string newPass = Request["tbxNewPassword"]; string confirmNewPass = Request["tbxConfirmNewPassword"]; if (newPass != confirmNewPass) { UIHelper.TextBox("tbxConfirmNewPassword").MarkInvalid("确认密码和新密码不一致!"); } if (!PasswordUtil.ComparePasswords(Panda_UserInfoDal.Get(GetIdentityName())["UserPwd"].ToString(), oldPass)) { UIHelper.TextBox("tbxOldPassword").MarkInvalid("当前密码不正确!"); } try { //string userGH = GetIdentityName(); //User users = db.users.Where(x => x.Name.Equals(userGH)).FirstOrDefault(); //users.Password = PasswordUtil.CreateDbPassword(newPass); //db.SaveChanges(); Hashtable hasData = new Hashtable(); hasData["ID"] = GetIdentityName(); hasData["UserPwd"] = PasswordUtil.CreateDbPassword(newPass); Panda_UserInfoDal.Update(hasData); ShowNotify("修改密码成功!"); } catch { ShowNotify("修改密码失败,请重新操作!"); } return(UIHelper.Result()); }