public Data.ItemCount Count(int id) { Data.ItemCount cnt = new Data.ItemCount(); cnt.id = id; foreach (var item in mItemList) { if (item.dwObjectID == id) { cnt.count += (int)item.dwNum; } } return cnt; }
public static object GetValue_ItemCount(Type type, String value) { ItemCount cnt = new ItemCount(); string[] vals = value.Split(':'); if (vals.Length > 0) cnt.id = int.Parse(vals[0]); if (vals.Length > 1) cnt.count = int.Parse(vals[1]); return cnt; }