public OrderDisplay RetrieveOrderDisplay(int orderId) { OrderDisplay orderDisplay = new OrderDisplay(); // TODO - Code that retrives the defined order fields // Temp hard-coded values if (orderId == 10) { orderDisplay.FirstName = "Bilbo"; orderDisplay.LastName = "Baggins"; orderDisplay.OrderDate = new DateTimeOffset(2018, 4, 14, 10, 00, 00, new TimeSpan(0)); orderDisplay.ShippingAddress = new Address() { AddressType = 1, StreetLine1 = "Bag End", StreetLine2 = "Bagshot Row", City = "Hobbiton", State = "Shire", Country = "Middle Earth", PostalCode = "144" }; } orderDisplay.orderDisplayItemList = new List <OrderDisplayItem>(); // Code that retrieves the order items // Temp hard-coded order items if (orderId == 10) { var orderDisplayItem = new OrderDisplayItem() { ProductName = "Sunflowers", PurchasePrice = 15.96M, OrderQuantity = 2 }; orderDisplay.orderDisplayItemList.Add(orderDisplayItem); orderDisplayItem = new OrderDisplayItem() { ProductName = "Rake", PurchasePrice = 6M, OrderQuantity = 1 }; orderDisplay.orderDisplayItemList.Add(orderDisplayItem); } return(orderDisplay); }
public OrderDisplay RetrieveOrderDisplay(int orderId) { var orderDisplay = new OrderDisplay(); if (orderId == 10) { orderDisplay.FirstName = "Bilbo"; orderDisplay.LastName = "Baggins"; orderDisplay.OrderDate = new DateTimeOffset(2016, 2, 14, 0, 0, 0, new TimeSpan(3)); orderDisplay.Shipping = new Address() { AddressType = 1, StreetLine1 = "Bag End", StreetLine2 = "Bagshot row", City = "Hobbiton", State = "Shire", Country = "Middle Earth", PostalCode = "144" }; } orderDisplay.OrderDisplayitemsList = new List <OrderDisplayItems>(); if (orderId == 10) { var orderDisplayItem = new OrderDisplayItems() { ProductName = "Sunflowers", PurchasePrice = 15.96M, OrderQuantity = 2 }; orderDisplay.OrderDisplayitemsList.Add(orderDisplayItem); orderDisplayItem = new OrderDisplayItems() { ProductName = "Rake", PurchasePrice = 6M, OrderQuantity = 1 }; orderDisplay.OrderDisplayitemsList.Add(orderDisplayItem); } return(orderDisplay); }
public OrderDisplay RetrieveOrderDisplay(int orderId) { var orderDisplay = new OrderDisplay(); if (orderId == 10) { orderDisplay.FirstName = "Bilbo"; orderDisplay.LastName = "Baggins"; orderDisplay.OrderDate = new DateTimeOffset(2016, 2, 14, 0, 0, 0, new TimeSpan(3)); orderDisplay.Shipping = new Address() { AddressType = 1, StreetLine1 = "Bag End", StreetLine2 = "Bagshot row", City = "Hobbiton", State = "Shire", Country = "Middle Earth", PostalCode = "144" }; } orderDisplay.OrderDisplayitemsList = new List<OrderDisplayItems>(); if (orderId == 10) { var orderDisplayItem = new OrderDisplayItems() { ProductName = "Sunflowers", PurchasePrice = 15.96M, OrderQuantity = 2 }; orderDisplay.OrderDisplayitemsList.Add(orderDisplayItem); orderDisplayItem = new OrderDisplayItems() { ProductName = "Rake", PurchasePrice = 6M, OrderQuantity = 1 }; orderDisplay.OrderDisplayitemsList.Add(orderDisplayItem); } return orderDisplay; }