Example #1
0
        public CatalogueElementListComponent.CatalogClientPriceInfoSet GetClientPriceSet(int itemId, int initQuantity, bool displayAllTiers, string[] userRoleNames, int currencyId, bool includeVATInPrice, IEnumerable<int> priceTypes)
        {
            BXCatalogClientPriceSet set = new BXCatalogClientPriceSet(itemId, !displayAllTiers ? initQuantity : 0, userRoleNames, currencyId, includeVATInPrice, priceTypes, BXCatalogClientPriceSetMode.View);
            CatalogueElementListComponent.CatalogClientPriceInfo[] items =
                new CatalogueElementListComponent.CatalogClientPriceInfo[set.Count];
            for (int i = 0; i < set.Count; i++)
                items[i] = CreateInfo(set[i]);

            return new CatalogueElementListComponent.CatalogClientPriceInfoSet(GetPriceTypes(), items, CreateInfo(set.GetSellingPrice(initQuantity > 0 ? initQuantity : 1)));
        }
Example #2
0
        public CatalogueElementListComponent.CatalogClientPriceInfoSet GetClientPriceSet(BXIBlockElement item, int initQuantity, bool displayAllTiers, string[] userRoleNames, int currencyId, bool includeVATInPrice, IEnumerable<int> priceTypes)
        {
			if(item == null)
				throw new ArgumentNullException("item");

			BXCatalogItem catalogItem = GetCatalogItem(item);
			BXCatalogClientPriceSet set = catalogItem != null 
				? new BXCatalogClientPriceSet(catalogItem, !displayAllTiers ? initQuantity : 0, userRoleNames, currencyId, includeVATInPrice, priceTypes, BXCatalogClientPriceSetMode.View)
				: new BXCatalogClientPriceSet(item.Id, !displayAllTiers ? initQuantity : 0, userRoleNames, currencyId, includeVATInPrice, priceTypes, BXCatalogClientPriceSetMode.View);

            CatalogueElementListComponent.CatalogClientPriceInfo[] items = 
				new CatalogueElementListComponent.CatalogClientPriceInfo[set.Count];

            for (int i = 0; i < set.Count; i++)
                items[i] = CreateInfo(set[i]);

            return new CatalogueElementListComponent.CatalogClientPriceInfoSet(GetPriceTypes(), items, CreateInfo(set.GetSellingPrice(initQuantity > 0 ? initQuantity : 1)));
        }