コード例 #1
0
        public async Task <List <OrderListDto> > GetAllOrderView(int pageIndex, int pageSize)
        {
            using (var orderDetailsService = new OrderDetailsService())
            {
                var list = await orderDetailsService.GetAllByPageOrder(pageSize, pageIndex, false)
                           .Include(p => p.Order).Include(p => p.Sender).Include(p => p.Receiver)
                           .Select(p => new OrderListDto()
                {
                    OrderId         = p.Order.BarCode,
                    CargoName       = p.CargoName,
                    CargoWeight     = p.CargoWeight,
                    CargoVolume     = p.CargoVolume,
                    UnitNUm         = p.UitNum,
                    InsuredValue    = p.IsInsured ? "1" : "0",
                    Status          = p.Order.Status,
                    SenderAddress   = p.Sender.Provinces + p.Sender.DetailAddress,
                    ReceiverAddress = p.Receiver.Provinces + p.Receiver.DetailAddress,
                    SenderId        = p.SenderId,
                    ReceiverId      = p.ReceiverId,
                }).ToListAsync();

                return(list);
            }
        }