public void RemoveAccessibleLocation(SecLevel targetSecLevel, int locationId)
        {
            SqlCommand cmd = new SqlCommand("RemoveAccessibleLocation", _sqlConnection);

            cmd.CommandType = CommandType.StoredProcedure;

            SqlParameter secLevelParam = new SqlParameter("@targetSecLevelId", SqlDbType.Int);

            secLevelParam.Value = targetSecLevel.Id;
            cmd.Parameters.Add(secLevelParam);
            SqlParameter locationParam = new SqlParameter("@locationId", SqlDbType.Int);

            locationParam.Value = locationId;
            cmd.Parameters.Add(locationParam);

            cmd.ExecuteNonQuery();
        }
        public IList <SecLevel> GetSecLevels()
        {
            SqlCommand getUsers = new SqlCommand("SELECT * from GetSecLevels()", _sqlConnection);

            var reader = getUsers.ExecuteReader();

            List <SecLevel> result = new List <SecLevel>();

            while (reader.Read())
            {
                string name, description;
                int    id;
                id          = (int)reader["Id"];
                name        = (string)reader["LevelName"];
                description = (string)reader["LevelDescription"];

                var secLevel = new SecLevel(id, name, description);
                result.Add(secLevel);
            }

            reader.Close();

            return(result);
        }
 public IList <Location> GetSecLevelLocations(SecLevel secLevel)
 {
     return(GetSecLevelLocations(secLevel.Id));
 }
 public void RemoveAccessibleLocation(SecLevel targetSecLevel, Location location)
 {
     RemoveAccessibleLocation(targetSecLevel, location.Id);
 }