public List <UpcInventory> fillUPCsInventory(ProductsList productlist) { String upc = ""; UpcInventory UpcObject; List <UpcInventory> UpcList = new List <UpcInventory>(); List <UpcInventory> UpcFinalList = new List <UpcInventory>(); Dictionary <String, int> UpcIndex = new Dictionary <string, int>(); foreach (Product prod in productlist.getAll()) { UpcObject = new UpcInventory(prod.upc, prod.product_name); UpcIndex.Add(prod.upc, UpcList.Count); UpcList.Add(UpcObject); } foreach (DictionaryEntry item in m_TagTable) { upc = EpcTools.getUpc(item.Value.ToString()); UpcList[UpcIndex[upc]].total++; } foreach (UpcInventory UpcO in UpcList) { if (UpcO.total != 0) { UpcFinalList.Add(UpcO); } } return(UpcFinalList); }