상속: Sage.Integration.Northwind.Application.Base.EntityBase
예제 #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);
 }
예제 #3
0
 public CommodityWrapper(RequestContext context)
     : base(context, SupportedResourceKinds.commodityGroups)
 {
     _entity = new Product();
     _transformation = TransformationFactory.GetTransformation
         <ITransformation<ProductDocument, CommodityPayload>>
         (SupportedResourceKinds.commodities, context);
 }
예제 #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;
 }
예제 #5
0
        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();
        }