예제 #1
0
        public PurchaseOrder CreateOrder(IPurchaseOrderBuilder orderBuilder)
        {
            var order = orderBuilder.WithType("Huawei")
                        .ForCompany("KLa")
                        .AtAddress("Hongyuan Ba Cun")
                        .FromVendor(new Vendor())
                        .RequestedBy(DateTime.Now)
                        .BuildPurchaseOrder();

            return(order);
        }
예제 #2
0
        public PurchaseOrder CreateOrder(IPurchaseOrderBuilder orderBuilder)
        {
            //var order = orderBuilder.WithType("Fairy Tale")
            //    .ForCompany("KLa")
            //    .AtAddress("Lane 887")
            //    .FromVendor(new Vendor())
            //    .RequestedBy(DateTime.Now)
            //    .BuildPurchaseOrder();

            orderBuilder.WithType("Fairy Tale")
            .ForCompany("KLa")
            .AtAddress("Lane 887")
            .FromVendor(new Vendor())
            .RequestedBy(DateTime.Now)
            .BuildPurchaseOrder();
            var order = new PurchaseOrder("");

            if (orderBuilder is FluentBookOrderBuilder bookOrderBuilder)
            {
                order = bookOrderBuilder;
            }
            return(order);
        }