Exemplo n.º 1
0
 public List<Group> GetGroups(int accountId)
 {
     var query = GetAllGroups();
     if (accountId > 0)
     {
         var account = new AccountDao().GetAccount(accountId);
         if (string.IsNullOrEmpty(account.Groups))
         {
             return new List<Group>();
         }
         var groupIds = account.Groups.Split(',').Select(s => int.Parse(s));
         return query.Where(e => groupIds.Contains(e.GroupId)).ToList();
     }
     else
     {
         return query;
     }
 }
Exemplo n.º 2
0
        public List <Group> GetGroups(int accountId)
        {
            var query = GetAllGroups();

            if (accountId > 0)
            {
                var account = new AccountDao().GetAccount(accountId);
                if (string.IsNullOrEmpty(account.Groups))
                {
                    return(new List <Group>());
                }
                var groupIds = account.Groups.Split(',').Select(s => int.Parse(s));
                return(query.Where(e => groupIds.Contains(e.GroupId)).ToList());
            }
            else
            {
                return(query);
            }
        }