Example #1
0
 public ActionResult Register()
 {
     RegisterViewModel ViewModel = new RegisterViewModel()
     {
         Title = "注册",
         MasterViewModel = this.MasterViewModel
     };
     return this.Result(ViewModel);
 }
Example #2
0
        public ActionResult Register(RegisterModel model)
        {
            IAccountContract ac = Actor.Public.AsAccountManager();
            IUserContract uc = Actor.Public.AsUserManager();
            BzureUser user = new BzureUser(uc.GenerateUserID (), model.UserName)
            {
                EMail = model.Email,
                Password = ac.EncryptPassword(model.Password),
                RoleValue = 0,
                OpenID = string.Empty,
                State = 0,
                NickName = model.UserName
            };
            CreateUserResult result = ac.CreateUser(user);
            if (result == CreateUserResult.Success)
            {
                user.SignIn(false);//登录

                return Redirect("/");
            }
            else
            {
                RegisterViewModel ViewModel = new RegisterViewModel()
                {
                    Title = "注册",
                    Message = result.StringValue(),
                    MasterViewModel = this.MasterViewModel
                };
                return this.Result(ViewModel);

            }

        }