public List <SPGetConfig_Result> Filter(SystemConfigQuery query, out int count)
        {
            count = 0;
            int pageNumber = query.PageNumber != 0 ? query.PageNumber : 1;
            var keyword    = string.IsNullOrEmpty(query.Keyword) != true ? query.Keyword : "";
            var start      = 0;
            var limit      = query.PageSize;

            start = (pageNumber - 1) * limit;
            int totalRow = 0;
            List <SPGetConfig_Result> result     = new List <SPGetConfig_Result>();
            ObjectParameter           prTotalRow = new ObjectParameter("total", totalRow);

            result = _entities.SPGetConfig(Util.DetecVowel(keyword), start, limit, prTotalRow).ToList();
            count  = (prTotalRow.Value == null) ? 0 : Convert.ToInt32(prTotalRow.Value);
            return(result);
        }
Esempio n. 2
0
        public BaseListResponse <SPGetConfig_Result> FilterSystemConfig(SystemConfigQuery query)
        {
            var response = new BaseListResponse <SPGetConfig_Result>();
            int count    = 0;

            try
            {
                response.Data       = _systemConfigRepository.Filter(query, out count);
                response.TotalItems = count;
                response.PageNumber = query.PageNumber != 0 ? query.PageNumber : 1;
                response.PageSize   = query.PageSize;
            }
            catch (Exception ex)
            {
                response.Message = "Error: " + ex.Message + " StackTrace: " + ex.StackTrace;
            }
            return(response);
        }
Esempio n. 3
0
 public BaseListResponse <SPGetConfig_Result> Search([FromUri] SystemConfigQuery query)
 {
     return(shareService.FilterSystemConfig(query));
 }