예제 #1
0
        public void AddRecord(ProcessRecord record)
        {
            var  product = record.Product;
            bool found   = false;

            record.IsProcessed = true;
            if (product != null)
            {
                VariantsIds.Add(record.ProductVariant.Id);
                var manufacturers = product.ProductManufacturers;
                foreach (var m in manufacturers)
                {
                    found = false;
                    foreach (var m2 in ManufacturersIds)
                    {
                        if (m2 == m.ManufacturerId)
                        {
                            found = true;
                            break;
                        }
                    }
                    if (!found)
                    {
                        ManufacturersIds.Add(m.ManufacturerId);
                    }
                }
            }

            Records.Add(record);
        }
예제 #2
0
        public void AddMissingProduct(ProductVariant product)
        {
            if (product == null)
            {
                return;
            }

            var record = new ProcessRecord()
            {
                IsProcessed    = false,
                ProductVariant = product,
                Sku            = product.Sku,
                Price          = product.Price,
                Quantity       = product.StockQuantity
            };

            Records.Add(record);
        }