示例#1
0
        //creates header for Area and adds to dictionary
        protected static void addArea(Dictionary <string, string> header, AreaFilter filter)
        {
            if (filter != null)
            {
                string key   = Resources.GetGlobal("Common", "Area");
                string value = string.Empty;

                AreaFilter.Level level = filter.SearchLevel();

                if (level == AreaFilter.Level.AreaGroup)
                {
                    string code = ListOfValues.GetAreaGroup((int)filter.AreaGroupID).Code;
                    value = LOVResources.AreaGroupName(code);
                }
                else if (level == AreaFilter.Level.Country)
                {
                    string code = ListOfValues.GetCountry((int)filter.CountryID).Code;
                    value = LOVResources.CountryName(code);
                }
                else if (level == AreaFilter.Level.Region)
                {
                    if (filter.TypeRegion == AreaFilter.RegionType.RiverBasinDistrict)
                    {
                        string code = ListOfValues.GetRiverBasinDistrict((int)filter.RegionID).Code;
                        value = LOVResources.RiverBasinDistrictName(code);
                    }
                    else if (filter.TypeRegion == AreaFilter.RegionType.NUTSregion)
                    {
                        if (filter.RegionID != null)
                        {
                            string code = ListOfValues.GetNUTSRegion((int)filter.RegionID).Code;
                            value = LOVResources.NutsRegionName(code);
                        }
                        else
                        {
                            value = LOVResources.NutsRegionName(TreeListRow.CODE_UNKNOWN);
                        }
                    }
                    else
                    {
                        throw new InvalidOperationException(string.Format("Illgegal RegionType {0}", filter.TypeRegion));
                    }
                }

                header.Add(key, value);
            }
        }
示例#2
0
        //creates header for waste receiver and adds to dictionary
        protected static void addWasteReceiver(Dictionary <string, string> header, WasteReceiverFilter filter)
        {
            if (filter != null)
            {
                string key   = Resources.GetGlobal("Common", "ReceivingCountry");
                string value = String.Empty;

                if (filter.CountryID == -1)
                {
                    value = Resources.GetGlobal("Common", "AllReceivingCountries");
                }
                else
                {
                    string code = ListOfValues.GetCountry((int)filter.CountryID).Code;
                    value = LOVResources.CountryName(code);
                }

                header.Add(key, value);
            }
        }