Пример #1
0
        public IEnumerable<Role> GetRestrictedRolesThatAreFull(int eventID)
        {
            CharacterInterface charinterface = new CharacterInterface(LeetRaidsDB);

            Event evtInfo = GetEventInfoByID(eventID);

            List<RoleCount> roles = (from r in LeetRaidsDB.Roles
                                  where r.GameID == evtInfo.GameID
                                     select new RoleCount() { RoleID = r.RoleID, Count = 0 }).ToList(); ;

            foreach (RoleCount r in roles)
            {
                r.Count = GetAllEventAttendees(eventID).Where(attn => attn.RoleID == r.RoleID).ToList().Count;
            }

            IEnumerable<Role> restrictedRoles = from roleRestr in GetRoleRestrictionsByEvent(eventID)
                                                where roleRestr.Quantity > 0 && roleRestr.Quantity <= roles.Where(r => r.RoleID == roleRestr.RoleID).SingleOrDefault().Count
                                                select charinterface.GetRoleByID(roleRestr.RoleID);
            return restrictedRoles;
        }
Пример #2
0
        public IEnumerable<Role> GetRestrictedRoles(int eventID)
        {
            CharacterInterface charinterface = new CharacterInterface(LeetRaidsDB);
            IEnumerable<Role> restrictedRoles = from roleRestr in GetRoleRestrictionsByEvent(eventID)
                                                select charinterface.GetRoleByID(roleRestr.RoleID);

            return restrictedRoles;
        }