private MSCommerceCatalogCollection2CatalogProduct[] GenerateUNFIEastProducts(string warehouse) { var products = new List <MSCommerceCatalogCollection2CatalogProduct>(); var itemTable = stagingRepository.ReadUNFIEastItems(warehouse); foreach (DataRow row in itemTable.Rows) { var newProd = new MSCommerceCatalogCollection2CatalogProduct() { ProductId = row.GetString("ProductNumber"), Definition = "Item" }; newProd.DisplayName = new DisplayName[1] { new DisplayName() { language = "en-US", Value = row.GetString("Description") } }; newProd.ParentCategory = new ParentCategory[1] { new ParentCategory() { Value = row.GetString("Subgroup"), rank = "0" } }; newProd.listprice = "0"; products.Add(newProd); } return(products.ToArray()); }
private MSCommerceCatalogCollection2CatalogProduct[] GenerateProducts(string branchId) { var products = new List <MSCommerceCatalogCollection2CatalogProduct>(); var itemTable = stagingRepository.ReadItems(branchId); var prefixesToExclude = Configuration.CategoryPrefixesToExclude.Split(',') .ToList(); foreach (DataRow row in itemTable.Rows) { if (prefixesToExclude.Contains(row.GetString("CategoryId") .Substring(0, 2))) { continue; } var newProd = new MSCommerceCatalogCollection2CatalogProduct() { ProductId = row.GetString("ItemId"), Definition = "Item" }; newProd.DisplayName = new DisplayName[1] { new DisplayName() { language = "en-US", Value = row.GetString("Name") } }; newProd.ParentCategory = new ParentCategory[1] { new ParentCategory() { Value = row.GetString("CategoryId"), rank = "0" } }; newProd.listprice = "0"; products.Add(newProd); } return(products.ToArray()); }