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