Inheritance: Sage.Integration.Northwind.Application.Base.EntityBase
Esempio n. 1
0
 public Pricing CheckPrice(Pricing PricingInformation, NorthwindConfig northwindConfig)
 {
     Pricing result;
     Product product = new Product();
     result = product.CheckPrice(PricingInformation, northwindConfig);
     return result;
 }
 public CommodityFeedEntryWrapper(RequestContext context)
     : base(context, Adapter.Common.SupportedResourceKinds.commodities)
 {
     _entity = new Product();
     _entity.DelimiterClause = @"Discontinued = false";
     _transform = new CommodityTransform(context);
 }
Esempio n. 3
0
 public CommodityWrapper(RequestContext context)
     : base(context, SupportedResourceKinds.commodityGroups)
 {
     _entity = new Product();
     _transformation = TransformationFactory.GetTransformation
         <ITransformation<ProductDocument, CommodityPayload>>
         (SupportedResourceKinds.commodities, context);
 }
Esempio n. 4
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="OrderDetails"></param>
 /// <param name="config"></param>
 /// <returns></returns>
 public PricingDetail GetPricingDetails(OrderDetailInformation OrderDetails, NorthwindConfig config)
 {
     PricingDetail result;
     Product product = new Product();
     result = product.GetPricingDetails(OrderDetails, config);
     return result;
 }
        private ICommodityPrice[] GetCommodityPriceData(CommodityIdentity[] commodityIdentities)
        {
            // Get pricing data for the products

            // adapter for database access
            Product product = new Product();

            List<string> nonEmptyLocalIds = new List<string>();
            foreach (CommodityIdentity prodId in commodityIdentities)
            {
                if (!prodId.IsEmpty())
                    nonEmptyLocalIds.Add(prodId.CommodityId);
            }

            // database request
            ProductPriceDocument[] dataDocuments = product.GetProductPrices(nonEmptyLocalIds.ToArray(), _context.Config);

            // create collection of commodity prices
            List<ICommodityPrice> commodityPrices = new List<ICommodityPrice>();

            foreach (CommodityIdentity identity in commodityIdentities)
            {
                if (identity.IsEmpty())
                    commodityPrices.Add(CommodityPriceData.Empty);
                else
                {
                    // get the corresponding db document and add a new CommodityPriceData to list
                    bool priceFound = false;
                    foreach (ProductPriceDocument data in dataDocuments)
                    {
                        if (data.ProductId.ToString() == identity.CommodityId)
                        {
                            commodityPrices.Add(new CommodityPriceData(identity, data));
                            priceFound = true;
                            break;
                        }
                    }

                    if (!priceFound)
                        commodityPrices.Add(CommodityPriceData.Empty);
                }
            }

            return commodityPrices.ToArray();
        }