public override void ComposeFilters(IEnumerable <User> users) { MasterFilters = FilterItems; FilterItems = new List <FilterItem>(); foreach (var item in _intFilter) { var fItem = new FilterItem(_checkedItems.Contains(item.Key)) { Count = users.Where(item.Value).Count(), ValueText = item.Key }; FilterItems.Add(fItem); } MasterFilters = FilterItems; }
public override void ComposeFilters(IEnumerable <Circle> items) { MasterFilters = FilterItems; FilterItems = new List <FilterItem>(); foreach (var item in items) { var fItem = new FilterItem(_checkedItems.Contains(item.Name)) { Count = item.Members.Count, ValueText = item.Name, ItemId = item.CircleId, Url = Routes.EditCircle }; FilterItems.Add(fItem); } }
public override void ComposeFilters(IEnumerable<User> users) { MasterFilters = FilterItems; FilterItems = new List<FilterItem>(); var verfiedUsers = users.Where(u => u.EmailConfirmedOn != null) .ToList(); var cfItem = new FilterItem(_checkedItems.Contains(CONN)) { Count = verfiedUsers.Count, ValueText = CONN }; FilterItems.Add(cfItem); var ncfItem = new FilterItem(_checkedItems.Contains(N_CONN)) { Count = users.Count() - verfiedUsers.Count, ValueText = N_CONN }; FilterItems.Add(ncfItem); MasterFilters = FilterItems; }
public override void ComposeFilters(IEnumerable <User> users) { MasterFilters = FilterItems; FilterItems = new List <FilterItem>(); var verfiedUsers = users.Where(u => u.EmailConfirmedOn != null) .ToList(); var cfItem = new FilterItem(_checkedItems.Contains(CONN)) { Count = verfiedUsers.Count, ValueText = CONN }; FilterItems.Add(cfItem); var ncfItem = new FilterItem(_checkedItems.Contains(N_CONN)) { Count = users.Count() - verfiedUsers.Count, ValueText = N_CONN }; FilterItems.Add(ncfItem); MasterFilters = FilterItems; }
public override void ComposeFilters(IEnumerable<User> users) { MasterFilters = FilterItems; FilterItems = new List<FilterItem>(); var connectSrv = new ConnectService(); var connIds = connectSrv.GetConnectReqIds(ConnectStatusType.Accepted); var connUsers = users.Where(u => connIds.Contains(u.UserId)) .ToList(); var cfItem = new FilterItem(_checkedItems.Contains(CONN)) { Count = connUsers.Count, ValueText = CONN }; FilterItems.Add(cfItem); var ncfItem = new FilterItem(_checkedItems.Contains(N_CONN)) { Count = users.Count() - connUsers.Count, //Count = users.Count(u => !u.IsRelative()) - connUsers.Count, ValueText = N_CONN }; FilterItems.Add(ncfItem); MasterFilters = FilterItems; }