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

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

            result = _entities.SPGetAspNetUsers(Util.DetecVowel(keyword), groupId, query.DepartmentId, start, limit, prTotalRow).ToList();
            count  = (prTotalRow.Value == null) ? 0 : Convert.ToInt32(prTotalRow.Value);
            return(result);
        }
Beispiel #2
0
        public BaseListResponse <SPGetAspNetUsers_Result> FilterAspNetUsers(AspNetUserQuery query)
        {
            var response = new BaseListResponse <SPGetAspNetUsers_Result>();
            int count    = 0;

            try
            {
                response.Data       = _userRepository.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);
        }
Beispiel #3
0
 public BaseListResponse <SPGetAspNetUsers_Result> Search([FromUri] AspNetUserQuery query)
 {
     return(_systemService.FilterAspNetUsers(query));
 }