Ejemplo n.º 1
0
 public string GetFilterName(object filtersCollection, FilterItemBase filter)
 {
     if (filter != null)
     {
         var count = CollectionViewModel.GetEntities(GetFilterExpression(filter)).Count();
         if (count > 0)
         {
             return(filter.Name + " (" + count + ")");
         }
         else
         {
             return(filter.Name);
         }
     }
     else
     {
         if (object.Equals(filtersCollection, StaticFilters))
         {
             return(StaticFiltersName);
         }
         if (object.Equals(filtersCollection, CustomFilters))
         {
             return(CustomFiltersName);
         }
         if (object.Equals(filtersCollection, Groups))
         {
             return(GroupFiltersName);
         }
     }
     return(null);
 }
Ejemplo n.º 2
0
        protected override void OnLoad(System.EventArgs e)
        {
            base.OnLoad(e);
            var expression = CollectionViewModel.GetExpression(ViewModel.FilterCriteria);

            if (expression != null)
            {
                foreach (Employee employee in CollectionViewModel.GetEntities(expression))
                {
                    selection.Add(employee.Id);
                }
            }
            gridControl.DataSource = CollectionViewModel.GetList();
        }