コード例 #1
0
        public ActionResult TermsAndConditions()
        {
            var model = new TermsAndConditionsViewModel();
            T_PRT_APP_SETTINGS_CUSTOM cust = _DbPortal.GetT_PRT_APP_SETTINGS_CUSTOM();

            model.TermsAndConditions = cust.TERMS_AND_CONDITIONS;

            return(View(model));
        }
コード例 #2
0
        public virtual ActionResult TermsAndConditions()
        {
            var settings  = SettingsService.GetSettings();
            var viewModel = new TermsAndConditionsViewModel
            {
                Agree = false,
                TermsAndConditions = settings.TermsAndConditions
            };

            return(View(viewModel));
        }
コード例 #3
0
        protected override void OnViewModelSet()
        {
            base.OnViewModelSet();
            _model = (TermsAndConditionsViewModel)ViewModel;

            var cvf = new TermsAndConditionsFragment
            {
                ViewModel = ViewModel
            };

            Show(cvf, true);
        }
コード例 #4
0
 public ActionResult TermsAndConditions()
 {
     using (UnitOfWorkManager.NewUnitOfWork())
     {
         var settings  = SettingsService.GetSettings();
         var viewModel = new TermsAndConditionsViewModel
         {
             Agree = false,
             TermsAndConditions = settings.TermsAndConditions
         };
         return(View(viewModel));
     }
 }
コード例 #5
0
        public ActionResult TermsAndConditions()
        {
            TermsAndConditionsViewModel model = new TermsAndConditionsViewModel();

            using (FreeMarketEntities db = new FreeMarketEntities())
            {
                SiteConfiguration temp = db.SiteConfigurations
                                         .Where(c => c.Key == "TermsAndConditions")
                                         .FirstOrDefault();

                if (temp != null)
                {
                    model.Content = temp.Value;
                }
            }

            return(View("TermsAndConditions", model));
        }
コード例 #6
0
        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));
        }
コード例 #7
0
        public virtual ActionResult TermsAndConditions(TermsAndConditionsViewModel viewmodel)
        {
            if (ModelState.IsValid)
            {
                User.GetMembershipUser(MembershipService);

                var user = MembershipService.GetUser(LoggedOnReadOnlyUser?.Id);
                user.HasAgreedToTermsAndConditions = viewmodel.Agree;
                try
                {
                    Context.SaveChanges();
                }
                catch (Exception ex)
                {
                    Context.RollBack();
                    LoggingService.Error(ex);
                }
                return(RedirectToAction("Index"));
            }


            return(View(viewmodel));
        }
コード例 #8
0
        public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);

            _model = (TermsAndConditionsViewModel)ViewModel;
        }
コード例 #9
0
ファイル: HomeController.cs プロジェクト: lenwen/mvcforum
        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);
        }
コード例 #10
0
ファイル: HomeController.cs プロジェクト: lenwen/mvcforum
 public ActionResult TermsAndConditions()
 {
     using (UnitOfWorkManager.NewUnitOfWork())
     {
         var settings = SettingsService.GetSettings();
         var viewModel = new TermsAndConditionsViewModel
         {
             Agree = false,
             TermsAndConditions = settings.TermsAndConditions
         };
         return View(viewModel);
     }
 }