예제 #1
0
 public CreateUserParams(CreatePersonViewModel user, bool isApproved)
 {
     _username = user.Username;
     _password = user.Password;
     _email = user.Email;
     _isApproved = isApproved;
 }
예제 #2
0
 public ActionResult Init()
 {
     if (QueryBuilder.For<Person>().Query().Any())
     {
         throw new HttpException(404, CoreStrings.Error404);
     }
     var model = new CreatePersonViewModel() {Email = "*****@*****.**", Password = "******", Username = "******"};
     var user = membership.CreateUser(new CreateUserParams(model, true));
     if (user == null)
     {
         ModelState.AddModelError("Authentication", CoreStrings.AuthenticationError);
         RedirectToAction("LogOn");
     }
     AuthenticationService.SignIn(user, true);
     UnitOfWork.Save(user);
     UnitOfWork.Commit();
     return RedirectToAction("LogOn");
 }