Exemple #1
0
        public static UserGroupInfo GetGroupByName(string strModelName)
        {
            List <UserGroupInfo> list = (List <UserGroupInfo>)UserGroup.GetCacheUserGroupList();
            UserGroupInfo        result;

            if (list != null && list.Count > 0)
            {
                result = (from p in list
                          where p.GroupName == strModelName
                          select p).FirstOrDefault <UserGroupInfo>();
            }
            else
            {
                result = null;
            }
            return(result);
        }
Exemple #2
0
        public static UserGroupInfo GetCacheUserGroupById(int intUserGroupID)
        {
            UserGroupInfo         result             = null;
            IList <UserGroupInfo> cacheUserGroupList = UserGroup.GetCacheUserGroupList();

            if (cacheUserGroupList != null && cacheUserGroupList.Count > 0)
            {
                foreach (UserGroupInfo current in cacheUserGroupList)
                {
                    if (current.AutoID == intUserGroupID)
                    {
                        result = current;
                        break;
                    }
                }
            }
            return(result);
        }