public ActionResult Comments() { CommentsViewModel model = new CommentsViewModel(); model.Comments = this.BlogConfiguration.CommentSettings.MapTo<CommentsConfigurationBinder>(); return this.View(model); }
public ActionResult Comments(CommentsConfigurationBinder comments) { if (!ModelState.IsValid) { CommentsViewModel model = new CommentsViewModel(); model.Comments = comments; } try { var configuration = this.BlogConfiguration; configuration.CommentSettings = comments.MapTo<CommentSettingsDto>(); this.ConfigurationService.SaveOrUpdateConfiguration(configuration); return this.urlBuilder.Admin.FeedbackPage(FeedbackType.Positive, "Configuration Saved", this.urlBuilder.Admin.EditSeoConfiguration()).Redirect(); } catch (DexterException e) { this.Logger.ErrorFormat("Unable to save the specified category", e); return this.urlBuilder.Admin.FeedbackPage(FeedbackType.Negative, "Configuration Not Saved", this.urlBuilder.Admin.EditSeoConfiguration()).Redirect(); } }