Ejemplo n.º 1
0
        private void ProvideComments()
        {
            UserCommentsEntity uce = new UserCommentsEntity();

            try
            {
                var lst = abal.GetProducts();
                Console.WriteLine("{0,10}{1,20}{2,20}{3,20}", "ID", "Product Name", "Price", "Discount");
                foreach (var l in lst)
                {
                    Console.WriteLine("{0,10}{1,20}{2,20}{3,20}", l.ProdId, l.ProductName, l.Price, l.Discount);
                }
                Console.WriteLine("Enter Product ID");
                uce.ProdID = int.Parse(Console.ReadLine());
                Console.WriteLine("Enter Comment on Product");
                uce.CommentDescription = Console.ReadLine();
                var res = ubal.AddCommentByProduct(uce);
                if (res)
                {
                    Console.WriteLine("User Comment on Product is Added Successfully");
                }
                Console.WriteLine("Do You Want to Continue(Y/N)?");
                char ans = char.Parse(Console.ReadLine());
                if ((ans == 'Y') || (ans == 'y'))
                {
                    MenuUser();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }