Beispiel #1
0
        public ActionResult Credits(CreditsConfigViewModel model)
        {
            if (ModelState.IsValid)
            {
                _creditsConfig = WebConfigurationManager.OpenWebConfiguration("~").GetSection("CreditsConfig") as CreditsConfig;
                _creditsConfig.Register = model.Register;
                _creditsConfig.Login = model.Login;
                _creditsConfig.Booking = model.Booking;
                _creditsConfig.Recharge = model.Recharge;
                _creditsConfig.CurrentConfiguration.Save();

                return RedirectToAction("Credits");
            }
            return View(model);
        }
Beispiel #2
0
 public ActionResult Credits()
 {
     _creditsConfig = WebConfigurationManager.OpenWebConfiguration("~").GetSection("CreditsConfig") as CreditsConfig;
     return View(new CreditsConfigViewModel
     {
         Register = _creditsConfig.Register,
         Login = _creditsConfig.Login,
         Booking = _creditsConfig.Booking,
         Recharge = _creditsConfig.Recharge
     });
 }