public static string Execute() { var productsCatalogDb = new ProductsCatalogData(); var storeDb = new StoresData(); var productsCatalogEntries = productsCatalogDb.Products.All(); int countOfAddedProducts = 0; foreach (var catalogProduct in productsCatalogEntries) { storeDb.Products.Add(new StoreProduct() { Price = catalogProduct.Price, ProductCode = catalogProduct.ProductCode, Quantity = catalogProduct.Quantity, Status = catalogProduct.Status }); countOfAddedProducts++; } storeDb.SaveChanges(); return(countOfAddedProducts + " products added to the store database"); }
public static string Execute() { var productsCatalogDb = new ProductsCatalogData(); var storeDb = new StoresData(); var productsCatalogEntries = productsCatalogDb.Products.All(); int countOfAddedProducts = 0; foreach (var catalogProduct in productsCatalogEntries) { storeDb.Products.Add(new StoreProduct() { Price = catalogProduct.Price, ProductCode = catalogProduct.ProductCode, Quantity = catalogProduct.Quantity, Status = catalogProduct.Status }); countOfAddedProducts++; } storeDb.SaveChanges(); return countOfAddedProducts + " products added to the store database"; }
public static string Execute() { var db = new ProductsCatalogData(); var excelReader = new ExcelCatalogProductsReader(db.Products); var zipParser = new ZipParser("../../../Jan 2015 Report.zip", new List<string>() { ".xls" }, excelReader); zipParser.Parse(); return "Products added to MongoDB products catalog"; }
public static string Execute() { var db = new ProductsCatalogData(); var excelReader = new ExcelCatalogProductsReader(db.Products); var zipParser = new ZipParser("../../../Jan 2015 Report.zip", new List <string>() { ".xls" }, excelReader); zipParser.Parse(); return("Products added to MongoDB products catalog"); }