internal static OrderClass Map(OrderUI Order) { if (Order == null) { return(null); } OrderClass ret = new OrderClass() { OrderID = Order.OrderID, DeliveryAddress = Map(Order.DeliveryAddress), Store = Map(Order.Store), Customer = Map(Order.Customer), DatePlaced = Order.DatePlaced }; foreach (var zaa in Order.pizzas) { ret.pizzas.Add(Map(zaa)); } ret.UpdateTotal(); return(ret); }
internal static OrderUI Map(OrderClass Order) { if (Order == null) { return(null); } OrderUI ret = new OrderUI() { OrderID = Order.OrderID, DeliveryAddress = Map(Order.DeliveryAddress), Store = Map(Order.Store), Customer = Map(Order.Customer), CostBeforeTax = Order.CostBeforeTax, TotalCost = Order.TotalCost, DatePlaced = Order.DatePlaced }; foreach (var zaa in Order.pizzas) { ret.pizzas.Add(Map(zaa)); ret.pizzaIDs.Add(zaa.PizzaID); } return(ret); }