public PagedResultDto <PCPTBVT_DTO> SearchPCPTBVT(
     [FromBody] PCPTBVT_SEARCH_DTO inputFilter,
     string orderBy, bool desc = false,
     int?skip = null, int?take = null)
 {
     return(_service.PCPTBVT_Search(inputFilter, orderBy, desc, skip, take));
 }
Beispiel #2
0
        public PagedResultDto <PCPTBVT_DTO> PCPTBVT_Search(
            PCPTBVT_SEARCH_DTO inputFilter,
            string orderBy = null,
            bool desc      = false,
            int?skip       = null,
            int?take       = null)
        {
            if (!inputFilter.CREATE_DT_START.HasValue)
            {
                inputFilter.CREATE_DT_START = DateTime.Parse("1800-01-01");
            }
            if (!inputFilter.CREATE_DT_END.HasValue)
            {
                inputFilter.CREATE_DT_END = DateTime.Parse("9999-12-31");
            }
            IEnumerable <PCPTBVT_DTO> list = procedureHelper.GetData <PCPTBVT_DTO>("PhieuCapPhatTBVTYT_Search", inputFilter);

            var totalCount = list.Count();

            list = SortAndLimit(list.AsQueryable(), orderBy, desc, skip, take);
            // result
            return(new PagedResultDto <PCPTBVT_DTO>(
                       totalCount,
                       list.ToList()));
        }