public static bool LoadItem(Dictionary <int, ItemTemplateInfo> infos, Dictionary <int, LoadUserBoxInfo> userBoxs) { using (ProduceBussiness produceBussiness = new ProduceBussiness()) { ItemTemplateInfo[] allGoods = produceBussiness.GetAllGoods(); ItemTemplateInfo[] array = allGoods; for (int i = 0; i < array.Length; i++) { ItemTemplateInfo itemTemplateInfo = array[i]; if (!infos.Keys.Contains(itemTemplateInfo.TemplateID)) { infos.Add(itemTemplateInfo.TemplateID, itemTemplateInfo); } } LoadUserBoxInfo[] allTimeBoxAward = produceBussiness.GetAllTimeBoxAward(); LoadUserBoxInfo[] array2 = allTimeBoxAward; for (int j = 0; j < array2.Length; j++) { LoadUserBoxInfo loadUserBoxInfo = array2[j]; if (!infos.Keys.Contains(loadUserBoxInfo.ID)) { userBoxs.Add(loadUserBoxInfo.ID, loadUserBoxInfo); } } } return(true); }
public static bool LoadItem(Dictionary <int, ItemTemplateInfo> infos, Dictionary <int, LoadUserBoxInfo> userBoxs) { using (ProduceBussiness produceBussiness = new ProduceBussiness()) { foreach (ItemTemplateInfo itemTemplateInfo in produceBussiness.GetAllGoods()) { if (!Enumerable.Contains <int>((IEnumerable <int>)infos.Keys, itemTemplateInfo.TemplateID)) { infos.Add(itemTemplateInfo.TemplateID, itemTemplateInfo); } } foreach (LoadUserBoxInfo loadUserBoxInfo in produceBussiness.GetAllTimeBoxAward()) { if (!Enumerable.Contains <int>((IEnumerable <int>)infos.Keys, loadUserBoxInfo.ID)) { userBoxs.Add(loadUserBoxInfo.ID, loadUserBoxInfo); } } } return(true); }