//UPDATE public bool UpdateExistingBadgeDir(int existingBadgeID, BadgeAccessDir newData) { //Find the original content BadgeAccessDir currentData = GetDataByBadgeID(existingBadgeID); //Update the content if (currentData != null) { currentData.BadgeID = newData.BadgeID; currentData.DoorAccess = newData.DoorAccess; return(true); } else { return(false); } }
//DELETE public bool RemoveDataFromBadgeDir(double badgeID) { BadgeAccessDir data = GetDataByBadgeID(badgeID); if (data == null) { return(false); } int intialCount = _badgeDir.Count; _badgeDir.Remove(data); if (intialCount > _badgeDir.Count) { return(true); } else { return(false); } }
//Dirtionary //CRUD //CREATE public void AddDataToList(BadgeAccessDir data) { _badgeDir.Add(data); }