Exemple #1
0
        static void Main(string[] args)
        {
            ProductManager productManager = new ProductManager(new EfProductDal());

            foreach (var product in productManager.GetByUnitPrice(40, 100))

            {
                Console.WriteLine(product.ProductName);
            }
        }
        private static void ProductTest()
        {
            ProductManager productManager = new ProductManager(new EfProductDal());

            foreach (var product in productManager.GetByUnitPrice(40, 100).Data)
            {
                Console.WriteLine(product.ProductName);
                // Console.WriteLine(" : " + product.UnitPrice + " $");
            }
            // ***** YUKARISI 9. DERS ÖNCESİ TESTİ...
        }
Exemple #3
0
        //private static void ProductTest()
        //{
        //    ProductManager productManager = new ProductManager(new EfProductDal());
        //    var result = productManager.GetProductDetails();
        //    //GetByUnitPriceMethod(productManager);

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

        private static void GetByUnitPriceMethod(ProductManager productManager)
        {
            var result = productManager.GetByUnitPrice(50, 300);

            Console.WriteLine(result.Message);

            foreach (var product in result.Data)
            {
                Console.WriteLine(product.ProductName + " - " + product.UnitPrice);
            }
        }
Exemple #4
0
        private static void ProductTest()
        {
            ProductManager productManager = new ProductManager(new EfProductDal(), new CategoryManager(new EfCategoryDal()));
            var            liste          = productManager.GetByUnitPrice(1, 10);

            foreach (var item in liste.Data)
            {
                Console.WriteLine(item.ProductName);
                Console.WriteLine("Fiyatı : " + item.UnitPrice);
                Console.WriteLine();
            }
        }
        private static void ProductTest()
        {
            ProductManager productManager = new ProductManager(new EfProductDal());

            foreach (var product in productManager.GetAllByCategory(2))
            {
                Console.WriteLine(product.ProductName);
            }

            foreach (var product in productManager.GetByUnitPrice(40, 100))
            {
                Console.WriteLine(product.ProductName);
            }
        }
Exemple #6
0
        private static void ProductTest()
        {
            ProductManager productManager = new ProductManager(new EfProductDal(), new CategoryManager(new EfCategoryDal()));

            foreach (var product in productManager.GetAllByCategoryId(2).Data)
            {
                Console.WriteLine(product.ProductName);
            }

            Console.WriteLine("\n Ürünler Bunlar! -----------***************----------\n");

            foreach (var product in productManager.GetByUnitPrice(50, 100).Data)
            {
                Console.WriteLine(product.ProductName);
            }
        }
Exemple #7
0
        private static void ProductTest()
        {
            ProductManager productManager = new ProductManager(new EfProductDal(), new CategoryManager(new EfCategoryDal()));

            foreach (var product in productManager.GetAllByCategoryId(2).Data)
            {
                Console.WriteLine(product.ProductName + " --> " + product.CategoryId);
            }

            Console.WriteLine("\n****************************\n");

            foreach (var product in productManager.GetByUnitPrice(40, 100).Data)
            {
                Console.WriteLine(product.ProductName + " --> " + product.UnitPrice);
            }
        }
Exemple #8
0
        private static void GetByUnitPrice()
        {
            ProductManager productManager = new ProductManager(new EfProductDal(), new CategoryManager(new EfCategoryDal()));
            var            result         = productManager.GetByUnitPrice(10, 20);

            foreach (var item in result.Data)
            {
                if (result.Success)
                {
                    Console.WriteLine(item.ProductId + " - " + item.ProductName + " - " + item.UnitPrice);
                }
                else
                {
                    Console.WriteLine(result.Message);
                }
            }
        }
        private static void ProductTest()
        {
            ProductManager productManager1 = new ProductManager(new EfProductDal()
                                                                , new CategoryManager(new EfCategoryDal()));
            var result = productManager1.GetProductDetails();

            if (result.success)
            {
                foreach (var product in result.Data)
                {
                    Console.WriteLine(product.ProductName + "     " + product.CategoryName);
                }
            }
            else
            {
                Console.WriteLine(result.message);
            }
            var result1 = productManager1.GetAll();

            if (result1.success)
            {
                foreach (var product in result1.Data)
                {
                    Console.WriteLine(product.ProductName);
                }
            }
            else
            {
                Console.WriteLine(result1.message);
            }

            Console.WriteLine("-----------------------");
            foreach (var product in productManager1.GetByCategoryId(4).Data)
            {
                Console.WriteLine(product.ProductName);
            }
            Console.WriteLine("-----------------------");
            foreach (var product in productManager1.GetByUnitPrice(40, 90).Data)
            {
                Console.WriteLine(product.ProductName);
            }
            foreach (var product in productManager1.GetProductDetails().Data)
            {
                Console.WriteLine(product.ProductName + "     " + product.CategoryName);
            }
        }
Exemple #10
0
        static void Main(string[] args)
        {
            ProductManager categoryManager = new ProductManager(new EfProductDal(), new CategoryManager(new EfCategoryDal()));
            Product        product         = new Product {
                CategoryId = 2, ProductName = "Ozztech Ayakkabı", UnitPrice = 1500, UnitsInStock = 132
            };

            foreach (var item in categoryManager.GetByUnitPrice(15, 20).Data)
            {
                Console.WriteLine(item.UnitPrice);
            }
            Console.WriteLine("==========================================");
            foreach (var item in categoryManager.GetProductDetails().Data)
            {
                Console.WriteLine(item.CategoryName + " - " + item.ProductName);
            }
        }
Exemple #11
0
        private static void ProductTest()
        {
            IProductService productService = new ProductManager(new EfProductDal(), new CategoryManager(new EfCategoryDal()));

            var result = productService.GetProductDetails();

            if (result.Success)
            {
                foreach (var product in productService.GetByUnitPrice(50, 5000).Data)
                {
                    Console.WriteLine(product.ProductName + " " + product.CategoryId + " " + product.UnitPrice);
                }
            }
            else
            {
                Console.WriteLine(result.Message);
            }
        }
Exemple #12
0
        private static void ProductTest()
        {
            ProductManager productManager = new ProductManager(new EfProductDal());

            var result = productManager.GetByUnitPrice(50, 100);

            if (result.Success == true)
            {
                foreach (var product in result.Data)
                {
                    Console.WriteLine(product.ProductName + product.UnitPrice);
                }
            }
            else
            {
                Console.WriteLine("Hata Mesajı");
            }
        }
Exemple #13
0
        static void Main(string[] args)
        {
            ProductManager productManager = new ProductManager(new EfProductDal());

            //foreach (var product in productManager.GetAll())
            //{
            //    Console.WriteLine(product.ProductName);
            //}

            //foreach (var product in productManager.GetAllByCategoryId(2))
            //{
            //    Console.WriteLine(product.ProductName);
            //}

            foreach (var product in productManager.GetByUnitPrice(50, 100))
            {
                Console.WriteLine(product.ProductName);
            }
        }
Exemple #14
0
        private static void ProductTest()
        {
            ProductManager productManager = new ProductManager(new EFProductDal());

            foreach (var item in productManager.GetAll())
            {
                Console.WriteLine(item.ProductId + "   " + item.ProductName + "    " + item.UnitPrice);
            }
            Console.WriteLine("-----------------------");
            foreach (var item in productManager.GetAllByCatergoryId(2))
            {
                Console.WriteLine(item.ProductId + "   " + item.ProductName + "    " + item.UnitPrice);
            }
            Console.WriteLine("-----------------------");
            foreach (var item in productManager.GetByUnitPrice(40, 100))
            {
                Console.WriteLine(item.ProductId + "   " + item.ProductName + "    " + item.UnitPrice);
            }
        }
Exemple #15
0
        private static void ProductTest()
        {
            ProductManager productManager = new ProductManager(new EfProductDal(), new CategoryManager(new EfCategoryDal()));

            foreach (var product in productManager.GetAll().Data)
            {
                Console.WriteLine(product.ProductName);
            }

            Console.WriteLine("-------CATEGORY ID-------------");
            foreach (var product in productManager.GetAllByCategoryId(2).Data)
            {
                Console.WriteLine(product.ProductName);
            }

            Console.WriteLine("-------UNITPROCE MIN-MAX-------------");
            foreach (var product in productManager.GetByUnitPrice(50, 100).Data)
            {
                Console.WriteLine("Name: {0} -- Price: {1}", product.ProductName, product.UnitPrice);
            }
            Console.WriteLine("-------PRODUCT NAME => CATEGORY NAME-------------");

            //Assagıdaki gibi degistirdik
            //foreach (var product in productManager.GetProductDetails ())
            //{
            //    Console.WriteLine(product.ProductName+" ----> "+product.CategoryName);
            //}

            var result = productManager.GetProductDetails();

            if (result.Success)
            {
                foreach (var product in result.Data)
                {
                    Console.WriteLine((product.ProductName + " / " + product.CategoryName));
                }
            }
            else
            {
                Console.WriteLine(result.Message);
            }
        }
        private static void ProductTest()
        {
            ProductManager productManager = new ProductManager(new EfProductDal(), new CategoryManager(new EfCategoryDal()));

            var result = productManager.GetByUnitPrice(50, 100);

            if (result.Success)
            {
                foreach (var product in result.Entity)
                {
                    Console.WriteLine(product.CategoryID + "---- " + product.ProductID + "--- " + product.ProductName);
                }
                Console.WriteLine("-***********-");
                Console.WriteLine(result.Message);
            }
            else
            {
                Console.WriteLine(result.Message);
            }
        }
Exemple #17
0
        private static void ProductMethod()
        {
            ProductManager productManager = new ProductManager(new EfProductDal());

            Console.WriteLine("************************Tüm ürün isimleri listelendi.*************************");
            foreach (var product in productManager.GetAll().Data)
            {
                Console.WriteLine(product.ProductName);
            }
            Console.WriteLine("*********************Category Id ye göre listelendi.********************");
            foreach (var product in productManager.GetAllByCategoryId(5).Data)
            {
                Console.WriteLine(product.ProductName);
            }
            Console.WriteLine("********************Fiyat aralığına göre listelendi.*******************");
            foreach (var product in productManager.GetByUnitPrice(3, 6).Data)
            {
                Console.WriteLine(product.ProductName);
            }
        }
Exemple #18
0
        private static void ProductUnitPriceTest()
        {
            ProductManager productManager = new ProductManager(new EfProductDal(), new CategoryManager(new EfCategoryDal()));

            var result = productManager.GetByUnitPrice(40, 100);

            if (result.Success == true)
            {
                Console.WriteLine("\n############ BELİRTİLLEN FİYAT ARALIĞINDAKİ ÜRÜNLER ############\n");

                foreach (var product in result.Data)
                {
                    Console.WriteLine("{0}: {1}", product.ProductId, product.ProductName);
                }
            }

            else
            {
                Console.WriteLine(result.Message);
            }
        }
Exemple #19
0
 private static void ProductTest(ProductManager productManager)
 {
     foreach (var product in productManager.GetAll().Data)
     {
         Console.WriteLine(product.ProductName);
     }
     Console.WriteLine("-------------------");
     foreach (var product in productManager.GetAllByCategoryId(2).Data)
     {
         Console.WriteLine(product.ProductName);
     }
     Console.WriteLine("-------------------");
     foreach (var product in productManager.GetByUnitPrice(40, 100).Data)
     {
         Console.WriteLine(product.ProductName);
     }
     Console.WriteLine("-------------------");
     foreach (var product in productManager.GetProductDetails().Data)
     {
         Console.WriteLine(product.ProductName + "/" + product.CategoryName);
     }
 }
        static void Main(string[] args)
        {
            //InMemoryProductDal inMemoryProductDal = new InMemoryProductDal();

            //ProductManager productManager = new ProductManager(inMemoryProductDal);
            //foreach (var product in productManager.GetAll())
            //{
            //    Console.WriteLine(product.ProductName);
            //}


            ProductManager productManager = new ProductManager(new EfProductDal());

            //foreach (var product in productManager.GetAll())
            //{
            //    Console.WriteLine(product.ProductName);
            //}

            foreach (var product in productManager.GetByUnitPrice(50, 100))
            {
                Console.WriteLine(product.ProductName);
            }
        }
Exemple #21
0
        private static void ProductTest()
        {
            ProductManager productManager = new ProductManager(new EfProductDal(), new CategoryManager(new EfCategoryDal()));


            Console.WriteLine("------------------ALL------------------------");

            var resultAll = productManager.GetAll();

            if (resultAll.Success == true)
            {
                foreach (var product in productManager.GetAll().Data)
                {
                    Console.WriteLine(product.ProductName);
                }
            }
            else
            {
                Console.WriteLine(resultAll.Message);
            }



            Console.WriteLine("------------------CATEGORY ID = 2------------------------");

            var resultCategoryId = productManager.GetAllByCategoryId(2);

            if (resultCategoryId.Success == true)
            {
                foreach (var product in productManager.GetAllByCategoryId(2).Data)
                {
                    Console.WriteLine(product.ProductName);
                }
            }
            else
            {
                Console.WriteLine(resultCategoryId.Message);
            }



            Console.WriteLine("------------------PRICE MIN = 40 MAX = 100------------------------");

            var resultPrice = productManager.GetByUnitPrice(40, 100);

            if (resultPrice.Success == true)
            {
                foreach (var product in productManager.GetByUnitPrice(40, 100).Data)
                {
                    Console.WriteLine(product.ProductName);
                }
            }
            else
            {
                Console.WriteLine(resultPrice.Message);
            }


            Console.WriteLine("------------------ProductName + / + CategoryName------------------------");

            var resultCategoryName = productManager.GetProductDetails();

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