Ejemplo n.º 1
0
        private static void AddFullData(ItemGeneralData itemGeneralData, XContainer item, IDictionary <int, List <ItemFullData> > itemsFullData)
        {
            var itemId = itemGeneralData.ItemId;

            if (!itemsFullData.ContainsKey(itemId))
            {
                itemsFullData.Add(itemId, new List <ItemFullData>());
            }

            var data = new ItemFullData();

            data.ChainId        = item.Ancestors().Last().Element("ChainId")?.Value;
            data.ChainName      = GetChainNameById(data.ChainId);
            data.ItemId         = itemId;
            data.ItemCode       = item.Element("ItemCode")?.Value;
            data.ItemName       = item.Element("ItemName")?.Value;
            data.ItemPrice      = item.Element("ItemPrice")?.Value;
            data.LastUpdateDate = item.Element("PriceUpdateDate")?.Value;
            data.Quantity       = item.Element("Quantity")?.Value;
            data.StoreId        = item.Ancestors().Last()?.Element("StoreId")?.Value;
            data.UnitOfMeasure  = item.Element("UnitOfMeasure")?.Value;

            itemsFullData[itemId].Add(data);
        }