Ejemplo n.º 1
0
 public Inventory(string json)
 {
     var j = new JSON(json);
     foreach (var entry in (List<object>)j.fields["purchaseMap"]) {
         List<object> pair = (List<object>) entry;
         string key = pair[0].ToString();
         Purchase value = new Purchase(pair[1].ToString());
         _purchaseMap.Add(key, value);
     }
     foreach (var entry in (List<object>) j.fields["skuMap"]) {
         List<object> pair = (List<object>) entry;
         string key = pair[0].ToString();
         SkuDetails value = new SkuDetails(pair[1].ToString());
         _skuMap.Add(key, value);
     }
 }
Ejemplo n.º 2
0
        public Inventory(string json)
        {
            var j = new JSON(json);

            foreach (var entry in (List <object>)j.fields["purchaseMap"])
            {
                List <object> pair  = (List <object>)entry;
                string        key   = pair[0].ToString();
                Purchase      value = new Purchase(pair[1].ToString());
                _purchaseMap.Add(key, value);
            }
            foreach (var entry in (List <object>)j.fields["skuMap"])
            {
                List <object> pair  = (List <object>)entry;
                string        key   = pair[0].ToString();
                SkuDetails    value = new SkuDetails(pair[1].ToString());
                _skuMap.Add(key, value);
            }
        }
Ejemplo n.º 3
0
 public void AddSkuDetails(SkuDetails d)
 {
     _skuMap.Add(d.Sku, d);
 }
Ejemplo n.º 4
0
 public void AddSkuDetails(SkuDetails d)
 {
     _skuMap.Add(d.Sku, d);
 }