コード例 #1
0
 public void OnOrderItemProcessed(OrderItemProcessedEventArgs e)
 {
     if (_MinerRepository == null)
     {
         _MinerRepository = new MinerRepository();
     }
     //Update Sku miner
     //if (e.OrderLineItemData.Sku == 101)
     //{
     //    Console.WriteLine("Sku 101 was purchased on {0} and the data was mined.", DateTime.Now.ToString());
     //}
 }
コード例 #2
0
        public void Initialize(CommerceEvents events, NameValueCollection config)
        {
            events.OrderItemProcessed += args =>
            {
                // just for the case if i want to have access to the host's db
                // args.StoreRepository...

                // in the case that i want access to my own db - other then from host's
                if (this._minerRepository == null)
                {
                    this._minerRepository = new MinerRepository();
                }

                if (args.OrderLineItemData.Sku == 102)
                {
                    Console.WriteLine("\t### Product with Sku 101 was purchased on {0} ###", DateTime.Now.ToLongDateString());
                }
            };
        }
コード例 #3
0
 public SkuMinerModule(IMinerRepository minerRepository)
 {
     _MinerRepository = minerRepository;
 }
コード例 #4
0
 /// <summary>
 /// just for unit testing
 /// </summary>
 /// <param name="minerRepository"></param>
 public SkuMinerModule(IMinerRepository minerRepository)
 {
     this._minerRepository = minerRepository;
 }
コード例 #5
0
 public MinerAppService(IMinerRepository iMinerRepository)
 {
     this.iMinerRepository = iMinerRepository;
 }