Esempio n. 1
0
        public bool Insert(UserInfoAddDto model)
        {
            Verify(model);

            if (string.IsNullOrEmpty(model.UserPwdText))
            {
                Exception("Insert.UserPwdText", "密码不能为空");
            }

            var info      = model.Clone <UserInfoDto>();
            var nameModel = _userInfoDal.GetByName(info.UserName);

            if (nameModel != null)
            {
                Exception("Insert.UserName", "用户名已存在");
            }

            info.UserPwd = Tools.EncryptDESByUserPwd(info.UserPwdText);
            return(_userInfoDal.Insert(info) > 0);
        }