/// <summary>
        /// return true if confidentiality might effect result
        /// </summary>
        public static bool IsAffectedByConfidentiality(int facilityID, string pollutantCode)
        {
            //Find data for confidential in the group of the pollutant
            LOV_POLLUTANT pollutant = ListOfValues.GetPollutant(pollutantCode);

            string groupCode = pollutant.ParentID.HasValue ? ListOfValues.GetPollutant(pollutant.ParentID.Value).Code : pollutantCode;

            var confidentialData = GetTimeSeries(facilityID, groupCode);

            return(confidentialData.Any());
        }
Beispiel #2
0
        /// <summary>
        /// Return all leaf pollutants within a given group given by parentCode.
        /// Any sub-groups (e.g. BTEX)willnot be included, but its children will.
        /// </summary>
        public static int CountLeafPollutants(string parentCode)
        {
            LOV_POLLUTANT group = GetPollutant(parentCode);

            if (group != null)
            {
                return(GetLeafPollutants(group.LOV_PollutantID).Count());
            }

            return(0);
        }
        /// <summary>
        /// Get confidential data for timeseries on facility level.
        /// The list will always contain data corresponding to the pollutant, even if no confidentiality claims has been made for any years
        /// </summary>
        public static List <TimeSeriesClasses.ConfidentialityPollutant> GetConfidentialTimeSeries(int facilityID, string pollutantCode)
        {
            //Find data for pollutant
            List <TimeSeriesClasses.PollutantTransfers> pollutantData = GetTimeSeries(facilityID, pollutantCode);

            //Find data for confidential in the group of the pollutant
            LOV_POLLUTANT pollutant = ListOfValues.GetPollutant(pollutantCode);
            string        groupCode = pollutant.ParentID.HasValue ? ListOfValues.GetPollutant(pollutant.ParentID.Value).Code : null;

            List <TimeSeriesClasses.PollutantTransfers> confidentialData = GetTimeSeries(facilityID, groupCode);

            //merge the two lists.
            List <TimeSeriesClasses.ConfidentialityPollutant> result = mergeList(pollutantData, confidentialData);

            return(result);
        }