Exemplo n.º 1
0
        /*
         * private static void CategoryTest()
         * {
         *  CategoryManager categoryManager = new CategoryManager(new EfCategoryDal());
         *
         *  foreach (var category in categoryManager.GetAll())
         *  {
         *      Console.WriteLine(category.CategoryName);
         *  }
         * }
         */


        private static void ProductTest()
        {
            ProductManager productManager = new ProductManager(new EfProductDal(), new CategoryManager(new EfCategoryDal()));

            var result = productManager.GetProductDetailDtos();

            //  var result = productManager.GetAll();

            if (result.Success == true)
            {
                foreach (var product in result.Data)
                {
                    Console.WriteLine(product.ProductName + "/" + product.CategoryName);
                }
            }
            else
            {
                Console.WriteLine(result.Message);
            }

            /*
             * productManager = new ProductManager(new EfProductDal());
             *
             * foreach (var product in productManager.GetProductDetailDtos())
             * {
             *
             * }
             */
        }
Exemplo n.º 2
0
        private static void ProductTest()
        {
            ProductManager productManager = new ProductManager(new EfProductDal());

            foreach (var product in productManager.GetProductDetailDtos())
            {
                Console.WriteLine(product.ProductName + " / " + product.CategoryName);
            }
        }
Exemplo n.º 3
0
        private static void ProductDetailDtoTest()
        {
            ProductManager productManager = new ProductManager(new EfProductDal(), new CategoryManager(new EfCategoryDal()));

            var result = productManager.GetProductDetailDtos();

            if (result.Success)
            {
                foreach (var product in result.Data)
                {
                    Console.WriteLine("{0} -- {1} -- {2} -- {3}", product.ProductId, product.ProductName, product.CategoryName, product.UnitsInStock);
                }
            }

            else
            {
                Console.WriteLine(result.Message);
            }
        }