public PortalIdentity(UserInfo user) : base(user.UserID.ToString()) { if (user == null) { throw new ArgumentNullException(@"用户对象不能为空"); } _user = user; }
protected UserInfo GetUserInfo() { if (_user == null && HttpContext.Current.User.Identity.IsAuthenticated) { int userId = 0; System.Int32.TryParse(HttpContext.Current.User.Identity.Name, out userId); this._user = UserBLL.GetInfo(userId); } return this._user; }
/// <summary> /// EC成员登录 /// </summary> /// <param name="userName">EC成员用户名</param> /// <param name="pwd">密码</param> /// <param name="eccodeOrDomain">EC编码或域名</param> /// <returns></returns> public static int UserLogon(string userName, string pwd) { int userID = UserDAL.UserLogon(userName, pwd); UserInfo user = new UserInfo(); user.UserID = userID; return userID; }
/// <summary> /// 往UserInfo表内添加新记录 /// </summary> /// <param name="entity">UserInfo实体对象</param> /// <returns>添加记录索引值</returns> public static void Insert(UserInfo entity) { UserDAL.Insert(entity); //ActionLogBLL.LogAdd(OperationLogType.Add, User, "BLL.UserInfoBLL.UserBLL", identity, "UserInfo", "添加成功"); //return identity; }
/// <summary> /// 更新UserInfo表记录 /// </summary> /// <param name="entity">UserInfo实体对象</param> public void Update(UserInfo entity) { try { UserDAL.Update(entity); //ActionLogBLL.LogAdd(OperationLogType.Update, User, "BLL.UserInfoBLL.UserBLL", entity.UserID, "UserInfo", "修改成功"); } catch (Exception ex) { //Logger.LogError("UserBLL", "Update", AppError.EROR, 0, ex, "更新UserInfo信息出错。",String.Format("UserID = {0}", entity.UserID)); //throw new WebApplication3SystemException(ERROR_CODE_UPDATE, ex); } }