예제 #1
0
        public ActionResult Configuration()
        {
            BlogConfigurationViewModel model = new BlogConfigurationViewModel();

            model.BlogConfiguration = this.BlogConfiguration.MapTo <BlogConfigurationBinder>();
            model.TimesZones        = TimeZoneInfo.GetSystemTimeZones();

            return(this.View(model));
        }
예제 #2
0
        public ActionResult Configuration(BlogConfigurationBinder blogConfiguration)
        {
            if (!ModelState.IsValid)
            {
                BlogConfigurationViewModel model = new BlogConfigurationViewModel();
                model.TimesZones        = TimeZoneInfo.GetSystemTimeZones();
                model.BlogConfiguration = blogConfiguration;
            }

            try
            {
                BlogConfigurationDto currentConfiguration = this.BlogConfiguration;
                BlogConfigurationDto configuration        = this.BlogConfiguration.MapPropertiesToInstance <BlogConfigurationDto>(currentConfiguration);

                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());
            }
        }