Beispiel #1
0
        public ActionResult AddUser(User user)
        {
            user.AgreeCode   = UserAgreeCode.Agree.GetEnumCode();
            user.AgreeTime   = DateTime.Now;
            user.AgreeUserID = user.CreatorUserId;
            user.SecretKey   = Md5.md5(CommonUtility.CreateNo(), 16).ToLower();
            user.Passsword   = Md5.md5(DESEncrypt.Encrypt(Md5.md5(user.Passsword, 32).ToLower(), user.SecretKey).ToLower(), 32).ToLower();
            var ret = userApp.AddUser(user);

            if (ret == 1)
            {
                return(Success("添加成功。"));
            }
            else
            {
                return(Error("添加失败"));
            }
        }