Ejemplo n.º 1
0
 /// <summary>
 /// Deprecated Method for adding a new object to the tbl_Domains EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTotbl_Domains(tbl_Domains tbl_Domains)
 {
     base.AddObject("tbl_Domains", tbl_Domains);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Create a new tbl_Domains object.
 /// </summary>
 /// <param name="domainID">Initial value of the DomainID property.</param>
 /// <param name="dO_Domain">Initial value of the DO_Domain property.</param>
 /// <param name="dO_HomePageID">Initial value of the DO_HomePageID property.</param>
 /// <param name="dO_DefaultLangID">Initial value of the DO_DefaultLangID property.</param>
 /// <param name="dO_UpdateTwitter">Initial value of the DO_UpdateTwitter property.</param>
 /// <param name="dO_GoogleAnalytics">Initial value of the DO_GoogleAnalytics property.</param>
 /// <param name="dO_PrimaryDomain">Initial value of the DO_PrimaryDomain property.</param>
 /// <param name="dO_ParentID">Initial value of the DO_ParentID property.</param>
 /// <param name="dO_GoogleAnalyticsVisible">Initial value of the DO_GoogleAnalyticsVisible property.</param>
 /// <param name="dO_EnableProductSale">Initial value of the DO_EnableProductSale property.</param>
 /// <param name="dO_EnableEventSale">Initial value of the DO_EnableEventSale property.</param>
 /// <param name="dO_DefaultEventView">Initial value of the DO_DefaultEventView property.</param>
 /// <param name="dO_Deleted">Initial value of the DO_Deleted property.</param>
 /// <param name="dO_EnableMailChimp">Initial value of the DO_EnableMailChimp property.</param>
 /// <param name="dO_EnableCommuniGator">Initial value of the DO_EnableCommuniGator property.</param>
 /// <param name="dO_LanguageID">Initial value of the DO_LanguageID property.</param>
 /// <param name="dO_DevelopmentMode">Initial value of the DO_DevelopmentMode property.</param>
 /// <param name="dO_IsCookieConsentEnabled">Initial value of the DO_IsCookieConsentEnabled property.</param>
 /// <param name="dO_CustomRouteHandler">Initial value of the DO_CustomRouteHandler property.</param>
 public static tbl_Domains Createtbl_Domains(global::System.Int32 domainID, global::System.String dO_Domain, global::System.Int32 dO_HomePageID, global::System.Int32 dO_DefaultLangID, global::System.Boolean dO_UpdateTwitter, global::System.String dO_GoogleAnalytics, global::System.Boolean dO_PrimaryDomain, global::System.Int32 dO_ParentID, global::System.Boolean dO_GoogleAnalyticsVisible, global::System.Boolean dO_EnableProductSale, global::System.Boolean dO_EnableEventSale, global::System.Int32 dO_DefaultEventView, global::System.Boolean dO_Deleted, global::System.Boolean dO_EnableMailChimp, global::System.Boolean dO_EnableCommuniGator, global::System.Int32 dO_LanguageID, global::System.Boolean dO_DevelopmentMode, global::System.Boolean dO_IsCookieConsentEnabled, global::System.Boolean dO_CustomRouteHandler)
 {
     tbl_Domains tbl_Domains = new tbl_Domains();
     tbl_Domains.DomainID = domainID;
     tbl_Domains.DO_Domain = dO_Domain;
     tbl_Domains.DO_HomePageID = dO_HomePageID;
     tbl_Domains.DO_DefaultLangID = dO_DefaultLangID;
     tbl_Domains.DO_UpdateTwitter = dO_UpdateTwitter;
     tbl_Domains.DO_GoogleAnalytics = dO_GoogleAnalytics;
     tbl_Domains.DO_PrimaryDomain = dO_PrimaryDomain;
     tbl_Domains.DO_ParentID = dO_ParentID;
     tbl_Domains.DO_GoogleAnalyticsVisible = dO_GoogleAnalyticsVisible;
     tbl_Domains.DO_EnableProductSale = dO_EnableProductSale;
     tbl_Domains.DO_EnableEventSale = dO_EnableEventSale;
     tbl_Domains.DO_DefaultEventView = dO_DefaultEventView;
     tbl_Domains.DO_Deleted = dO_Deleted;
     tbl_Domains.DO_EnableMailChimp = dO_EnableMailChimp;
     tbl_Domains.DO_EnableCommuniGator = dO_EnableCommuniGator;
     tbl_Domains.DO_LanguageID = dO_LanguageID;
     tbl_Domains.DO_DevelopmentMode = dO_DevelopmentMode;
     tbl_Domains.DO_IsCookieConsentEnabled = dO_IsCookieConsentEnabled;
     tbl_Domains.DO_CustomRouteHandler = dO_CustomRouteHandler;
     return tbl_Domains;
 }
Ejemplo n.º 3
0
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.Clear();
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                name: "Account",
                url: "account",
                defaults: new { controller = "Website", action = "DisplayCustomerAccount" }
            );

            routes.MapRoute(
                name: "AddAddress",
                url: "account/addresses/{id}",
                defaults: new { controller = "Website", action = "Addresses", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "DeleteAddress",
                url: "account/deleteaddress/{addressID}",
                defaults: new { controller = "Website", action = "DeleteAddress", addressID = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "DonateCheckout",
                url: "donate/{type}/{amount}",
                defaults: new { controller = "Website", action = "DonationCheckout" }
            );

            routes.MapRoute(
                name: "GetAddressList",
                url: "shop/checkout/getaddresslist",
                defaults: new { controller = "Website", action = "GetAddressList" }
            );

            routes.MapRoute(
                name: "GetSelectedAddress",
                url: "shop/checkout/getselectedaddress",
                defaults: new { controller = "Website", action = "GetSelectedAddress" }
            );

            routes.MapRoute(
                name: "EditMyDetails",
                url: "account/editmydetails",
                defaults: new { controller = "Website", action = "EditCustomerAccount" }
            );

            routes.MapRoute(
                name: "OrderHistory",
                url: "account/orderhistory",
                defaults: new { controller = "WebSite", action = "OrderHistory" }
            );

            routes.MapRoute(
                name: "Admn",
                url: "admn/{action}/{id}",
                defaults: new { controller = "Admn", action = "Home", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "SagePay",
                url: "sagepay/{action}/{orderID}",
                defaults: new { controller = "SagePay", action = "Home", orderID = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "PayPal",
                url: "paypal/{action}/{orderID}",
                defaults: new { controller = "PayPal", action = "Home", orderID = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "SecureTrading",
                url: "securetrading/{action}/{orderID}",
                defaults: new { controller = "SecureTrading", action = "Home", orderID = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "Stripe",
                url: "stripe/{action}/{orderID}",
                defaults: new { controller = "Stripe", action = "Home", orderID = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "Preview",
                url: "preview",
                defaults: new { controller = "Website", action = "Content" }
            );

            routes.MapRoute(
                name: "Website",
                url: "website/{action}/{id}",
                defaults: new { controller = "Website", action = "Index", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "Search",
                url: "search/{keyword}",
                defaults: new { controller = "Website", action = "Search", keyword = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "Login",
                url: "login",
                defaults: new { controller = "Website", action = "Login" }
            );

            routes.MapRoute(
                name: "Logout",
                url: "logout",
                defaults: new { controller = "Website", action = "Logout" }
            );

            routes.MapRoute(
                name: "Registration",
                url: "registration",
                defaults: new { controller = "Website", action = "Registration" }
            );

            routes.MapRoute(
                name: "PassReminder",
                url: "pass-reminder",
                defaults: new { controller = "Website", action = "ForgottenPassword" }
            );

            routes.MapRoute(
                name: "Basket",
                url: "basket",
                defaults: new { controller = "Website", action = "Basket" }
            );

            routes.MapRoute(
                name: "Checkout",
                url: "checkout",
                defaults: new { controller = "Website", action = "Checkout" }
            );

            routes.MapRoute(
                name: "OrderSummary",
                url: "summaryandpayment",
                defaults: new { controller = "Website", action = "OrderSummary" }
            );

            routes.MapRoute(
                name: "XMLSitemap",
                url: "sitemap.xml",
                defaults: new { controller = "Website", action = "XMLSitemap" }
            );

            routes.MapRoute(
                name: "RegisterConfirmation",
                url: "register-confirmation",
                defaults: new { controller = "Website", action = "RegisterConfirmation" }
            );

            routes.MapRoute(
                name: "RobotsTXT",
                url: "robots.txt",
                defaults: new { controller = "Website", action = "RobotsTXT" }
            );

            var contentService = (IWebContent)DependencyResolver.Current.GetService(typeof(IWebContent));
            var domainService = (IDomain)DependencyResolver.Current.GetService(typeof(IDomain));

            List<tbl_Domains> domains = domainService.GetAllDomains();
            #if DEBUG
            var localhostDomain = domainService.GetDomainByID(SettingsManager.LocalHostDomainID);
            if (localhostDomain == null)
            {
                localhostDomain = new tbl_Domains { DomainID = SettingsManager.LocalHostDomainID };
                domains.Add(localhostDomain);
            }
            string processName = Process.GetCurrentProcess().ProcessName.ToLower();
            bool isRunningInIisExpress = processName.Contains("iisexpress") || processName.Contains("webdev.webserver");
            if (isRunningInIisExpress)
                localhostDomain.DO_Domain = "localhost";
            #endif
            foreach (var domain in domains)
            {

                string newsPath = contentService.GetSitemapUrlByType(SiteMapType.News, domain.DomainID),
                    testimonialsPath = contentService.GetSitemapUrlByType(SiteMapType.Testimonials, domain.DomainID),
                    prodCategoriesPath = contentService.GetSitemapUrlByType(SiteMapType.ProductShop, domain.DomainID),
                    eventCategoriesPath = contentService.GetSitemapUrlByType(SiteMapType.EventShop, domain.DomainID),
                    sitemapPath = contentService.GetSitemapUrlByType(SiteMapType.Sitemap, domain.DomainID),
                    subscribePath = contentService.GetSitemapUrlByType(SiteMapType.Subscribe, domain.DomainID),
                    donationPath = contentService.GetSitemapUrlByType(SiteMapType.Donation, domain.DomainID),
                    poiPath = contentService.GetSitemapUrlByType(SiteMapType.PointsOfInterest, domain.DomainID),
                    portfolioPath = contentService.GetSitemapUrlByType(SiteMapType.Portfolio, domain.DomainID),
                    galleryPath = contentService.GetSitemapUrlByType(SiteMapType.Gallery, domain.DomainID);

                routes.Add(new DomainRoute(
                    domain: domain.DO_Domain,
                    url: donationPath.Trim('/'),
                    defaults: new { controller = "Website", action = "DonationCategories" }
                ));

                routes.Add(new DomainRoute(
                    domain: domain.DO_Domain,
                    url: subscribePath.Trim('/'),
                    defaults: new { controller = "Website", action = "Subscribe", email = UrlParameter.Optional }
                ));
                if (!domain.DO_CustomRouteHandler)
                {
                    routes.Add(new DomainRoute(
                        domain: domain.DO_Domain,
                        url: eventCategoriesPath.Trim('/'),
                        defaults: new {controller = "Website", action = "EventsCategories"}
                        ));

                    routes.Add(new DomainRoute(
                        domain: domain.DO_Domain,
                        url: prodCategoriesPath.Trim('/'),
                        defaults: new {controller = "Website", action = "ProdCategories"}
                        ));
                }
                routes.Add(new DomainRoute(
                    domain: domain.DO_Domain,
                    url: portfolioPath.Trim('/'),
                    defaults: new { controller = "Website", action = "Portfolio" }
                ));

                routes.Add(new DomainRoute(
                    domain: domain.DO_Domain,
                    url: String.Format("{0}/{1}", portfolioPath.Trim('/'), "{*query}"),
                    defaults: new { controller = "Website", action = "PortfolioItem" }
                ));

                routes.Add(new DomainRoute(
                    domain: domain.DO_Domain,
                    url: galleryPath.Trim('/'),
                    defaults: new { controller = "Website", action = "Gallery" }
                ));

                routes.Add(new DomainRoute(
                    domain: domain.DO_Domain,
                    url: String.Format("{0}/{1}", galleryPath.Trim('/'), "{*query}"),
                    defaults: new { controller = "Website", action = "GalleryItem" }
                ));
                if (!domain.DO_CustomRouteHandler)
                {
                    routes.Add(new DomainRoute(
                        domain: domain.DO_Domain,
                        url: String.Format("{0}/{1}", eventCategoriesPath.Trim('/'), "{*query}"),
                        defaults: new {controller = "Website", action = "Events"}
                    ));

                    routes.Add(new DomainRoute(
                        domain: domain.DO_Domain,
                        url: String.Format("{0}/{1}", prodCategoriesPath.Trim('/'), "{*query}"),
                        defaults: new {controller = "Website", action = "Products"}
                    ));
                }
                routes.Add(new DomainRoute(
                    domain: domain.DO_Domain,
                    url: testimonialsPath.Trim('/'),
                    defaults: new { controller = "Website", action = "Testimonials" }
                ));

                routes.Add(new DomainRoute(
                    domain: domain.DO_Domain,
                    url: sitemapPath.Trim('/'),
                    defaults: new { controller = "Website", action = "Sitemap" }
                ));

                routes.Add(new DomainRoute(
                    domain: domain.DO_Domain,
                    url: String.Format("{0}/{1}/{2}", newsPath.Trim('/'), SettingsManager.Blog.SearchUrl.Trim('/'), "{keyword}"),
                    defaults: new { controller = "Website", action = "BlogSearch", keyword = UrlParameter.Optional }
                ));

                routes.Add(new DomainRoute(
                    domain: domain.DO_Domain,
                    url: String.Format("{0}/{1}", newsPath.Trim('/'), "feed"),
                    defaults: new { controller = "Website", action = "GetBlogRss" }
                ));

                routes.Add(new DomainRoute(
                    domain: domain.DO_Domain,
                    url: newsPath.Trim('/'),
                    defaults: new { controller = "Website", action = "Blog" }
                ));

                routes.Add(new DomainRoute(
                    domain: domain.DO_Domain,
                    url: String.Format("{0}/{1}/{2}", newsPath.Trim('/'), SettingsManager.Blog.CategoryUrl.Trim('/'), "{name}"),
                    defaults: new { controller = "Website", action = "BlogCategory", name = UrlParameter.Optional }
                ));

                routes.Add(new DomainRoute(
                    domain: domain.DO_Domain,
                    url: String.Format("{0}/{1}/{2}", newsPath.Trim('/'), SettingsManager.Blog.TagUrl.Trim('/'), "{name}"),
                    defaults: new { controller = "Website", action = "BlogTag", name = UrlParameter.Optional }
                ));

                routes.Add(new DomainRoute(
                    domain: domain.DO_Domain,
                    url: String.Format("{0}/{1}/{2}/{3}", newsPath.Trim('/'), "{year}", "{month}", "{title}"),
                    defaults: new { controller = "Website", action = "Blog", year = UrlParameter.Optional, month = UrlParameter.Optional, title = UrlParameter.Optional }
                ));

                routes.Add(new DomainRoute(
                    domain: domain.DO_Domain,
                    url: poiPath.Trim('/'),
                    defaults: new { controller = "Website", action = "POIs" }
                ));
            }

            Route customRoute = new Route("{*values}", new CMS.UI.Common.CustomRouteHandler());
            routes.Add("customRouter", customRoute);

            //routes.MapRoute(
            //    name: "Default",
            //    url: "{*values}",
            //    defaults: new { controller = "Website", action = "Content" }
            //);

            //routes.MapRoute(
            //    name: "Default",
            //    url: "{controller}/{action}/{id}",
            //    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            //);
        }