Esempio n. 1
0
 /// <summary>
 /// Lists filtered badges
 /// </summary>
 /// <param name="filters">Filters badges</param>
 /// <param name="pageAndOrder"></param>
 /// <returns></returns>
 public List <Badge> ListBadges(IEnumerable <IFilter <BadgeModel> > filters, IPageAndOrderable <BadgeModel> pageAndOrder)
 {
     Query.Filters = filters;
     Query.PageAndOrderModelFilterModel = pageAndOrder;
     using (UnitOfWorkProvider.Create())
     {
         return(GetList().ToList());
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Gets the count of rows in database filtered by filter
 /// Used for pagination
 /// </summary>
 /// <param name="filters"></param>
 /// <param name="pageAndOrder"></param>
 /// <returns></returns>
 public int GetCostInfosCount(IEnumerable <IFilter <CostInfoModel> > filters, IPageAndOrderable <CostInfoModel> pageAndOrder)
 {
     Query.Filters = filters;
     Query.PageAndOrderModelFilterModel = pageAndOrder;
     using (UnitOfWorkProvider.Create())
     {
         return(Query.GetTotalRowCount());
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Lists all plans that match filters criterias
 /// </summary>
 /// <param name="filters">Filters plans</param>
 /// <param name="pageAndOrder">Orders</param>
 /// <returns></returns>
 public List <Plan> ListPlans(IEnumerable <IFilter <PlanModel> > filters, IPageAndOrderable <PlanModel> pageAndOrder)
 {
     Query.Filters = filters;
     Query.PageAndOrderModelFilterModel = pageAndOrder;
     Query.AddSortCriteria(x => x.Start, SortDirection.Descending);
     using (UnitOfWorkProvider.Create())
     {
         return(GetList().ToList());
     }
 }