예제 #1
0
        public static Order MapOrder(Entities.OrderInfo OI)
        {
            var   store = MapStore(OI.Store);
            var   cust  = MapCustomer(OI.Customer);
            Order h     = new Order(cust, store, OI.Id, OI.OrderTime);

            foreach (Entities.OrderDetails item in OI.OrderDetails)
            {
                var prod = MapMerch(item.ProductNameNavigation);
                h.details.Add(prod, item.Order.MerchAmount);
            }
            return(h);
        }
예제 #2
0
        public static Order MapOrder(Entities.OrderInfo OI)
        {
            var   store = OI.Store is null ? null : MapStore(OI.Store);
            var   cust  = MapCustomer(OI.Customer);
            Order h     = new Order(cust, store, OI.Id, OI.OrderTime);

            foreach (Entities.OrderDetails item in OI.OrderDetails)
            {
                var prod = MapMerch(item.Merch);
                h.details.Add(prod, item.Stock);
            }
            return(h);
        }