private void DbRecordToItemRecord(ItemPrices.PricesRow a_DbRecord) { ItemRecord currItem = m_ItemsDB.GetItemByTypeID(a_DbRecord.TypeID); if (currItem == null) { return; } DbRecordToItemRecord(a_DbRecord, currItem); }
/// <summary> /// Fills m_ItemList with data /// </summary> /// <param name="a_ListTypeIDs">TypeIDs of items to be filled into list</param> /// <param name="a_Assets">Null or Assets to be listed</param> private void SetupListItemsData(UInt32[] a_ListTypeIDs, AssetsMap a_Assets) { m_TotalsItem = null; List <MainListItem> specialItems = new List <MainListItem>(); if (a_Assets != null) { m_TotalsItem = new MainListItem(); m_TotalsItem.TypeID = SpecialTypeID_Totals; m_TotalsItem.ItemData = CreateSpecialItem_Totals(); m_TotalsItem.Quantity = 0; specialItems.Add(m_TotalsItem); } m_ItemList = new MainListItem[specialItems.Count + a_ListTypeIDs.Count()]; for (int i = 0; i < specialItems.Count; i++) { m_ItemList[i] = specialItems[i]; } for (int i = 0; i < a_ListTypeIDs.Count(); i++) { UInt32 currTypeID = a_ListTypeIDs[i]; MainListItem currItem = new MainListItem(); m_ItemList[specialItems.Count + i] = currItem; ItemAssets currAssets = null; if ((a_Assets != null) && a_Assets.ContainsKey(currTypeID)) { currAssets = (ItemAssets)a_Assets[currTypeID]; } currItem.TypeID = currTypeID; currItem.ItemData = m_ItemsDB.GetItemByTypeID(currTypeID); if (currAssets == null) { currItem.Quantity = 1; } else { currItem.Quantity = currAssets.Quantity; } } }