示例#1
0
        static void Main(string[] args)
        {
            ProductDirector director = new ProductDirector();
            var             builder  = new NewCustomerProductBuilder();

            director.DoWorks(builder);
            var product = builder.GetProduct();

            Console.WriteLine(product.ProductId);
            Console.WriteLine(product.ProductName);
            Console.WriteLine(product.CategoryName);
            Console.WriteLine(product.UnitPrice);
            Console.WriteLine(product.Discount);
            Console.WriteLine(product.AppliedDiscount);

            Console.ReadLine();
        }
示例#2
0
        static void Main(string[] args)
        {
            ProductDirector productDirector = new ProductDirector();
            var             builder         = new OldCustomerProductBuilder();

            productDirector.GenerateProduct(builder);
            var model = builder.GetModel();

            Console.WriteLine(model.Id);
            Console.WriteLine(model.CategoryName);
            Console.WriteLine(model.ProductName);
            Console.WriteLine(model.UnitPrice);
            Console.WriteLine(model.DiscountedPrice);
            Console.WriteLine(model.DiscountApplied);


            Console.ReadLine();
        }