Example #1
0
 public ActionResult Modify()
 {
     var model = new SettingModel();
     model.CompanyName = _config.CompanyName;
     model.Owner = _config.Owner;
     return View(model);
 }
Example #2
0
 public ActionResult Modify(SettingModel model)
 {
     if (ModelState.IsValid)
     {
         _config.CompanyName = model.CompanyName;
         _config.Owner = model.Owner;
         _configuration.Save();
         return RedirectToAction("Index");
     }
     return View(model);
 }