public ActionResult TermsAndConditions() { using (UnitOfWorkManager.NewUnitOfWork()) { var settings = SettingsService.GetSettings(); var viewModel = new TermsAndConditionsViewModel { Agree = false, TermsAndConditions = settings.TermsAndConditions }; return View(viewModel); } }
public ActionResult TermsAndConditions(TermsAndConditionsViewModel viewmodel) { using (var unitOfWork = UnitOfWorkManager.NewUnitOfWork()) { if (ModelState.IsValid) { var user = MembershipService.GetUser(LoggedOnReadOnlyUser.Id); user.HasAgreedToTermsAndConditions = viewmodel.Agree; try { unitOfWork.Commit(); } catch (Exception ex) { unitOfWork.Rollback(); LoggingService.Error(ex); } return RedirectToAction("Index"); } } return View(viewmodel); }