//does nothing with pizzas public static DBData.PizzaOrder Map(Order order) { DBData.PizzaOrder o = new DBData.PizzaOrder(); o.Id = order.IdFull(); o.OrderTime = order.Time; o.StoreId = order.Store.Id; o.Total = order.Price(); o.Username = order.Customer.Name; return(o); }
public static Order Map(DBData.PizzaOrder order) { Order o = new Order( User.TryUser(order.Username), Store.GetStore(order.StoreId), order.OrderTime, (int)Math.Truncate(order.Id) ); //gets pizzas var pizzas = PizzaRepository.Repo().GetPizzas(order.Id); foreach (DBData.Pizza p in pizzas) { for (int i = 0; i < p.Quantity; i++) { o.AddPizza(new Pizza(p.Code)); } } return(o); }