Example #1
0
        public static SeoVm GetSeo(ServiceProvidersSearchVm result)
        {
            SeoVm seoVm = new SeoVm()
            {
                PageType     = result.PageType,
                CanonicalUrl = MslcUrlBuilder.PagingUrl(result, result.PageNumber),
                LinkPrev     = SeoHelper.FormPageLink <ServiceProviderBlockVm, ServiceProviderSortType>(result, PageDirection.Previous),
                LinkNext     = SeoHelper.FormPageLink <ServiceProviderBlockVm, ServiceProviderSortType>(result, PageDirection.Next),
                MarketCopy   = SeoBc.Instance.GetServiceProvidersMarketCopy(result.Criteria.ToSearchCriteria())
            };
            PageType pageType = seoVm.PageType;

            if (pageType == PageType.ServiceProvidersByState)
            {
                seoVm.Title       = Title.SearchServicesByState;
                seoVm.Description = Description.SearchServicesByState;
                seoVm.Header      = Header.SearchServicesByState;
            }
            else if (pageType == PageType.ServiceProvidersByCity)
            {
                seoVm.Title       = Title.SearchServicesByCity;
                seoVm.Description = Description.SearchServicesByCity;
                seoVm.Header      = Header.SearchServicesByCity;
            }
            seoVm.Title       = seoVm.Title.Replace <ServiceProviderBlockVm, ServiceProviderSortType>(result);
            seoVm.Description = seoVm.Description.Replace <ServiceProviderBlockVm, ServiceProviderSortType>(result);
            seoVm.Header      = seoVm.Header.Replace <ServiceProviderBlockVm, ServiceProviderSortType>(result);
            seoVm.MarketCopy  = seoVm.MarketCopy.Replace <ServiceProviderBlockVm, ServiceProviderSortType>(result);
            return(seoVm);
        }
Example #2
0
        public static SeoVm GetSeo(SearchVm result)
        {
            SeoVm seoVm = new SeoVm()
            {
                PageType     = result.PageType,
                CanonicalUrl = MslcUrlBuilder.SearchUrl(result.Criteria, result.PageType.ToSearchType())
            };
            PageType pageType = seoVm.PageType;

            if (pageType <= PageType.ShcByType)
            {
                if (pageType == PageType.Index)
                {
                    seoVm.Title        = Title.Index;
                    seoVm.Header       = Header.Index;
                    seoVm.Description  = Description.Index;
                    seoVm.CanonicalUrl = MslcUrlBuilder.BaseUrl;
                }
                else if (pageType == PageType.ShcByType)
                {
                    seoVm.Title       = Title.SearchSHC;
                    seoVm.Description = Description.SearchSHC;
                    seoVm.Header      = Header.SearchSHC;
                    seoVm.MarketCopy  = MarketCopy.SearchSHC;
                }
            }
            else if (pageType == PageType.AacByType)
            {
                seoVm.Title       = Title.SearchAAC;
                seoVm.Description = Description.SearchAAC;
                seoVm.Header      = Header.SearchAAC;
                seoVm.MarketCopy  = MarketCopy.SearchAAC;
            }
            else if (pageType == PageType.AahByType)
            {
                seoVm.Title       = Title.SearchAAH;
                seoVm.Description = Description.SearchAAH;
                seoVm.Header      = Header.SearchAAH;
                seoVm.MarketCopy  = MarketCopy.SearchAAH;
            }
            else if (pageType == PageType.ServiceProvidersByType)
            {
                seoVm.Title       = Title.SearchServices;
                seoVm.Description = Description.SearchServices;
                seoVm.Header      = Header.SearchServices;
                seoVm.MarketCopy  = MarketCopy.SearchServices;
            }
            seoVm.Title       = seoVm.Title.Replace(result);
            seoVm.Description = seoVm.Description.Replace(result);
            seoVm.Header      = seoVm.Header.Replace(result);
            return(seoVm);
        }
        public static long?SaveSeoMetaData(SeoVm model)
        {
            Seo seo = new Seo
            {
                SeoId           = model.SeoId,
                SeoPage         = model.SeoPage,
                SearchType      = model.SearchType,
                CountryId       = model.CountryId,
                StateId         = model.StateId,
                CityId          = model.CityId,
                MetaKeyword     = model.SeoMetadata.MetaKeywords,
                MetaDescription = model.SeoMetadata.MetaDescription,
                SeoCopyText     = model.SeoMetadata.SeoCopyText
            };

            seo.UserId = AccountBc.Instance.GetCurrentUserId().Value;
            return(SeoBc.Instance.SaveSeoMetaData(seo).SeoId);
        }
        public static SeoVm GetSeoMetadata(SeoVm model)
        {
            Seo seo = new Seo()
            {
                SeoPage    = model.SeoPage,
                SearchType = model.SearchType,
                CountryId  = model.CountryId,
                StateId    = model.StateId,
                CityId     = model.CityId
            };
            Seo   metaData = SeoBc.Instance.GetSeoMetaData(seo);
            SeoVm seoVm    = new SeoVm()
            {
                SeoId = metaData.SeoId
            };

            seoVm.SeoMetadata.MetaDescription = metaData.MetaDescription;
            seoVm.SeoMetadata.MetaKeywords    = metaData.MetaKeyword;
            seoVm.SeoMetadata.SeoCopyText     = metaData.SeoCopyText;
            return(seoVm);
        }
        public static long?SaveSeoMetaData(SeoVm model)
        {
            Seo seo = new Seo()
            {
                SeoId           = model.SeoId,
                SeoPage         = model.SeoPage,
                SearchType      = model.SearchType,
                CountryId       = model.CountryId,
                StateId         = model.StateId,
                CityId          = model.CityId,
                MetaKeyword     = model.SeoMetadata.MetaKeywords,
                MetaDescription = model.SeoMetadata.MetaDescription,
                SeoCopyText     = model.SeoMetadata.SeoCopyText,
                UserId          = AccountBc.Instance.GetCurrentUserId().Value
            };
            int?seoId = SeoBc.Instance.SaveSeoMetaData(seo).SeoId;

            if (!seoId.HasValue)
            {
                return(null);
            }
            return(new long?((long)seoId.GetValueOrDefault()));
        }
Example #6
0
        public static SeoVm GetSeo(CommunitiesSearchVm result)
        {
            SeoVm seoVm = new SeoVm()
            {
                PageType     = result.PageType,
                CanonicalUrl = MslcUrlBuilder.PagingUrl((SearchVm)result, result.PageNumber),
                LinkPrev     = SeoHelper.FormPageLink <CommunityBlockVm, CommunitySortType>(result, PageDirection.Previous),
                LinkNext     = SeoHelper.FormPageLink <CommunityBlockVm, CommunitySortType>(result, PageDirection.Next),
                MarketCopy   = SeoBc.Instance.GetCommunityMarketCopy(result.Criteria.ToSearchCriteria(), result.Criteria.SearchType().ToListingType())
            };

            switch (seoVm.PageType)
            {
            case PageType.ShcByState:
            {
                seoVm.Title       = Title.SearchSHCByState;
                seoVm.Description = Description.SearchSHCByState;
                seoVm.Header      = Header.SearchSHCByState;
                seoVm.Title       = seoVm.Title.Replace <CommunityBlockVm, CommunitySortType>(result);
                seoVm.Description = seoVm.Description.Replace <CommunityBlockVm, CommunitySortType>(result);
                seoVm.Header      = seoVm.Header.Replace <CommunityBlockVm, CommunitySortType>(result);
                seoVm.MarketCopy  = seoVm.MarketCopy.Replace <CommunityBlockVm, CommunitySortType>(result);
                return(seoVm);
            }

            case PageType.ShcByCity:
            {
                seoVm.Title       = Title.SearchSHCByCity;
                seoVm.Description = Description.SearchSHCByCity;
                seoVm.Header      = Header.SearchSHCByCity;
                seoVm.Title       = seoVm.Title.Replace <CommunityBlockVm, CommunitySortType>(result);
                seoVm.Description = seoVm.Description.Replace <CommunityBlockVm, CommunitySortType>(result);
                seoVm.Header      = seoVm.Header.Replace <CommunityBlockVm, CommunitySortType>(result);
                seoVm.MarketCopy  = seoVm.MarketCopy.Replace <CommunityBlockVm, CommunitySortType>(result);
                return(seoVm);
            }

            case PageType.ShcByZip:
            case PageType.AacByType:
            case PageType.AacByZip:
            case PageType.AahByType:
            {
                seoVm.Title       = seoVm.Title.Replace <CommunityBlockVm, CommunitySortType>(result);
                seoVm.Description = seoVm.Description.Replace <CommunityBlockVm, CommunitySortType>(result);
                seoVm.Header      = seoVm.Header.Replace <CommunityBlockVm, CommunitySortType>(result);
                seoVm.MarketCopy  = seoVm.MarketCopy.Replace <CommunityBlockVm, CommunitySortType>(result);
                return(seoVm);
            }

            case PageType.AacByState:
            {
                seoVm.Title       = Title.SearchAACByState;
                seoVm.Description = Description.SearchAACByState;
                seoVm.Header      = Header.SearchAACByState;
                seoVm.Title       = seoVm.Title.Replace <CommunityBlockVm, CommunitySortType>(result);
                seoVm.Description = seoVm.Description.Replace <CommunityBlockVm, CommunitySortType>(result);
                seoVm.Header      = seoVm.Header.Replace <CommunityBlockVm, CommunitySortType>(result);
                seoVm.MarketCopy  = seoVm.MarketCopy.Replace <CommunityBlockVm, CommunitySortType>(result);
                return(seoVm);
            }

            case PageType.AacByCity:
            {
                seoVm.Title       = Title.SearchAACByCity;
                seoVm.Description = Description.SearchAACByCity;
                seoVm.Header      = Header.SearchAACByCity;
                seoVm.Title       = seoVm.Title.Replace <CommunityBlockVm, CommunitySortType>(result);
                seoVm.Description = seoVm.Description.Replace <CommunityBlockVm, CommunitySortType>(result);
                seoVm.Header      = seoVm.Header.Replace <CommunityBlockVm, CommunitySortType>(result);
                seoVm.MarketCopy  = seoVm.MarketCopy.Replace <CommunityBlockVm, CommunitySortType>(result);
                return(seoVm);
            }

            case PageType.AahByState:
            {
                seoVm.Title       = Title.SearchAAHByState;
                seoVm.Description = Description.SearchAAHByState;
                seoVm.Header      = Header.SearchAAHByState;
                seoVm.Title       = seoVm.Title.Replace <CommunityBlockVm, CommunitySortType>(result);
                seoVm.Description = seoVm.Description.Replace <CommunityBlockVm, CommunitySortType>(result);
                seoVm.Header      = seoVm.Header.Replace <CommunityBlockVm, CommunitySortType>(result);
                seoVm.MarketCopy  = seoVm.MarketCopy.Replace <CommunityBlockVm, CommunitySortType>(result);
                return(seoVm);
            }

            case PageType.AahByCity:
            {
                seoVm.Title       = Title.SearchAAHByCity;
                seoVm.Description = Description.SearchAAHByCity;
                seoVm.Header      = Header.SearchAAHByCity;
                seoVm.Title       = seoVm.Title.Replace <CommunityBlockVm, CommunitySortType>(result);
                seoVm.Description = seoVm.Description.Replace <CommunityBlockVm, CommunitySortType>(result);
                seoVm.Header      = seoVm.Header.Replace <CommunityBlockVm, CommunitySortType>(result);
                seoVm.MarketCopy  = seoVm.MarketCopy.Replace <CommunityBlockVm, CommunitySortType>(result);
                return(seoVm);
            }

            default:
            {
                seoVm.Title       = seoVm.Title.Replace <CommunityBlockVm, CommunitySortType>(result);
                seoVm.Description = seoVm.Description.Replace <CommunityBlockVm, CommunitySortType>(result);
                seoVm.Header      = seoVm.Header.Replace <CommunityBlockVm, CommunitySortType>(result);
                seoVm.MarketCopy  = seoVm.MarketCopy.Replace <CommunityBlockVm, CommunitySortType>(result);
                return(seoVm);
            }
            }
        }
Example #7
0
        public static SeoVm GetSeo(PageType staticPage)
        {
            SeoVm seoVm = new SeoVm()
            {
                CanonicalUrl = MslcUrlBuilder.StaticPageUrl(staticPage)
            };

            switch (staticPage)
            {
            case PageType.PrivacyPolicy:
            {
                seoVm.Title       = Title.PrivacyPolicy;
                seoVm.Header      = Header.PrivacyPolicy;
                seoVm.Description = Description.PrivacyPolicy;
                break;
            }

            case PageType.TermsOfUse:
            {
                seoVm.Title       = Title.TermsOfUse;
                seoVm.Header      = Header.TermsOfUse;
                seoVm.Description = Description.TermsOfUse;
                break;
            }

            /*case PageType.AboutUs:
             *  {
             *      seoVm.Title = Title.AboutUs;
             *      seoVm.Header = Header.AboutUs;
             *      seoVm.Description = Description.AboutUs;
             *      break;
             * }
             * case PageType.ContactUs:
             * {
             *      seoVm.Title = Title.AboutUs;
             *      seoVm.Header = Header.AboutUs;
             *      seoVm.Description = Description.AboutUs;
             *      break;
             * }
             * case PageType.SeniorType:
             * {
             *      seoVm.Title = Title.AboutUs;
             *      seoVm.Header = Header.AboutUs;
             *      seoVm.Description = Description.AboutUs;
             *      break;
             * }*/
            case PageType.Error404:
            {
                seoVm.Title      = Title.Error404;
                seoVm.Header     = Header.Error404;
                seoVm.MarketCopy = MarketCopy.Error404;
                break;
            }

            case PageType.Error500:
            {
                seoVm.Title      = Title.Error500;
                seoVm.Header     = Header.Error500;
                seoVm.MarketCopy = MarketCopy.Error500;
                break;
            }

            case PageType.Ebook:
            {
                seoVm.Title      = "Book edit tool";
                seoVm.Header     = "Book edit tool";
                seoVm.MarketCopy = string.Empty;
                break;
            }
            }
            return(seoVm);
        }