Пример #1
0
        public int GetProductIdFromCode(string code)
        {
            ICatalogSystem            catalog       = EPiServer.ServiceLocation.ServiceLocator.Current.GetInstance <ICatalogSystem>();
            CatalogEntryResponseGroup responseGroup = new CatalogEntryResponseGroup(CatalogEntryResponseGroup.ResponseGroup.CatalogEntryInfo);
            CatalogEntryDto           entryDto      = catalog.GetCatalogEntryDto(code, responseGroup);

            if (entryDto == null || entryDto.CatalogEntry.Rows.Count == 0)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound);
            }

            return(entryDto.CatalogEntry[0].CatalogEntryId);
        }
Пример #2
0
        public CatalogEntryDto Get(int productId)
        {
            ICatalogSystem            catalog       = EPiServer.ServiceLocation.ServiceLocator.Current.GetInstance <ICatalogSystem>();
            CatalogEntryResponseGroup responseGroup = new CatalogEntryResponseGroup(CatalogEntryResponseGroup.ResponseGroup.CatalogEntryFull);
            CatalogEntryDto           entryDto      = catalog.GetCatalogEntryDto(productId, responseGroup);

            if (entryDto == null || entryDto.CatalogEntry.Rows.Count == 0)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound);
            }

            return(entryDto);
        }
Пример #3
0
 public CatalogEntryDto.CatalogEntryRow GetCatalogEntry(int catalogEntryId)
 {
     return(_catalogSystem.GetCatalogEntryDto(catalogEntryId).CatalogEntry.FirstOrDefault());
 }
Пример #4
0
 /// <summary>
 /// Gets the catalog entry dto.
 /// </summary>
 /// <param name="catalogEntryId">The catalog entry id.</param>
 /// <returns></returns>
 public CatalogEntryDto GetCatalogEntryDto(int catalogEntryId)
 {
     return(_Proxy.GetCatalogEntryDto(catalogEntryId));
 }