private static List <LinkVm> GetBreadcrumbs(ServiceProviderDetailsVm serviceProviderDetails) { List <LinkVm> breadcrumbs = GetBreadcrumbs((SearchVm)serviceProviderDetails); breadcrumbs.Add(new LinkVm(serviceProviderDetails.ServiceProvider.Name, MslcUrlBuilder.DetailsUrl(serviceProviderDetails.ServiceProvider))); return(breadcrumbs); }
public static SeoVm GetSeo(ServiceProviderDetailsVm serviceProviderDetails) { return(new SeoVm() { PageType = serviceProviderDetails.PageType, Title = Title.ServiceDetails.Replace(serviceProviderDetails), Description = Description.ServiceDetails.Replace(serviceProviderDetails), Header = Header.ServiceDetails.Replace(serviceProviderDetails), CanonicalUrl = MslcUrlBuilder.DetailsUrl(serviceProviderDetails.ServiceProvider) }); }
public static LeadFormVm GetLeadFormVm(ServiceProviderDetailsVm vm) { LeadFormVm leadFormVm = GetLeadFormVm(); leadFormVm.ListingId = vm.ServiceProvider.Id; leadFormVm.ListingName = vm.ServiceProvider.Name; leadFormVm.Message = vm.ServiceProvider.GetLeadFormMessage(); leadFormVm.Brand = SearchType.ProductsAndServices.MapToBrandType(); leadFormVm.Inquiry = InquiryType.ServiceProvider; leadFormVm.DisplayProperties.MoveInDate = false; return(leadFormVm); }
public static ServiceProviderDetailsVm GetServiceProviderDetailsVmForPrint(long serviceProviderId) { ServiceProviderDetailsVm serviceProviderDetailsVm = null; ServiceProvider serviceProvider = SearchBc.Instance.GetServiceProvider(serviceProviderId); if (serviceProvider != null) { serviceProviderDetailsVm = serviceProvider.MapToServiceProviderDetailsVm(); serviceProviderDetailsVm.Seo = SeoHelper.GetSeo(serviceProviderDetailsVm); } return(serviceProviderDetailsVm); }
public static ServiceProviderDetailsVm GetServiceProviderDetailsVm(long serviceProviderId) { ServiceProviderDetailsVm serviceProviderDetailsVm = null; ServiceProvider serviceProvider = SearchBc.Instance.GetServiceProvider(serviceProviderId); if (serviceProvider != null) { serviceProviderDetailsVm = serviceProvider.MapToServiceProviderDetailsVm(); serviceProviderDetailsVm.Breadcrumbs = GetBreadcrumbs(serviceProviderDetailsVm); serviceProviderDetailsVm.Seo = SeoHelper.GetSeo(serviceProviderDetailsVm); PopulateFeaturedServices(serviceProviderDetailsVm, null, serviceProviderId); } return(serviceProviderDetailsVm); }
private static ServiceProviderDetailsVm MapToServiceProviderDetailsVm(this ServiceProvider serviceProvider, ServiceProviderDetailsVm viewModel) { ServiceProviderDetailsVm serviceProviderQuickViewVm = viewModel ?? new ServiceProviderDetailsVm(); serviceProviderQuickViewVm.PageType = PageType.ServiceProviderDetails; serviceProviderQuickViewVm.ServiceProvider = serviceProvider.MapToServiceProviderQuickViewVm(); serviceProviderQuickViewVm.Criteria = serviceProviderQuickViewVm.ServiceProvider.Address.MapToSearchCriteriaVm(SearchType.ProductsAndServices); serviceProviderQuickViewVm.Coupon = serviceProvider.Coupon.MapToCouponVm(MslcUrlBuilder.PrintCouponUrl(serviceProvider)); serviceProviderQuickViewVm.OfficeHours = ( from oh in serviceProvider.OfficeHours select oh.ToString()).ToList <string>(); serviceProviderQuickViewVm.WebsiteUrl = serviceProvider.WebsiteUrl.ExternalUrl(); serviceProviderQuickViewVm.PaymentsAccepted = serviceProvider.AcceptedPayments; serviceProviderQuickViewVm.DisplayProperties = new DetailsDisplayProperties(); return(serviceProviderQuickViewVm); }
private static string Replace(this string input, ServiceProviderDetailsVm data) { return(input.Replace("{SERVICE_NAME}", data.ServiceProvider.Name).Replace("{CITY_STATE_CODE}", string.Format("{0}, {1}", data.ServiceProvider.Address.City, data.ServiceProvider.Address.StateCode))); }