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); } }
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); } }
public void AddToAccessList(Badges newBadge) { _badgesDictionary.Add(newBadge.BadgeID, newBadge.DoorAccess); }
public void AddBadgeToDictionary(Badges badge) { BadgeDictionary.Add(badge.BadgeID, badge); }
public void AddBadge(Badges badge) { _doorAccess.Add(badge.BadgeID, badge.DoorAccess); }