Пример #1
0
        //-> GetList
        public async Task <GetListDTO <FavouriteDriverViewDTO> > GetList(FavouriteDriverFindDTO findDTO)
        {
            IQueryable <FavouriteDriverFindResultDTO> query = from f in db.tblFavouriteDrivers
                                                              join c in db.tblCustomers on f.customerID equals c.id
                                                              join d in db.tblDrivers on f.driverID equals d.id
                                                              where f.deleted == null &&
                                                              (findDTO.customerID == 0 ? 1 == 1 : c.id == findDTO.customerID)
                                                              select new FavouriteDriverFindResultDTO
            {
                id           = f.id,
                driverCode   = d.driverCode,
                driverName   = d.driverName,
                customerCode = c.customerCode,
                customerName = c.customerName
            };

            query = query.AsQueryable().OrderBy($"{findDTO.orderBy} {findDTO.orderDirection}");
            return(await ListingHandler(findDTO.currentPage, query));
        }
Пример #2
0
 public async Task <ActionResult> Paging(FavouriteDriverFindDTO findDTO)
 {
     return(PartialView(await handler.GetList(findDTO)));
 }