public override object __hx_invoke1_o(double __fn_float1, object __fn_dyn1) { #line 63 "/my-component/src/shoppingcart/ShoppingCartLogic.hx" global::Array <object> items = (((__fn_dyn1 == global::haxe.lang.Runtime.undefined)) ? (((global::Array <object>)(global::Array <object> .__hx_cast <object>(((global::Array)(((object)(__fn_float1)))))))) : (((global::Array <object>)(global::Array <object> .__hx_cast <object>(((global::Array)(__fn_dyn1))))))); double total = ((double)(0)); #line 65 "/my-component/src/shoppingcart/ShoppingCartLogic.hx" int count = 0; { #line 66 "/my-component/src/shoppingcart/ShoppingCartLogic.hx" int _g = 0; #line 66 "/my-component/src/shoppingcart/ShoppingCartLogic.hx" while ((_g < items.length)) { #line 66 "/my-component/src/shoppingcart/ShoppingCartLogic.hx" global::shoppingcart.ItemModel item = ((global::shoppingcart.ItemModel)(items[_g])); #line 66 "/my-component/src/shoppingcart/ShoppingCartLogic.hx" ++_g; if ((item != null)) { #line 68 "/my-component/src/shoppingcart/ShoppingCartLogic.hx" total += (item.qty * item.price); count += item.qty; } } } #line 72 "/my-component/src/shoppingcart/ShoppingCartLogic.hx" object summary = new global::haxe.lang.DynamicObject(new int[] {}, new object[] {}, new int[] { 338842564, 1108126720 }, new double[] { total, ((double)(count)) }); #line 76 "/my-component/src/shoppingcart/ShoppingCartLogic.hx" this.callback.__hx_invoke1_o(default(double), summary); #line 63 "/my-component/src/shoppingcart/ShoppingCartLogic.hx" return(null); }
public override object __hx_invoke1_o(double __fn_float1, object __fn_dyn1) { #line 29 "/my-component/src/shoppingcart/ShoppingCartLogic.hx" global::Array <object> items = (((__fn_dyn1 == global::haxe.lang.Runtime.undefined)) ? (((global::Array <object>)(global::Array <object> .__hx_cast <object>(((global::Array)(((object)(__fn_float1)))))))) : (((global::Array <object>)(global::Array <object> .__hx_cast <object>(((global::Array)(__fn_dyn1))))))); global::Array <object> list = new global::Array <object>(); #line 31 "/my-component/src/shoppingcart/ShoppingCartLogic.hx" { #line 31 "/my-component/src/shoppingcart/ShoppingCartLogic.hx" int _g = 0; #line 31 "/my-component/src/shoppingcart/ShoppingCartLogic.hx" while ((_g < items.length)) { #line 31 "/my-component/src/shoppingcart/ShoppingCartLogic.hx" global::shoppingcart.ItemModel item = ((global::shoppingcart.ItemModel)(items[_g])); #line 31 "/my-component/src/shoppingcart/ShoppingCartLogic.hx" ++_g; object cartItem = new global::haxe.lang.DynamicObject(new int[] { 151629774 }, new object[] { item.itemId }, new int[] { 5243965, 5645366, 1217089161 }, new double[] { ((double)(item.idx)), ((double)(item.qty)), item.price }); #line 38 "/my-component/src/shoppingcart/ShoppingCartLogic.hx" list.push(cartItem); } } #line 40 "/my-component/src/shoppingcart/ShoppingCartLogic.hx" this.callback.__hx_invoke1_o(default(double), list); #line 29 "/my-component/src/shoppingcart/ShoppingCartLogic.hx" return(null); }
public override object __hx_invoke1_o(double __fn_float1, object __fn_dyn1) { #line 49 "/my-component/src/shoppingcart/ShoppingCartLogic.hx" global::shoppingcart.ItemModel item = (((__fn_dyn1 == global::haxe.lang.Runtime.undefined)) ? (((global::shoppingcart.ItemModel)(((object)(__fn_float1))))) : (((global::shoppingcart.ItemModel)(__fn_dyn1)))); item.qty = this.qty; #line 51 "/my-component/src/shoppingcart/ShoppingCartLogic.hx" this._gthis.itemRepo.Edit(item, new global::shoppingcart.ShoppingCartLogic_UpdateQty_51__Fun(this.callback)); #line 49 "/my-component/src/shoppingcart/ShoppingCartLogic.hx" return(null); }
public virtual void AddItem(string cartId, string itemId, int qty, double price, global::haxe.lang.Function callback) { #line 19 "/my-component/src/shoppingcart/ShoppingCartLogic.hx" global::shoppingcart.ItemModel item = new global::shoppingcart.ItemModel(); item.cartId = cartId; #line 21 "/my-component/src/shoppingcart/ShoppingCartLogic.hx" item.itemId = itemId; item.qty = qty; #line 23 "/my-component/src/shoppingcart/ShoppingCartLogic.hx" item.price = price; this.itemRepo.Add(item, new global::shoppingcart.ShoppingCartLogic_AddItem_24__Fun(callback)); }
public virtual void Add(global::shoppingcart.ItemModel item, global::haxe.lang.Function callback) { #line 17 "/my-component/src/shoppingcart/ItemRepository.hx" if (!(((global::haxe.ds.StringMap <object>)(global::haxe.ds.StringMap <object> .__hx_cast <object>(((global::haxe.ds.StringMap)(((global::haxe.IMap <string, object>)(this.items))))))).exists(item.cartId))) { #line 18 "/my-component/src/shoppingcart/ItemRepository.hx" global::haxe.IMap <string, object> this1 = this.items; #line 18 "/my-component/src/shoppingcart/ItemRepository.hx" string k = item.cartId; #line 18 "/my-component/src/shoppingcart/ItemRepository.hx" global::Array <object> v = new global::Array <object>(); #line 18 "/my-component/src/shoppingcart/ItemRepository.hx" ((global::haxe.ds.StringMap <object>)(global::haxe.ds.StringMap <object> .__hx_cast <object>(((global::haxe.ds.StringMap)(this1))))).@set(k, v); } #line 20 "/my-component/src/shoppingcart/ItemRepository.hx" int idx = ((global::Array <object>)(global::Array <object> .__hx_cast <object>(((global::Array)((((global::haxe.ds.StringMap <object>)(global::haxe.ds.StringMap <object> .__hx_cast <object>(((global::haxe.ds.StringMap)(((global::haxe.IMap <string, object>)(this.items))))))).@get(item.cartId)).@value))))).length; item.idx = idx; #line 22 "/my-component/src/shoppingcart/ItemRepository.hx" ((global::Array <object>)(global::Array <object> .__hx_cast <object>(((global::Array)((((global::haxe.ds.StringMap <object>)(global::haxe.ds.StringMap <object> .__hx_cast <object>(((global::haxe.ds.StringMap)(((global::haxe.IMap <string, object>)(this.items))))))).@get(item.cartId)).@value))))).push(item); callback.__hx_invoke1_o(((double)(idx)), global::haxe.lang.Runtime.undefined); }
public virtual void Edit(global::shoppingcart.ItemModel item, global::haxe.lang.Function callback) { #line 45 "/my-component/src/shoppingcart/ItemRepository.hx" ((global::Array <object>)(global::Array <object> .__hx_cast <object>(((global::Array)((((global::haxe.ds.StringMap <object>)(global::haxe.ds.StringMap <object> .__hx_cast <object>(((global::haxe.ds.StringMap)(((global::haxe.IMap <string, object>)(this.items))))))).@get(item.cartId)).@value)))))[item.idx] = item; callback.__hx_invoke0_o(); }
protected static void __hx_ctor_shoppingcart_ItemModel(global::shoppingcart.ItemModel __hx_this) { }