using System; using System.Collections.Generic; namespace Muchinfo.MTPClient.Data.Model { public class ExChangeCheckModel { /// /// uint是商品组的groupId ,List是goodsIds /// private Dictionary> _groupDictionary = new Dictionary>(); public Dictionary> Group { get { return _groupDictionary; } set { _groupDictionary = value; } } /// /// uint ExChangeId, List groupIds /// private Dictionary> _exChanegGroup = new Dictionary>(); public Dictionary> ExChangeGroup { get { return _exChanegGroup; } set { _exChanegGroup = value; } } /// /// 查看下该交易所下是否有商品 /// /// /// public bool IsExchangeHasGoods(long exChangeId) { if (ExChangeGroup.Count <= exChangeId) { return false; } List groups = ExChangeGroup[exChangeId]; // 先查找交易所和商品组的关系 var ret = groups.Find(g => (Group.ContainsKey(g) && Group[g] != null && Group[g].Count > 0)); // 找出商品组下的商品信息,返回的是List return ret != 0; } } }