public ActionResult GlobalConfiguration(BackEndGlobalConfigurationEdit backEndGlobalConfigurationEdit) { GlobalConfigurations backEndGlobalConfigurations = new GlobalConfigurations(); GlobalConfiguration globalConfiguration = backEndGlobalConfigurations.GetGlobalConfiguration(); int?result = backEndGlobalConfigurations.Edit( backEndGlobalConfigurationEdit.SiteName, backEndGlobalConfigurationEdit.MetaTitle, backEndGlobalConfigurationEdit.MetaKeywords, backEndGlobalConfigurationEdit.MetaDescription, backEndGlobalConfigurationEdit.Robots, backEndGlobalConfigurationEdit.NotificationEmail, backEndGlobalConfigurationEdit.IsCanonicalizeActive, backEndGlobalConfigurationEdit.HostNameLabel, backEndGlobalConfigurationEdit.DomainName, backEndGlobalConfigurationEdit.BingVerificationCode, backEndGlobalConfigurationEdit.GoogleVerificationCode, backEndGlobalConfigurationEdit.GoogleAnalyticsTrackingCode, backEndGlobalConfigurationEdit.GoogleSearchCode, backEndGlobalConfigurationEdit.IsOffline, backEndGlobalConfigurationEdit.OfflineCode, backEndGlobalConfigurationEdit.ServerTimeZone, backEndGlobalConfigurationEdit.DateFormat, backEndGlobalConfigurationEdit.TimeFormat, backEndGlobalConfigurationEdit.DefaultLanguageCode, backEndGlobalConfigurationEdit.DefaultErrorPageTemplateId, backEndGlobalConfigurationEdit.WhiteList); switch (result) { case 0: if (globalConfiguration.HostNameLabel != backEndGlobalConfigurationEdit.HostNameLabel) { //Updates RouteTable using (RouteTable.Routes.GetWriteLock()) { RouteTable.Routes.Clear(); RouteConfig.RegisterRoutes(RouteTable.Routes); } } ModelState.AddResult(ViewData, ModelStateResult.Success, Resources.Strings.ItemSuccessfullyEdited); break; case 2: ModelState.AddResult(ViewData, ModelStateResult.Error, Resources.Strings.ItemDoesNotExist); ViewData.IsFormVisible(false); break; default: ModelState.AddResult(ViewData, ModelStateResult.Error, Resources.Strings.UnexpectedError); break; } return(View(backEndGlobalConfigurationEdit)); }
public ActionResult GlobalConfiguration() { BackEndGlobalConfigurationEdit backEndGlobalConfigurationEdit = new BackEndGlobalConfigurationEdit(); GlobalConfigurations backEndGlobalConfigurations = new GlobalConfigurations(); GlobalConfiguration globalConfiguration = backEndGlobalConfigurations.GetGlobalConfiguration(); if (globalConfiguration.IsNotNull()) { backEndGlobalConfigurationEdit.SiteName = globalConfiguration.SiteName; backEndGlobalConfigurationEdit.MetaTitle = globalConfiguration.MetaTitle; backEndGlobalConfigurationEdit.MetaKeywords = globalConfiguration.MetaKeywords; backEndGlobalConfigurationEdit.MetaDescription = globalConfiguration.MetaDescription; backEndGlobalConfigurationEdit.Robots = globalConfiguration.Robots; backEndGlobalConfigurationEdit.NotificationEmail = globalConfiguration.NotificationEmail; backEndGlobalConfigurationEdit.IsCanonicalizeActive = globalConfiguration.IsCanonicalizeActive; backEndGlobalConfigurationEdit.HostNameLabel = globalConfiguration.HostNameLabel; backEndGlobalConfigurationEdit.DomainName = globalConfiguration.DomainName; backEndGlobalConfigurationEdit.BingVerificationCode = globalConfiguration.BingVerificationCode; backEndGlobalConfigurationEdit.GoogleVerificationCode = globalConfiguration.GoogleVerificationCode; backEndGlobalConfigurationEdit.GoogleAnalyticsTrackingCode = globalConfiguration.GoogleAnalyticsTrackingCode; backEndGlobalConfigurationEdit.GoogleSearchCode = globalConfiguration.GoogleSearchCode; backEndGlobalConfigurationEdit.IsOffline = globalConfiguration.IsOffline; backEndGlobalConfigurationEdit.OfflineCode = globalConfiguration.OfflineCode; backEndGlobalConfigurationEdit.ServerTimeZone = globalConfiguration.ServerTimeZone; backEndGlobalConfigurationEdit.DateFormat = globalConfiguration.DateFormat; backEndGlobalConfigurationEdit.TimeFormat = globalConfiguration.TimeFormat; backEndGlobalConfigurationEdit.DefaultLanguageCode = globalConfiguration.DefaultLanguageCode; backEndGlobalConfigurationEdit.DefaultErrorPageTemplateId = globalConfiguration.DefaultErrorPageTemplateId; backEndGlobalConfigurationEdit.WhiteList = globalConfiguration.WhiteList; } else { ModelState.AddResult(ViewData, ModelStateResult.Error, Resources.Strings.ItemDoesNotExist); ViewData.IsFormVisible(false); } return(View(backEndGlobalConfigurationEdit)); }