protected void _Init(bool all_item) { if (this._req_store == null) { this._req_store = new Api_req_store(); } Dictionary <int, Mst_payitem> storeList = this._req_store.GetStoreList(); this._items = new List <ItemStoreModel>(); if (this._mst_cabinets == null) { this._mst_cabinets = Mst_DataManager.Instance.GetMstCabinet(); } List <Mst_item_shop> list = this._mst_cabinets.get_Item(1); list = list.GetRange(0, list.get_Count()); if (all_item) { using (Dictionary <int, Mst_payitem> .ValueCollection.Enumerator enumerator = storeList.get_Values().GetEnumerator()) { while (enumerator.MoveNext()) { Mst_payitem current = enumerator.get_Current(); if (!(current.Name == string.Empty)) { ItemStoreModel itemStoreModel = new ItemStoreModel(current); this._items.Add(itemStoreModel); } } } this._items.Sort((ItemStoreModel a, ItemStoreModel b) => (a.MstId <= b.MstId) ? -1 : 1); } else { using (List <Mst_item_shop> .Enumerator enumerator2 = list.GetEnumerator()) { while (enumerator2.MoveNext()) { Mst_item_shop current2 = enumerator2.get_Current(); Mst_payitem mst_payitem; storeList.TryGetValue(current2.Item1_id, ref mst_payitem); if (mst_payitem == null) { this._items.Add(null); } else { ItemStoreModel itemStoreModel2 = new ItemStoreModel(mst_payitem); this._items.Add(itemStoreModel2); } } } } }
protected void _Init(bool all_item) { if (_req_store == null) { _req_store = new Api_req_store(); } Dictionary <int, Mst_payitem> storeList = _req_store.GetStoreList(); _items = new List <ItemStoreModel>(); if (_mst_cabinets == null) { _mst_cabinets = Mst_DataManager.Instance.GetMstCabinet(); } List <Mst_item_shop> list = _mst_cabinets[1]; list = list.GetRange(0, list.Count); if (all_item) { foreach (Mst_payitem value2 in storeList.Values) { if (!(value2.Name == string.Empty)) { ItemStoreModel item = new ItemStoreModel(value2); _items.Add(item); } } _items.Sort((ItemStoreModel a, ItemStoreModel b) => (a.MstId > b.MstId) ? 1 : (-1)); } else { foreach (Mst_item_shop item3 in list) { storeList.TryGetValue(item3.Item1_id, out Mst_payitem value); if (value == null) { _items.Add(null); } else { ItemStoreModel item2 = new ItemStoreModel(value); _items.Add(item2); } } } }