Beispiel #1
0
        public static bool ActivateStoreFrontConfigOnly(this SystemAdminBaseController controller, int storeConfigId)
        {
            StoreFrontConfiguration config = controller.GStoreDb.StoreFrontConfigurations.FindById(storeConfigId);

            if (config == null)
            {
                controller.AddUserMessage("Activate Store Config Failed!", "Store Config not found by id: " + storeConfigId, AppHtmlHelpers.UserMessageType.Danger);
                return(false);
            }

            if (config.IsActiveDirect())
            {
                controller.AddUserMessage("Store Config is already active.", "Store Config is already active. id: " + storeConfigId, AppHtmlHelpers.UserMessageType.Info);
                return(false);
            }

            config.IsPending        = false;
            config.StartDateTimeUtc = DateTime.UtcNow.AddMinutes(-1);
            config.EndDateTimeUtc   = DateTime.UtcNow.AddYears(100);
            config = controller.GStoreDb.StoreFrontConfigurations.Update(config);
            controller.GStoreDb.SaveChanges();
            controller.AddUserMessage("Activated Store Config", "Activated Store Config '" + config.ConfigurationName + "' [" + config.StoreFrontConfigurationId + "] for Store Front: '" + config.Name.ToHtml() + "' [" + config.StoreFrontId + "]" + " - Client '" + config.Client.Name.ToHtml() + "' [" + config.Client.ClientId + "]", AppHtmlHelpers.UserMessageType.Info);

            return(true);
        }
Beispiel #2
0
        /// <summary>
        /// Returns true if store front and client (parent record) are both active
        /// </summary>
        /// <param name="storeFront"></param>
        /// <returns></returns>
        public static bool IsActiveBubble(this StoreFrontConfiguration storeFrontConfig)
        {
            if (storeFrontConfig == null)
            {
                throw new ArgumentNullException("storeFrontConfig");
            }

            return(storeFrontConfig.IsActiveDirect() && storeFrontConfig.StoreFront.IsActiveBubble());
        }
        // GET: SystemAdmin/SystemAdmin
        public ActionResult Index(int?clientId, int?storeFrontId)
        {
            UserProfile profile = CurrentUserProfileOrNull;

            if (profile != null && !Session.SystemAdminVisitLogged())
            {
                profile.LastSystemAdminVisitDateTimeUtc = DateTime.UtcNow;
                GStoreDb.UserProfiles.Update(profile);
                GStoreDb.SaveChangesDirect();
                Session.SystemAdminVisitLogged(true);
            }

            bool hasErrorMessage = false;
            StoreFrontConfiguration storeFrontConfig = null;

            try
            {
                storeFrontConfig = GStoreDb.GetCurrentStoreFrontConfig(Request, true, false);
            }
            catch (GStoreData.Exceptions.StoreFrontInactiveException exSFI)
            {
                hasErrorMessage = true;
                StoreFrontConfiguration config = exSFI.StoreFront.CurrentConfigOrAny();
                if (config == null)
                {
                    string sfiMessageHtml = "Store Front is inactive for this URL.\n"
                                            + "\nStore Front Id: " + exSFI.StoreFront.StoreFrontId + " has no configuration defined."
                                            + "\n<a href=\"" + this.Url.Action("CreateConfig", "StoreFrontSysAdmin", new { id = exSFI.StoreFront.StoreFrontId }) + "\">Click here to Create a Default Configuration for Store Front Id: " + exSFI.StoreFront.StoreFrontId.ToString().ToHtml() + " [" + exSFI.StoreFront.StoreFrontId + "]" + "</a>\n"
                                            + exSFI.Message.ToHtml();
                    AddUserMessageBottom("Error getting current storefront: Inactive", sfiMessageHtml, UserMessageType.Danger);
                }
                else if (!config.IsActiveDirect())
                {
                    string configName     = config.Name;
                    string sfiMessageHtml = "Store Front is inactive for this Url.\n"
                                            + "\nStore Front '" + config.Name.ToHtml() + "' [" + config.StoreFrontId + "] has an Inactive configuration."
                                            + "\n<a href=\"" + this.Url.Action("ActivateConfig", "StoreFrontSysAdmin", new { id = config.StoreFrontConfigurationId }) + "\">Click here to Activate the inactive Configuration for Store Front " + configName.ToHtml() + " [" + config.StoreFrontId + "]" + "</a>\n"
                                            + exSFI.Message.ToHtml();
                    AddUserMessageBottom("Error getting current storefront: Inactive", sfiMessageHtml, UserMessageType.Danger);
                }
                else
                {
                    string configName     = config == null ? "No Store Front Config found for Store Front Id: " + exSFI.StoreFront.StoreFrontId : config.Name;
                    string sfiMessageHtml = "StoreFront is inactive.\n"
                                            + "<a href=\"" + this.Url.Action("ActivateCurrentInactiveStoreFront") + "\">Click here to Activate StoreFront: " + configName.ToHtml() + " [" + exSFI.StoreFront.StoreFrontId + "]" + "</a>\n"
                                            + exSFI.Message.ToHtml();
                    AddUserMessageBottom("Error getting current storefront: Inactive", sfiMessageHtml, UserMessageType.Danger);
                }
            }
            catch (GStoreData.Exceptions.NoMatchingBindingException exNMB)
            {
                hasErrorMessage = true;
                if (GStoreDb.Clients.IsEmpty())
                {
                    string nosfMessage = "There are no No Clients in the database.\n"
                                         + "<a href=\"" + this.Url.Action("ForceSeed") + "\">Click here to Create Force a Seed of the Database</a>\n"
                                         + "\n<a href=\"" + this.Url.Action("Create", "ClientSysAdmin") + "\">Click here to Create a new Client</a>\n"
                                         + exNMB.Message.ToHtml();
                    AddUserMessageBottom("Error getting current storefront: No matching bindings", nosfMessage, UserMessageType.Danger);
                }
                else if (GStoreDb.StoreFronts.IsEmpty())
                {
                    string nosfMessage = "There are no No Store Fronts in the database.\n"
                                         + "<a href=\"" + this.Url.Action("ForceSeed") + "\">Click here to Create Force a Seed of the Database</a>\n"
                                         + "\n<a href=\"" + this.Url.Action("Create", "StoreFrontSysAdmin") + "\">Click here to Create a new Store Front</a>\n"
                                         + exNMB.Message.ToHtml();
                    AddUserMessageBottom("Error getting current storefront: No matching bindings", nosfMessage, UserMessageType.Danger);
                }
                else
                {
                    StoreFrontConfiguration guessStoreFrontConfig = GStoreDb.SeedAutoMapStoreFrontConfigBestGuess();
                    StoreFront firstStoreFront = GStoreDb.StoreFronts.All().FirstOrDefault();
                    if (firstStoreFront == null)
                    {
                        string nmbMessageHtml = "No store fronts where found in the database.\n"
                                                + "\n<a href=\"" + this.Url.Action("Create", "StoreFrontSysAdmin") + "\">Click here to Create a a Store Front</a>\n"
                                                + exNMB.Message.ToHtml();
                        AddUserMessageBottom("Error getting current storefront: No matching bindings", nmbMessageHtml, UserMessageType.Danger);
                    }
                    else if (guessStoreFrontConfig == null)
                    {
                        string nmbMessageHtml = "No store front configurations where found in the database.\n"
                                                + "\n<a href=\"" + this.Url.Action("CreateConfig", "StoreFrontSysAdmin", new { id = firstStoreFront.StoreFrontId }) + "\">Click here to Create a Default Configuration for Store Front Id: " + firstStoreFront.StoreFrontId.ToString().ToHtml() + " [" + firstStoreFront.StoreFrontId + "]" + "</a>\n"
                                                + exNMB.Message.ToHtml();
                        AddUserMessageBottom("Error getting current storefront: No matching bindings", nmbMessageHtml, UserMessageType.Danger);
                    }
                    else if (!guessStoreFrontConfig.IsActiveDirect())
                    {
                        string configName     = guessStoreFrontConfig.Name;
                        string nmbMessageHtml = "No store front found for this Url.\n"
                                                + "\nThe best guess store front '" + guessStoreFrontConfig.Name.ToHtml() + "' [" + guessStoreFrontConfig.StoreFrontConfigurationId + "] has an Inactive configuration."
                                                + "\n<a href=\"" + this.Url.Action("ActivateConfig", "StoreFrontSysAdmin", new { id = guessStoreFrontConfig.StoreFrontConfigurationId }) + "\">Click here to Activate the inactive Configuration for Store Front " + configName.ToHtml() + " [" + guessStoreFrontConfig.StoreFrontId + "]" + "</a>\n"
                                                + exNMB.Message.ToHtml();
                        AddUserMessageBottom("Error getting current storefront: No matching bindings", nmbMessageHtml, UserMessageType.Danger);
                    }
                    else
                    {
                        string configName     = guessStoreFrontConfig.Name;
                        string nmbMessageHtml = "No store front found for this Url.\n"
                                                + "<a href=\"" + this.Url.Action("BindSeedBestGuessStoreFront") + "\">Click here to Create Store Binding for Store Front : " + configName.ToHtml() + " [" + guessStoreFrontConfig.StoreFrontId + "]" + "</a>\n"
                                                + exNMB.Message.ToHtml();
                        AddUserMessageBottom("Error getting current storefront: No matching bindings", nmbMessageHtml, UserMessageType.Danger);
                    }
                }
            }
            catch (Exception ex)
            {
                hasErrorMessage = true;
                string exMessageHtml = ex.Message.ToHtml() + "\n" + ex.ToString().ToHtml();
                AddUserMessageBottom("Error getting current storefront: unknown error", exMessageHtml, UserMessageType.Danger);
            }

            if (hasErrorMessage)
            {
                AddUserMessage("Errors found!!", "Errors were found in the system configuration for the current URL. See bottom of this page for details or <a href=\"#UserMessagesBottom\">click here<a/>", UserMessageType.Danger);
            }

            ViewBag.StoreFrontFilterList = StoreFrontFilterListWithAllAndNull(clientId, storeFrontId);

            this.BreadCrumbsFunc = ((html => this.TopBreadcrumb(html, false)));
            return(View("Index"));
        }
        public StoreFrontConfigAdminViewModel(StoreFrontConfiguration storeFrontConfig, UserProfile userProfile, string activeTab, bool isCreatePage, bool isDeletePage)
            : base(storeFrontConfig, userProfile)
        {
            this.ActiveTab = activeTab;
            this.IsCreatePage = isCreatePage;
            this.IsDeletePage = isDeletePage;
            this.StoreFrontId = storeFrontConfig.StoreFrontId;
            this.StoreFrontConfigurationId = storeFrontConfig.StoreFrontConfigurationId;
            this.AccountAdmin = storeFrontConfig.AccountAdmin;
            this.AccountAdmin_UserProfileId = storeFrontConfig.AccountAdmin_UserProfileId;
            this.AccountTheme = storeFrontConfig.AccountTheme;
            this.AccountThemeId = storeFrontConfig.AccountThemeId;
            this.AccountLoginRegisterLinkText = storeFrontConfig.AccountLoginRegisterLinkText;
            this.AccountLoginShowRegisterLink = storeFrontConfig.AccountLoginShowRegisterLink;
            this.AdminTheme = storeFrontConfig.AdminTheme;
            this.AdminThemeId = storeFrontConfig.AdminThemeId;
            this.CartTheme = storeFrontConfig.CartTheme;
            this.CartThemeId = storeFrontConfig.CartThemeId;
            this.CheckoutTheme = storeFrontConfig.CheckoutTheme;
            this.CheckoutThemeId = storeFrontConfig.CheckoutThemeId;
            this.CheckoutOrderMinimum = storeFrontConfig.CheckoutOrderMinimum;

            this.CheckoutLogInOrGuestWebFormId = storeFrontConfig.CheckoutLogInOrGuestWebFormId;
            this.CheckoutLogInOrGuestWebForm = storeFrontConfig.CheckoutLogInOrGuestWebForm;
            this.CheckoutDeliveryInfoDigitalOnlyWebFormId = storeFrontConfig.CheckoutDeliveryInfoDigitalOnlyWebFormId;
            this.CheckoutDeliveryInfoDigitalOnlyWebForm = storeFrontConfig.CheckoutDeliveryInfoDigitalOnlyWebForm;
            this.CheckoutDeliveryInfoShippingWebFormId = storeFrontConfig.CheckoutDeliveryInfoShippingWebFormId;
            this.CheckoutDeliveryInfoShippingWebForm = storeFrontConfig.CheckoutDeliveryInfoShippingWebForm;
            this.CheckoutDeliveryMethodWebFormId = storeFrontConfig.CheckoutDeliveryMethodWebFormId;
            this.CheckoutDeliveryMethodWebForm = storeFrontConfig.CheckoutDeliveryMethodWebForm;
            this.CheckoutPaymentInfoWebFormId = storeFrontConfig.CheckoutPaymentInfoWebFormId;
            this.CheckoutPaymentInfoWebForm = storeFrontConfig.CheckoutPaymentInfoWebForm;
            this.CheckoutConfirmOrderWebFormId = storeFrontConfig.CheckoutConfirmOrderWebFormId;
            this.CheckoutConfirmOrderWebForm = storeFrontConfig.CheckoutConfirmOrderWebForm;

            this.Orders_AutoAcceptPaid = storeFrontConfig.Orders_AutoAcceptPaid;
            this.PaymentMethod_PayPal_Enabled = storeFrontConfig.PaymentMethod_PayPal_Enabled;
            this.PaymentMethod_PayPal_UseLiveServer = storeFrontConfig.PaymentMethod_PayPal_UseLiveServer;
            this.PaymentMethod_PayPal_Client_Id = storeFrontConfig.PaymentMethod_PayPal_Client_Id;
            this.PaymentMethod_PayPal_Client_Secret = storeFrontConfig.PaymentMethod_PayPal_Client_Secret;

            this.CatalogCategoryColLg = storeFrontConfig.CatalogCategoryColLg;
            this.CatalogCategoryColMd = storeFrontConfig.CatalogCategoryColMd;
            this.CatalogCategoryColSm = storeFrontConfig.CatalogCategoryColSm;
            this.CatalogTheme = storeFrontConfig.CatalogTheme;
            this.CatalogThemeId = storeFrontConfig.CatalogThemeId;
            this.CatalogPageInitialLevels = storeFrontConfig.CatalogPageInitialLevels;
            this.CatalogProductColLg = storeFrontConfig.CatalogProductColLg;
            this.CatalogProductColMd = storeFrontConfig.CatalogProductColMd;
            this.CatalogProductColSm = storeFrontConfig.CatalogProductColSm;
            this.CatalogProductBundleColLg = storeFrontConfig.CatalogProductBundleColLg;
            this.CatalogProductBundleColMd = storeFrontConfig.CatalogProductBundleColMd;
            this.CatalogProductBundleColSm = storeFrontConfig.CatalogProductBundleColSm;
            this.CatalogProductBundleItemColLg = storeFrontConfig.CatalogProductBundleItemColLg;
            this.CatalogProductBundleItemColMd = storeFrontConfig.CatalogProductBundleItemColMd;
            this.CatalogProductBundleItemColSm = storeFrontConfig.CatalogProductBundleItemColSm;

            this.BlogTheme = storeFrontConfig.BlogTheme;
            this.BlogThemeId = storeFrontConfig.BlogThemeId;
            this.BlogAdminTheme = storeFrontConfig.BlogAdminTheme;
            this.BlogAdminThemeId = storeFrontConfig.BlogAdminThemeId;

            this.ChatTheme = storeFrontConfig.ChatTheme;
            this.ChatThemeId = storeFrontConfig.ChatThemeId;
            this.ChatEnabled = storeFrontConfig.ChatEnabled;
            this.ChatRequireLogin = storeFrontConfig.ChatRequireLogin;

            this.CatalogAdminThemeId = storeFrontConfig.CatalogAdminThemeId;
            this.CatalogAdminTheme = storeFrontConfig.CatalogAdminTheme;
            this.DefaultNewPageTheme = storeFrontConfig.DefaultNewPageTheme;
            this.DefaultNewPageThemeId = storeFrontConfig.DefaultNewPageThemeId;
            this.Folder = storeFrontConfig.Folder;
            this.EnableGoogleAnalytics = storeFrontConfig.EnableGoogleAnalytics;
            this.GoogleAnalyticsWebPropertyId = storeFrontConfig.GoogleAnalyticsWebPropertyId;
            this.HtmlFooter = storeFrontConfig.HtmlFooter;
            this.HomePageUseCatalog = storeFrontConfig.HomePageUseCatalog;
            this.HomePageUseBlog = storeFrontConfig.HomePageUseBlog;

            this.ShowBlogInMenu = storeFrontConfig.ShowBlogInMenu;
            this.ShowAboutGStoreMenu = storeFrontConfig.ShowAboutGStoreMenu;
            this.MetaApplicationName = storeFrontConfig.MetaApplicationName;
            this.MetaApplicationTileColor = storeFrontConfig.MetaApplicationTileColor;
            this.MetaDescription = storeFrontConfig.MetaDescription;
            this.MetaKeywords = storeFrontConfig.MetaKeywords;
            this.Order = storeFrontConfig.Order;
            this.OrderAdminThemeId = storeFrontConfig.OrderAdminThemeId;
            this.OrderAdminTheme = storeFrontConfig.OrderAdminTheme;
            this.OrdersThemeId = storeFrontConfig.OrdersThemeId;
            this.OrdersTheme = storeFrontConfig.OrdersTheme;
            this.BodyTopScriptTag = storeFrontConfig.BodyTopScriptTag;
            this.BodyBottomScriptTag = storeFrontConfig.BodyBottomScriptTag;
            this.Name = storeFrontConfig.Name;
            this.TimeZoneId = storeFrontConfig.TimeZoneId;
            this.CatalogTitle = storeFrontConfig.CatalogTitle;

            this.CatalogLayout = storeFrontConfig.CatalogLayout;
            this.CatalogHeaderHtml = storeFrontConfig.CatalogHeaderHtml;
            this.CatalogFooterHtml = storeFrontConfig.CatalogFooterHtml;
            this.CatalogRootListTemplate = storeFrontConfig.CatalogRootListTemplate;
            this.CatalogRootHeaderHtml = storeFrontConfig.CatalogRootHeaderHtml;
            this.CatalogRootFooterHtml = storeFrontConfig.CatalogRootFooterHtml;

            this.CatalogDefaultBottomDescriptionCaption = storeFrontConfig.CatalogDefaultBottomDescriptionCaption;
            this.CatalogDefaultNoProductsMessageHtml = storeFrontConfig.CatalogDefaultNoProductsMessageHtml;
            this.CatalogDefaultProductBundleTypePlural = storeFrontConfig.CatalogDefaultProductBundleTypePlural;
            this.CatalogDefaultProductBundleTypeSingle = storeFrontConfig.CatalogDefaultProductBundleTypeSingle;
            this.CatalogDefaultProductTypePlural = storeFrontConfig.CatalogDefaultProductTypePlural;
            this.CatalogDefaultProductTypeSingle = storeFrontConfig.CatalogDefaultProductTypeSingle;
            this.CatalogDefaultSampleAudioCaption = storeFrontConfig.CatalogDefaultSampleAudioCaption;
            this.CatalogDefaultSampleDownloadCaption = storeFrontConfig.CatalogDefaultSampleDownloadCaption;
            this.CatalogDefaultSampleImageCaption = storeFrontConfig.CatalogDefaultSampleImageCaption;
            this.CatalogDefaultSummaryCaption = storeFrontConfig.CatalogDefaultSummaryCaption;
            this.CatalogDefaultTopDescriptionCaption = storeFrontConfig.CatalogDefaultTopDescriptionCaption;

            this.NavBarCatalogMaxLevels = storeFrontConfig.NavBarCatalogMaxLevels;
            this.NavBarItemsMaxLevels = storeFrontConfig.NavBarItemsMaxLevels;
            this.NavBarRegisterLinkText = storeFrontConfig.NavBarRegisterLinkText;
            this.NavBarShowRegisterLink = storeFrontConfig.NavBarShowRegisterLink;
            this.NotFoundErrorPage = storeFrontConfig.NotFoundErrorPage;
            this.NotFoundError_PageId = storeFrontConfig.NotFoundError_PageId;
            this.NotificationsTheme = storeFrontConfig.NotificationsTheme;
            this.NotificationsThemeId = storeFrontConfig.NotificationsThemeId;
            this.ProfileTheme = storeFrontConfig.ProfileTheme;
            this.ProfileThemeId = storeFrontConfig.ProfileThemeId;
            this.PublicUrl = storeFrontConfig.PublicUrl;
            this.RegisteredNotify = storeFrontConfig.RegisteredNotify;
            this.RegisteredNotify_UserProfileId = storeFrontConfig.RegisteredNotify_UserProfileId;
            this.RegisterSuccessPage = storeFrontConfig.RegisterSuccessPage;
            this.RegisterSuccess_PageId = storeFrontConfig.RegisterSuccess_PageId;
            this.RegisterWebForm = storeFrontConfig.RegisterWebForm;
            this.Register_WebFormId = storeFrontConfig.Register_WebFormId;
            this.StoreErrorPage = storeFrontConfig.StoreErrorPage;
            this.StoreError_PageId = storeFrontConfig.StoreError_PageId;
            this.UseShoppingCart = storeFrontConfig.UseShoppingCart;
            this.CartNavShowCartWhenEmpty = storeFrontConfig.CartNavShowCartWhenEmpty;
            this.CartNavShowCartToAnonymous = storeFrontConfig.CartNavShowCartToAnonymous;
            this.CartNavShowCartToRegistered = storeFrontConfig.CartNavShowCartToRegistered;
            this.CartRequireLogin = storeFrontConfig.CartRequireLogin;

            this.WelcomePerson = storeFrontConfig.WelcomePerson;
            this.WelcomePerson_UserProfileId = storeFrontConfig.WelcomePerson_UserProfileId;
            this.OrderAdmin = storeFrontConfig.OrderAdmin;
            this.OrderAdmin_UserProfileId = storeFrontConfig.OrderAdmin_UserProfileId;

            this.ConfigurationName = storeFrontConfig.ConfigurationName;
            this.IsPending = storeFrontConfig.IsPending;
            this.EndDateTimeUtc = storeFrontConfig.EndDateTimeUtc;
            this.StartDateTimeUtc = storeFrontConfig.StartDateTimeUtc;

            this.ConfigIsActiveDirect = storeFrontConfig.IsActiveDirect();
        }
Beispiel #5
0
        public static bool ActivateStoreFrontClientBindingAndConfig(this SystemAdminBaseController controller, StoreBinding binding)
        {
            if (controller == null)
            {
                throw new NullReferenceException("controller");
            }
            if (binding == null)
            {
                throw new ArgumentNullException("binding");
            }

            if (binding.StoreFront.CurrentConfigOrAny() == null)
            {
                controller.AddUserMessage("Store Front Config Not Found", "No Configuration was found for Store Front Id: " + binding.StoreFrontId, AppHtmlHelpers.UserMessageType.Warning);
                return(false);
            }

            StoreFrontConfiguration config = binding.StoreFront.CurrentConfigOrAny();

            if (!config.IsActiveDirect())
            {
                config.IsPending        = false;
                config.StartDateTimeUtc = DateTime.UtcNow.AddMinutes(-1);
                config.EndDateTimeUtc   = DateTime.UtcNow.AddYears(100);
                config = controller.GStoreDb.StoreFrontConfigurations.Update(config);
                controller.GStoreDb.SaveChanges();
                controller.AddUserMessage("Activated Store Config", "Activated Store Front Configuration '" + config.ConfigurationName.ToHtml() + "' [" + config.StoreFrontConfigurationId + "]", AppHtmlHelpers.UserMessageType.Info);
            }

            if (!binding.IsActiveDirect())
            {
                binding.IsPending        = false;
                binding.StartDateTimeUtc = DateTime.UtcNow.AddMinutes(-1);
                binding.EndDateTimeUtc   = DateTime.UtcNow.AddYears(100);
                controller.GStoreDb.StoreBindings.Update(binding);
                controller.GStoreDb.SaveChanges();
                controller.AddUserMessage("Activated Store Binding", "Activated Store Binding Id: " + binding.StoreBindingId, AppHtmlHelpers.UserMessageType.Info);
            }

            if (!binding.Client.IsActiveDirect())
            {
                Client client = binding.Client;
                client.IsPending        = false;
                client.StartDateTimeUtc = DateTime.UtcNow.AddMinutes(-1);
                client.EndDateTimeUtc   = DateTime.UtcNow.AddYears(100);
                controller.GStoreDb.Clients.Update(client);
                controller.GStoreDb.SaveChanges();
                controller.AddUserMessage("Activated Client", "Activated Client '" + client.Name.ToHtml() + "' [" + client.ClientId + "]", AppHtmlHelpers.UserMessageType.Info);
            }

            if (!binding.StoreFront.IsActiveDirect())
            {
                StoreFront storeFront = binding.StoreFront;
                storeFront.IsPending        = false;
                storeFront.StartDateTimeUtc = DateTime.UtcNow.AddMinutes(-1);
                storeFront.EndDateTimeUtc   = DateTime.UtcNow.AddYears(100);
                controller.GStoreDb.StoreFronts.Update(storeFront);
                controller.GStoreDb.SaveChanges();
                controller.AddUserMessage("Activated Store Front", "Activated Store Front '" + storeFront.CurrentConfig().Name.ToHtml() + "' [" + storeFront.ClientId + "]", AppHtmlHelpers.UserMessageType.Info);
            }

            return(true);
        }
        public StoreFrontConfigAdminViewModel(StoreFrontConfiguration storeFrontConfig, UserProfile userProfile, string activeTab, bool isCreatePage, bool isDeletePage)
            : base(storeFrontConfig, userProfile)
        {
            this.ActiveTab    = activeTab;
            this.IsCreatePage = isCreatePage;
            this.IsDeletePage = isDeletePage;
            this.StoreFrontId = storeFrontConfig.StoreFrontId;
            this.StoreFrontConfigurationId = storeFrontConfig.StoreFrontConfigurationId;
            this.AccountAdmin = storeFrontConfig.AccountAdmin;
            this.AccountAdmin_UserProfileId = storeFrontConfig.AccountAdmin_UserProfileId;
            this.AccountTheme   = storeFrontConfig.AccountTheme;
            this.AccountThemeId = storeFrontConfig.AccountThemeId;
            this.AccountLoginRegisterLinkText = storeFrontConfig.AccountLoginRegisterLinkText;
            this.AccountLoginShowRegisterLink = storeFrontConfig.AccountLoginShowRegisterLink;
            this.AdminTheme           = storeFrontConfig.AdminTheme;
            this.AdminThemeId         = storeFrontConfig.AdminThemeId;
            this.CartTheme            = storeFrontConfig.CartTheme;
            this.CartThemeId          = storeFrontConfig.CartThemeId;
            this.CheckoutTheme        = storeFrontConfig.CheckoutTheme;
            this.CheckoutThemeId      = storeFrontConfig.CheckoutThemeId;
            this.CheckoutOrderMinimum = storeFrontConfig.CheckoutOrderMinimum;

            this.CheckoutLogInOrGuestWebFormId            = storeFrontConfig.CheckoutLogInOrGuestWebFormId;
            this.CheckoutLogInOrGuestWebForm              = storeFrontConfig.CheckoutLogInOrGuestWebForm;
            this.CheckoutDeliveryInfoDigitalOnlyWebFormId = storeFrontConfig.CheckoutDeliveryInfoDigitalOnlyWebFormId;
            this.CheckoutDeliveryInfoDigitalOnlyWebForm   = storeFrontConfig.CheckoutDeliveryInfoDigitalOnlyWebForm;
            this.CheckoutDeliveryInfoShippingWebFormId    = storeFrontConfig.CheckoutDeliveryInfoShippingWebFormId;
            this.CheckoutDeliveryInfoShippingWebForm      = storeFrontConfig.CheckoutDeliveryInfoShippingWebForm;
            this.CheckoutDeliveryMethodWebFormId          = storeFrontConfig.CheckoutDeliveryMethodWebFormId;
            this.CheckoutDeliveryMethodWebForm            = storeFrontConfig.CheckoutDeliveryMethodWebForm;
            this.CheckoutPaymentInfoWebFormId             = storeFrontConfig.CheckoutPaymentInfoWebFormId;
            this.CheckoutPaymentInfoWebForm    = storeFrontConfig.CheckoutPaymentInfoWebForm;
            this.CheckoutConfirmOrderWebFormId = storeFrontConfig.CheckoutConfirmOrderWebFormId;
            this.CheckoutConfirmOrderWebForm   = storeFrontConfig.CheckoutConfirmOrderWebForm;

            this.Orders_AutoAcceptPaid              = storeFrontConfig.Orders_AutoAcceptPaid;
            this.PaymentMethod_PayPal_Enabled       = storeFrontConfig.PaymentMethod_PayPal_Enabled;
            this.PaymentMethod_PayPal_UseLiveServer = storeFrontConfig.PaymentMethod_PayPal_UseLiveServer;
            this.PaymentMethod_PayPal_Client_Id     = storeFrontConfig.PaymentMethod_PayPal_Client_Id;
            this.PaymentMethod_PayPal_Client_Secret = storeFrontConfig.PaymentMethod_PayPal_Client_Secret;

            this.CatalogCategoryColLg          = storeFrontConfig.CatalogCategoryColLg;
            this.CatalogCategoryColMd          = storeFrontConfig.CatalogCategoryColMd;
            this.CatalogCategoryColSm          = storeFrontConfig.CatalogCategoryColSm;
            this.CatalogTheme                  = storeFrontConfig.CatalogTheme;
            this.CatalogThemeId                = storeFrontConfig.CatalogThemeId;
            this.CatalogPageInitialLevels      = storeFrontConfig.CatalogPageInitialLevels;
            this.CatalogProductColLg           = storeFrontConfig.CatalogProductColLg;
            this.CatalogProductColMd           = storeFrontConfig.CatalogProductColMd;
            this.CatalogProductColSm           = storeFrontConfig.CatalogProductColSm;
            this.CatalogProductBundleColLg     = storeFrontConfig.CatalogProductBundleColLg;
            this.CatalogProductBundleColMd     = storeFrontConfig.CatalogProductBundleColMd;
            this.CatalogProductBundleColSm     = storeFrontConfig.CatalogProductBundleColSm;
            this.CatalogProductBundleItemColLg = storeFrontConfig.CatalogProductBundleItemColLg;
            this.CatalogProductBundleItemColMd = storeFrontConfig.CatalogProductBundleItemColMd;
            this.CatalogProductBundleItemColSm = storeFrontConfig.CatalogProductBundleItemColSm;

            this.BlogTheme        = storeFrontConfig.BlogTheme;
            this.BlogThemeId      = storeFrontConfig.BlogThemeId;
            this.BlogAdminTheme   = storeFrontConfig.BlogAdminTheme;
            this.BlogAdminThemeId = storeFrontConfig.BlogAdminThemeId;

            this.ChatTheme        = storeFrontConfig.ChatTheme;
            this.ChatThemeId      = storeFrontConfig.ChatThemeId;
            this.ChatEnabled      = storeFrontConfig.ChatEnabled;
            this.ChatRequireLogin = storeFrontConfig.ChatRequireLogin;

            this.CatalogAdminThemeId   = storeFrontConfig.CatalogAdminThemeId;
            this.CatalogAdminTheme     = storeFrontConfig.CatalogAdminTheme;
            this.DefaultNewPageTheme   = storeFrontConfig.DefaultNewPageTheme;
            this.DefaultNewPageThemeId = storeFrontConfig.DefaultNewPageThemeId;
            this.Folder = storeFrontConfig.Folder;
            this.EnableGoogleAnalytics        = storeFrontConfig.EnableGoogleAnalytics;
            this.GoogleAnalyticsWebPropertyId = storeFrontConfig.GoogleAnalyticsWebPropertyId;
            this.HtmlFooter         = storeFrontConfig.HtmlFooter;
            this.HomePageUseCatalog = storeFrontConfig.HomePageUseCatalog;
            this.HomePageUseBlog    = storeFrontConfig.HomePageUseBlog;

            this.ShowBlogInMenu           = storeFrontConfig.ShowBlogInMenu;
            this.ShowAboutGStoreMenu      = storeFrontConfig.ShowAboutGStoreMenu;
            this.MetaApplicationName      = storeFrontConfig.MetaApplicationName;
            this.MetaApplicationTileColor = storeFrontConfig.MetaApplicationTileColor;
            this.MetaDescription          = storeFrontConfig.MetaDescription;
            this.MetaKeywords             = storeFrontConfig.MetaKeywords;
            this.Order               = storeFrontConfig.Order;
            this.OrderAdminThemeId   = storeFrontConfig.OrderAdminThemeId;
            this.OrderAdminTheme     = storeFrontConfig.OrderAdminTheme;
            this.OrdersThemeId       = storeFrontConfig.OrdersThemeId;
            this.OrdersTheme         = storeFrontConfig.OrdersTheme;
            this.BodyTopScriptTag    = storeFrontConfig.BodyTopScriptTag;
            this.BodyBottomScriptTag = storeFrontConfig.BodyBottomScriptTag;
            this.Name         = storeFrontConfig.Name;
            this.TimeZoneId   = storeFrontConfig.TimeZoneId;
            this.CatalogTitle = storeFrontConfig.CatalogTitle;

            this.CatalogLayout           = storeFrontConfig.CatalogLayout;
            this.CatalogHeaderHtml       = storeFrontConfig.CatalogHeaderHtml;
            this.CatalogFooterHtml       = storeFrontConfig.CatalogFooterHtml;
            this.CatalogRootListTemplate = storeFrontConfig.CatalogRootListTemplate;
            this.CatalogRootHeaderHtml   = storeFrontConfig.CatalogRootHeaderHtml;
            this.CatalogRootFooterHtml   = storeFrontConfig.CatalogRootFooterHtml;

            this.CatalogDefaultBottomDescriptionCaption = storeFrontConfig.CatalogDefaultBottomDescriptionCaption;
            this.CatalogDefaultNoProductsMessageHtml    = storeFrontConfig.CatalogDefaultNoProductsMessageHtml;
            this.CatalogDefaultProductBundleTypePlural  = storeFrontConfig.CatalogDefaultProductBundleTypePlural;
            this.CatalogDefaultProductBundleTypeSingle  = storeFrontConfig.CatalogDefaultProductBundleTypeSingle;
            this.CatalogDefaultProductTypePlural        = storeFrontConfig.CatalogDefaultProductTypePlural;
            this.CatalogDefaultProductTypeSingle        = storeFrontConfig.CatalogDefaultProductTypeSingle;
            this.CatalogDefaultSampleAudioCaption       = storeFrontConfig.CatalogDefaultSampleAudioCaption;
            this.CatalogDefaultSampleDownloadCaption    = storeFrontConfig.CatalogDefaultSampleDownloadCaption;
            this.CatalogDefaultSampleImageCaption       = storeFrontConfig.CatalogDefaultSampleImageCaption;
            this.CatalogDefaultSummaryCaption           = storeFrontConfig.CatalogDefaultSummaryCaption;
            this.CatalogDefaultTopDescriptionCaption    = storeFrontConfig.CatalogDefaultTopDescriptionCaption;

            this.NavBarCatalogMaxLevels = storeFrontConfig.NavBarCatalogMaxLevels;
            this.NavBarItemsMaxLevels   = storeFrontConfig.NavBarItemsMaxLevels;
            this.NavBarRegisterLinkText = storeFrontConfig.NavBarRegisterLinkText;
            this.NavBarShowRegisterLink = storeFrontConfig.NavBarShowRegisterLink;
            this.NotFoundErrorPage      = storeFrontConfig.NotFoundErrorPage;
            this.NotFoundError_PageId   = storeFrontConfig.NotFoundError_PageId;
            this.NotificationsTheme     = storeFrontConfig.NotificationsTheme;
            this.NotificationsThemeId   = storeFrontConfig.NotificationsThemeId;
            this.ProfileTheme           = storeFrontConfig.ProfileTheme;
            this.ProfileThemeId         = storeFrontConfig.ProfileThemeId;
            this.PublicUrl        = storeFrontConfig.PublicUrl;
            this.RegisteredNotify = storeFrontConfig.RegisteredNotify;
            this.RegisteredNotify_UserProfileId = storeFrontConfig.RegisteredNotify_UserProfileId;
            this.RegisterSuccessPage            = storeFrontConfig.RegisterSuccessPage;
            this.RegisterSuccess_PageId         = storeFrontConfig.RegisterSuccess_PageId;
            this.RegisterWebForm             = storeFrontConfig.RegisterWebForm;
            this.Register_WebFormId          = storeFrontConfig.Register_WebFormId;
            this.StoreErrorPage              = storeFrontConfig.StoreErrorPage;
            this.StoreError_PageId           = storeFrontConfig.StoreError_PageId;
            this.UseShoppingCart             = storeFrontConfig.UseShoppingCart;
            this.CartNavShowCartWhenEmpty    = storeFrontConfig.CartNavShowCartWhenEmpty;
            this.CartNavShowCartToAnonymous  = storeFrontConfig.CartNavShowCartToAnonymous;
            this.CartNavShowCartToRegistered = storeFrontConfig.CartNavShowCartToRegistered;
            this.CartRequireLogin            = storeFrontConfig.CartRequireLogin;

            this.WelcomePerson = storeFrontConfig.WelcomePerson;
            this.WelcomePerson_UserProfileId = storeFrontConfig.WelcomePerson_UserProfileId;
            this.OrderAdmin = storeFrontConfig.OrderAdmin;
            this.OrderAdmin_UserProfileId = storeFrontConfig.OrderAdmin_UserProfileId;


            this.ConfigurationName = storeFrontConfig.ConfigurationName;
            this.IsPending         = storeFrontConfig.IsPending;
            this.EndDateTimeUtc    = storeFrontConfig.EndDateTimeUtc;
            this.StartDateTimeUtc  = storeFrontConfig.StartDateTimeUtc;

            this.ConfigIsActiveDirect = storeFrontConfig.IsActiveDirect();
        }