Beispiel #1
0
 /// <summary>
 /// 更新用户
 /// </summary>
 /// <param name="cInfo">实体</param>
 public void Update(UserInfo cInfo)
 {
     if (string.IsNullOrEmpty(cInfo.ID))
     {
         throw new ArgumentNullException("参数ID不能为空。");
     }
     dal.Update(cInfo);
 }
Beispiel #2
0
        /// <summary>
        /// 添加用户
        /// </summary>
        /// <param name="ID">实体主键</param>
        /// <returns></returns>
        public void Delete(string ID)
        {
            UserInfo cInfo = new UserInfo();
            cInfo.ID = ID;

            dal.Delete(cInfo);
        }
Beispiel #3
0
        /// <summary>
        /// 更新用户
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="name"></param>
        /// <param name="password"></param>
        /// <param name="departmentID"></param>
        public void Update(string ID, string name, string password, string departmentID)
        {
            if (string.IsNullOrEmpty(ID))
            {
                throw new ArgumentNullException("用户不能为空。");
            }

            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("用户名称不能为空。");
            }
            if (string.IsNullOrEmpty(password))
            {
                throw new ArgumentNullException("用户密码不能为空。");
            }
            if (string.IsNullOrEmpty(departmentID))
            {
                throw new ArgumentNullException("所属部门不能为空。");
            }
            UserInfo cInfo = new UserInfo();
            cInfo.ID = ID;
            cInfo.Name = name;
            cInfo.Password = password;
            cInfo.DepartmentID = departmentID;
            dal.Update(cInfo);
        }
Beispiel #4
0
 /// <summary>
 /// 添加用户
 /// </summary>
 /// <param name="name"></param>
 /// <param name="password"></param>
 /// <param name="departmentID"></param>
 /// <returns>新增实体的主键</returns>
 public string Add(string name, string password, string departmentID)
 {
     if (string.IsNullOrEmpty(name))
     {
         throw new ArgumentNullException("用户名称不能为空。");
     }
     if (string.IsNullOrEmpty(password))
     {
         throw new ArgumentNullException("用户密码不能为空。");
     }
     if (string.IsNullOrEmpty(departmentID))
     {
         throw new ArgumentNullException("所属部门不能为空。");
     }
     UserInfo cInfo = new UserInfo();
     cInfo.Name = name;
     cInfo.Password = password;
     cInfo.DepartmentID = departmentID;
     return dal.Add(cInfo);
 }
Beispiel #5
0
 /// <summary>
 /// 添加用户
 /// </summary>
 /// <param name="cInfo">实体</param>
 /// <returns>新增实体的主键</returns>
 public string Add(UserInfo cInfo)
 {
     return dal.Add(cInfo);
 }
Beispiel #6
0
 /// <summary>
 /// 处理用户未登录,判断当前页是否需要跳转到登录页
 /// </summary>
 /// <returns>True:跳转到登陆页;False:用户已经登录或者无需登录</returns>
 private bool NeedToLogin()
 {
     // 用户是否登录过
     if (string.IsNullOrEmpty(this.UserCacheInfo.GUID))
     {
         // 若用户在默认栏目无权限要求,则不跳转
         if (this.MenuID == DEFAULT_MENUID)
         {
             return false;
         }
         string guid = GetRequest("guid");
         if (string.IsNullOrEmpty(guid))
         {
             // 要求权限并且无凭据
             return true;
         }
         else
         {
             // 要求权限,则通过凭据获取用户信息
             UserInfo uInfo = new BLL.User().GetUserInfoByGuid(guid);
             this.UserCacheInfo = uInfo;
             return false;
         }
     }
     return false;
 }