Exemplo n.º 1
0
        //-> GetList
        public async Task <GetListDTO <DriverViewDTO> > GetList(DriverFindDTO findDTO)
        {
            IQueryable <tblDriver> query = db.tblDrivers.Where(x => x.deleted == null);

            if (!string.IsNullOrEmpty(findDTO.driverCode))
            {
                query = query.Where(x => x.driverCode.StartsWith(findDTO.driverCode));
            }
            if (!string.IsNullOrEmpty(findDTO.driverName))
            {
                query = query.Where(x => x.driverName.StartsWith(findDTO.driverName));
            }
            if (!string.IsNullOrEmpty(findDTO.phoneNumber))
            {
                query = query.Where(x => x.phoneNumber.StartsWith(findDTO.phoneNumber));
            }

            query = query.AsQueryable().OrderBy($"{findDTO.orderBy} {findDTO.orderDirection}");

            return(await ListingHandler(findDTO.currentPage, query));
        }
Exemplo n.º 2
0
 public async Task <ActionResult> Paging(DriverFindDTO findDTO)
 {
     return(PartialView(await handler.GetList(findDTO)));
 }