Beispiel #1
0
 public async Task<ActionResult> Settings(SiteSettingsModel model)
 {
     var siteModel = new SiteModel(MaintDbContext.SystemSettings);
     model.FromEntity(siteModel, true, ControllerContext);
     if (!TryUpdateModel(siteModel, model))
     {
         return Template(model.CreateTemplate(ControllerContext));
     }
     var db = MaintDbContext;
     siteModel.Save(db);
     await db.SaveChangesAsync();
     MaintDomainService.ClearSystemSettingsCache();
     await SetFlashAsync(new FlashMessage
     {
         Text = MaintCultureTextResources.SuccessToSave,
         MessageType = FlashMessageType.Success,
     });
     return Settings();
 }
Beispiel #2
0
 public ActionResult Settings()
 {
     SiteSettingsModel model = new SiteSettingsModel();
     model.FromEntity(new SiteModel(MaintDbContext.SystemSettings), false, ControllerContext);
     return Template(model.CreateTemplate(ControllerContext));
 }