Пример #1
0
        public PizzaBox.Domain.Models.MOrder Map(Entity.Order pizza)
        {
            return(new PizzaBox.Domain.Models.MOrder
            {
                ListOfPizzas = (List <Domain.Models.CustomPizza>)pizza.Pizzas,
                Customer = new Domain.Models.MCustomer
                {
                    username = pizza.Customer.Username,
                    password = pizza.Customer.Password,
                    CustomerID = (int)pizza.CustomerId,
                    FirstName = pizza.Customer.CustomerFirstName,
                    LastName = pizza.Customer.CustomerLastName,
                    PhoneNumber = pizza.Customer.CustomerPhone,
                    Address = pizza.Customer.CustomerAddress,
                    CardNumber = pizza.Customer.CustomerCardNumber,
                    CardCode = pizza.Customer.CustomerCardCvv,
                    CardExpDate = pizza.Customer.CustomerCardDate
                },
                Store = new Domain.Models.Store
                {
                    StoreLocation = pizza.Store.StoreLocation,
                    StoreID = pizza.Store.StoreId
                },

                OrderID = pizza.OrderId,

                Cost = pizza.Cost
            });
        }
        public PizzaBox.Domain.Models.MOrder Map(Entity.Order order)
        {
            return(new PizzaBox.Domain.Models.MOrder
            {
                CustomerId = order.CustomerId,
                StoreId = (int)order.StoreId,


                OrderID = order.OrderId,

                Cost = order.Cost,

                time = (DateTime)order.OrderDate
            });
        }