public static List <JoinedOrder> showOrder()
        {
            var orderStore = new OrderStore()
            {
                Path = orderPath
            };
            var orderList  = orderStore.GetCollection();
            var routeStore = new RouteStore()
            {
                Path = routePath
            };
            var routeList = routeStore.GetCollection();

            var orderAndLoad = orderList
                               .Join(LoadManager.showLoad(), order => order.LoadId, load => load.Id, (order, load) => new
            {
                order,
                load
            })
                               .Join(routeList, order => order.order.RouteId, route => route.Id, (order, route) => new JoinedOrder
            {
                Id           = order.order.Id,
                Path         = route.Path,
                LoadId       = order.load.Id,
                Category     = order.load.Description,
                Phone        = order.load.Phone,
                OrderDate    = order.order.OrderDate,
                DeliveryDate = order.order.DeliveryDate,
                TotalCost    = order.order.TotalCost,
            })
                               .ToList();

            return(orderAndLoad);
        }
示例#2
0
        public static List <Route> showRoute()
        {
            var routeStore = new RouteStore()
            {
                Path = routePath
            };
            var routeList = routeStore.GetCollection();

            return(routeList);
        }