Exemple #1
0
 public static int GetTotalCount(HuntingEntities dataContext, AclUserFilter filter)
 {
     try
     {
         var generator  = new AclUserListGenerator(filter);
         var totalCount = QueryGenerator.GetTotalCount(dataContext, generator);
         return(totalCount);
     }
     catch (Exception exception)
     {
         logger.Error(exception, "GetTotalCount");
         return(0);
     }
 }
Exemple #2
0
 public static ItemListHolder <AclUserListItem> GetList(HuntingEntities dataContext, AclUserFilter filter, int pageIndex)
 {
     try
     {
         var generator  = new AclUserListGenerator(filter);
         var list       = QueryGenerator.ReadPagedList <AclUserListItem>(dataContext, generator, pageIndex, Constants.DEFAULT_LIST_PAGE_SIZE);
         var itemHolder = new ItemListHolder <AclUserListItem>(list);
         itemHolder.TotalCount = GetTotalCount(dataContext, filter);
         return(itemHolder);
     }
     catch (Exception exception)
     {
         logger.Error(exception, "GetList");
         return(new ItemListHolder <AclUserListItem>());
     }
 }