Example #1
0
 public void InitializeOrderList()
 {
     MyOrders = new List<Order>();
     var client1Orders = new FakeClient1Order().MyOrders;
     foreach (var order in client1Orders)
     {
         MyOrders.Add(order);
     }
     var client2Orders = new FakeClient2Order().MyOrders;
     foreach (var order in client2Orders)
     {
         MyOrders.Add(order);
     }
     var client3Orders = new FakeClient3Order().MyOrders;
     foreach (var order in client3Orders)
     {
         MyOrders.Add(order);
     }
 }
        public Invoice FirstInvoice()
        {
            MyOrders = new List<Order>();
            var client3Orders = new FakeClient3Order().MyOrders;
            foreach (var order in client3Orders)
            {
                MyOrders.Add(order);
            }

            var firstOrder = MyOrders.FirstOrDefault();
            if (firstOrder == null) return null;
            var firstOrderCharge = new OrderCharge().Calculate(firstOrder);
            var firstOrderInvoice = new Invoice
            {
                InvoiceId = 3,
                OrderId = firstOrder.OrderId,
                ClientId = firstOrder.ClientId,
                OrderDate = firstOrder.OrderDate,
                DeliveryDate = firstOrder.DeliveryDate,
                CurrencyId = firstOrder.CurrencyId,

                CookerId = firstOrderCharge.CookerId,
                OrderTypeValue = firstOrderCharge.OrderTypeValue,
                PaymentMethodValue = firstOrderCharge.PaymentMethodValue,

                PromotionTitle = firstOrderCharge.PromotionTitle,
                PromotionPrice = firstOrderCharge.PromotionPrice,
                PromotionCurrencyId = firstOrderCharge.PromotionCurrencyId,

                CouponTitle = firstOrderCharge.CouponTitle,
                CouponPrice = firstOrderCharge.CouponPrice,
                CouponCurrencyId = firstOrderCharge.CouponCurrencyId,

                PlanTitle = firstOrderCharge.PlanTitle,
                SalesTax = firstOrderCharge.SalesTaxes,
                DeliveryFees = firstOrderCharge.DeliveryFee,
                SubTotal = firstOrderCharge.Subtotal,
                Total = firstOrderCharge.TotalCharges
            };
            return firstOrderInvoice;
        }