public ActionResult Application() { ManageAppModel model = new ManageAppModel(); Settings app = SettingsComp.GetSettings(); model.BlogName = app.Name; model.PostCount = app.PostCount; model.CommentModeration = app.CommentModeration; model.Timezone = app.Timezone; this.ViewData.Model = model; return this.View(); }
public ActionResult Application(ManageAppModel model) { if (this.ModelState.IsValid) { Settings app = SettingsComp.GetSettings(); app.Name = model.BlogName; app.PostCount = model.PostCount; app.CommentModeration = model.CommentModeration; app.Timezone = model.Timezone; SettingsComp.Save(app); this.ViewData["SuccessMessage"] = "配置信息已更新"; } this.ViewData.Model = model; return this.View(); }