Пример #1
0
        public MembershipCreateStatus Register(RegisterModel model)
        {
            MembershipCreateStatus createStatus;

            Membership.CreateUser(model.UserName, model.Password, model.Email, null, null, true, null, out createStatus);
            using (var ctx = new YakinikuClubDbContext())
            {
                var memberRepository = new MemberRepository(ctx);
                memberRepository.AddMember(model);
                ctx.SaveChanges();
            }
            return(createStatus);
        }
Пример #2
0
 public ActionResult Register(
     [ModelBinder(typeof(ManagementViewModelBinder))] ClubActivityViewModel data)
 {
     if (ModelState.IsValid)
     {
         using (var ctx = new YakinikuClubDbContext())
         {
             var repos = new ClubActivityRepository(ctx);
             repos.AddClubActivity(data);
             ctx.SaveChanges();
         }
         return(RedirectToAction("Index", "Home"));
     }
     return(RedirectToAction("Index", "Management"));
 }