Пример #1
0
        public static OrderDetailJson From(OrderDetail item)
        {
            var result = new OrderDetailJson()
            {
                OrderDetailId = item.OrderDetailId,
                OrderId       = item.OrderId,
                ItemKey       = item.AlbumId,
                Quantity      = item.Quantity,
                UnitPrice     = item.UnitPrice
            };

            return(result);
        }
Пример #2
0
        public static List <OrderDetailJson> From(List <OrderDetail> items)
        {
            List <OrderDetailJson> results = new List <OrderDetailJson>();

            if (items == null)
            {
                return(results);
            }

            foreach (var a in items)
            {
                results.Add(OrderDetailJson.From(a));
            }
            return(results);
        }
Пример #3
0
 public static OrderDetail From(OrderDetailJson item)
 {
     if (item != null)
     {
         return(new OrderDetail()
         {
             OrderDetailId = item.OrderDetailId,
             OrderId = item.OrderId,
             AlbumId = item.ItemKey,
             Quantity = item.Quantity,
             UnitPrice = item.UnitPrice
         });
     }
     else
     {
         return(new OrderDetail());
     }
 }
Пример #4
0
        public static OrderJson From(Order item)
        {
            var result = new OrderJson()
            {
                OrderId      = item.OrderId,
                OrderDate    = item.OrderDate,
                Username     = item.Username,
                FirstName    = item.FirstName,
                LastName     = item.LastName,
                Address      = item.Address,
                City         = item.City,
                State        = item.State,
                PostalCode   = item.PostalCode,
                Country      = item.Country,
                Phone        = item.Phone,
                Email        = item.Email,
                Total        = item.Total,
                OrderDetails = OrderDetailJson.From(item.OrderDetails)
            };

            return(result);
        }