private ItemType FillItem(RecommendationEngineCodeType engine)
        {
            ItemType item = new ItemType();

            if (TxtTitle.Text.Length > 0)
            {
                item.Title = TxtTitle.Text;
            }

            CurrencyCodeType currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);

            item.Currency = currencyID;
            if (TxtStartPrice.Text.Length > 0)
            {
                item.StartPrice            = new AmountType();
                item.StartPrice.Value      = Convert.ToDouble(TxtStartPrice.Text);
                item.StartPrice.currencyID = currencyID;
            }

            if (TxtReservePrice.Text.Length > 0)
            {
                item.ReservePrice            = new AmountType();
                item.ReservePrice.Value      = Convert.ToDouble(TxtReservePrice.Text);
                item.ReservePrice.currencyID = currencyID;
            }
            ;

            if (TxtBuyItNowPrice.Text.Length > 0)
            {
                item.BuyItNowPrice            = new AmountType();
                item.BuyItNowPrice.Value      = Convert.ToDouble(TxtBuyItNowPrice.Text);
                item.BuyItNowPrice.currencyID = currencyID;
            }

            if (TxtPrimaryCategory.Text.Length > 0)
            {
                item.PrimaryCategory            = new CategoryType();
                item.PrimaryCategory.CategoryID = TxtPrimaryCategory.Text;
            }

            if (TxtSecondaryCategory.Text.Length > 0)
            {
                item.SecondaryCategory            = new CategoryType();
                item.SecondaryCategory.CategoryID = TxtSecondaryCategory.Text;
            }

            if (TxtItemID.Visible)
            {
                item.ItemID = TxtItemID.Text;
            }
            if (engine == RecommendationEngineCodeType.ProductPricing)
            {
                string s = TxtExternalProductID.Text;
                if (s.Length > 0)
                {
                    ProductListingDetailsType pld = new ProductListingDetailsType();
                    pld.ProductID = s;
                    item.ProductListingDetails = pld;
                }
            }

            return(item);
        }
Exemplo n.º 2
0
        private ItemType FillItem(RecommendationEngineCodeType engine)
        {
            ItemType item = new ItemType();
            if (TxtTitle.Text.Length > 0)
                item.Title = TxtTitle.Text;

            CurrencyCodeType currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);

            item.Currency = currencyID;
            if (TxtStartPrice.Text.Length > 0)
            {
                item.StartPrice = new AmountType();
                item.StartPrice.Value = Convert.ToDouble(TxtStartPrice.Text);
                item.StartPrice.currencyID = currencyID;
            }

            if (TxtReservePrice.Text.Length > 0)
            {
                item.ReservePrice = new AmountType();
                item.ReservePrice.Value = Convert.ToDouble(TxtReservePrice.Text);
                item.ReservePrice.currencyID = currencyID;
            };

            if (TxtBuyItNowPrice.Text.Length > 0)
            {
                item.BuyItNowPrice = new AmountType();
                item.BuyItNowPrice.Value = Convert.ToDouble(TxtBuyItNowPrice.Text);
                item.BuyItNowPrice.currencyID = currencyID;
            }

            if (TxtPrimaryCategory.Text.Length > 0)
            {
                item.PrimaryCategory = new CategoryType();
                item.PrimaryCategory.CategoryID = TxtPrimaryCategory.Text;
            }

            if (TxtSecondaryCategory.Text.Length > 0)
            {
                item.SecondaryCategory = new CategoryType();
                item.SecondaryCategory.CategoryID= TxtSecondaryCategory.Text;
            }

            if (TxtItemID.Visible)
            {
                item.ItemID = TxtItemID.Text;
            }
            if( engine == RecommendationEngineCodeType.ProductPricing )
            {
                string s = TxtExternalProductID.Text;
                if (s.Length > 0)
                {
                    ProductListingDetailsType pld = new ProductListingDetailsType();
                    pld.ProductID = s;
                    item.ProductListingDetails = pld;
                }
            }

            return item;
        }