Пример #1
0
        public bool UpdateExistingBadges(int originalBadgeID, Badges newBadge)
        {
            Badges oldBadge = GetBadgeByID(originalBadgeID);

            if (oldBadge != null)
            {
                oldBadge.BadgeID     = newBadge.BadgeID;
                oldBadge.ListOfDoors = newBadge.ListOfDoors;

                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #2
0
        public bool RemoveRoomToBadge(Badges updateBadge)
        {
            if (_badgesDictionary.ContainsKey(updateBadge.BadgeID))
            // foreach(KeyValuePair<int, List<string>> kvp in _badgesDictionary.Where(kvp => kvp.Key.Equals(updateBadge.BadgeID)))
            {
                foreach (string s in updateBadge.DoorAccess)
                {
                    _badgesDictionary[updateBadge.BadgeID].Remove(s);
                }

                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #3
0
 public void AddToAccessList(Badges newBadge)
 {
     _badgesDictionary.Add(newBadge.BadgeID, newBadge.DoorAccess);
 }
Пример #4
0
 public void AddBadgeToDictionary(Badges badge)
 {
     BadgeDictionary.Add(badge.BadgeID, badge);
 }
Пример #5
0
 public void AddBadge(Badges badge)
 {
     _doorAccess.Add(badge.BadgeID, badge.DoorAccess);
 }