public IActionResult Country()
        {
            ViewBag.ContextViewModel = _contextViewModelHelper.Create();
            MapViewModel mapViewModel = new MapViewModel();
            string       sld          = _dataQualityClassificationService.GetSld();

            Dictionary <string, string> customParameters = new Dictionary <string, string>
            {
                {
                    "SLD_BODY", sld
                }
            };

            mapViewModel.AddService(_ServiceType, _url, _Layer, customParameters);

            AddAdminUnitsToServices(mapViewModel);

            DataQualityClassificationViewModel model = new DataQualityClassificationViewModel
            {
                Classifications  = _dataQualityClassificationService.Get(),
                Type             = AdministrativeUnitType.Country,
                LegendItemStyles = _dataQualityClassificationService.GetLegendItemStyles(),
                MetadataUrl      = _metadataUrl,
                MapViewModel     = mapViewModel
            };

            return(View("Views/FkbData/DataContent/Aspects/DataQualityClassification.cshtml", model));
        }
Ejemplo n.º 2
0
        public IActionResult Country()
        {
            ViewBag.ContextViewModel = _contextViewModelHelper.Create();
            MapViewModel mapViewModel = new MapViewModel();

            DataQualityDistributionViewModel model = new DataQualityDistributionViewModel(
                _dataQualityDistributionService.Get(),
                _applicationSettings.QualityCategoryColors,
                _applicationSettings.DataQualityDataSetToLayerMap)
            {
                Type = AdministrativeUnitType.Country,
                AdministrativeUnitName = "Norge",
                MetadataUrl            = _applicationSettings.ExternalUrls.MetadataDataQualityDistribution,
                MapViewModel           = mapViewModel
            };

            return(View("Views/FkbData/DataContent/Aspects/DataQualityDistribution.cshtml", model));
        }
Ejemplo n.º 3
0
        public IActionResult Country()
        {
            CountiesViewModel model = new CountiesViewModel();

            model.Counties = new List <County>();

            using (var command = _dbContext.Database.GetDbConnection().CreateCommand())
            {
                command.CommandText = "SELECT COUNT(PlanInfo.Kommune_Kommunenr) AS antallKommunerTotalt, Fylke.Fylkesnr, Fylke.Fylkesnavn FROM PlanInfo INNER JOIN Kommune ON PlanInfo.Kommune_Kommunenr = Kommune.Kommunenr INNER JOIN Fylke ON Kommune.Fylke_Fylkesnr = Fylke.Fylkesnr WHERE (Kommune.Aktiv = 1) AND(Fylke.Aktiv = 1) GROUP BY Fylke.Fylkesnr, Fylke.Fylkesnavn";
                _dbContext.Database.OpenConnection();
                using (var result = command.ExecuteReader())
                {
                    while (result.Read())
                    {
                        County county = new County();
                        county.MunicipalityCount = result.GetInt32(0);
                        county.Number            = result.GetString(1);
                        county.Name = result.GetString(2);
                        county.GeosynchIntroducedCount = 0;

                        using (var command2 = _dbContext.Database.GetDbConnection().CreateCommand())
                        {
                            command2.CommandText = "SELECT COUNT(PlanInfo.Kommune_Kommunenr) AS GeosynchIntroducedCount FROM PlanInfo INNER JOIN Kommune ON PlanInfo.Kommune_Kommunenr = Kommune.Kommunenr INNER JOIN Fylke ON Kommune.Fylke_Fylkesnr = Fylke.Fylkesnr WHERE(PlanInfo.GeosynkInnfort IS NOT NULL) AND (Kommune.Aktiv = 1) AND (Fylke.Fylkesnr = '" + county.Number + "')";
                            using (var result2 = command2.ExecuteReader())
                            {
                                if (result2.HasRows)
                                {
                                    result2.Read();
                                    county.GeosynchIntroducedCount = result2.GetInt32(0);
                                }
                            }
                        }

                        model.Counties.Add(county);
                    }
                }
            }

            model.GeosynchIntroducedCount = model.Counties.Sum(c => c.GeosynchIntroducedCount);

            ViewBag.ContextViewModel = _contextViewModelHelper.Create();

            return(View("Views/NAP/Management/Aspects/Geosynchronization/Country.cshtml", model));
        }
Ejemplo n.º 4
0
        public IActionResult Country()
        {
            string       url          = $"{_applicationSettings.UrlThematicGeoJson}/{_geoJsonService.GetFileName()}";
            MapViewModel mapViewModel = new MapViewModel();

            mapViewModel.AddService(_serviceType, url, _layer);

            CountiesViewModel model = new CountiesViewModel()
            {
                Counties     = _countyService.Get(),
                MapViewModel = mapViewModel
            };

            model.DirectUpdateCount = model.Counties.Sum(c => c.DirectUpdateCount);

            ViewBag.ContextViewModel = _contextViewModelHelper.Create();

            return(View("Views/FkbData/Management/Aspects/DirectUpdateInfo/Country.cshtml", model));
        }
        public IActionResult Country()
        {
            ViewBag.ContextViewModel = _contextViewModelHelper.Create();
            MapViewModel            mapViewModel    = new MapViewModel();
            List <ITransactionData> transactionData = _transactionDataService.Get();

            mapViewModel.AddService(_ServiceType, _url, _Layer);

            TransactionDataViewModel model = new TransactionDataViewModel
            {
                TransactionData        = transactionData,
                AdministrativeUnitName = "Norge",
                LegendItemStyles       = _transactionDataService.GetLayerStyles(transactionData),
                MapViewModel           = mapViewModel,
                MetadataUrl            = _metadataUrl
            };

            return(View("Views/FkbData/Management/Aspects/TransactionData/Country.cshtml", model));
        }
        public IActionResult Index([FromQuery] int id, [FromQuery] bool isCounty)
        {
            XmlTextReader   reader = new XmlTextReader(_operationalStatus);
            SyndicationFeed feed   = SyndicationFeed.Load(reader);
            List <AtomFeedEntryViewModel> entries = new List <AtomFeedEntryViewModel>();

            foreach (SyndicationItem item in feed.Items ?? Enumerable.Empty <SyndicationItem>())
            {
                entries.Add(new AtomFeedEntryViewModel()
                {
                    Title     = item.Title.Text,
                    Content   = ((TextSyndicationContent)item.Content).Text,
                    Published = item.PublishDate.DateTime,
                    Updated   = item.LastUpdatedTime.DateTime
                });
            }

            ViewBag.ContextViewModel = _contextViewModelHelper.Create(_contextViewModelHelper.Id2Key(id, isCounty));

            return(View("Views/FkbData/Management/OperationalStatus/OperationalStatus.cshtml", entries));
        }
Ejemplo n.º 7
0
 public IActionResult Country([FromQuery] int id, [FromQuery] bool isCounty)
 {
     ViewBag.ContextViewModel = _contextViewModelHelper.Create(_contextViewModelHelper.Id2Key(id, isCounty));
     return(View("Views/FkbData/Management/Aspects/ActivityOverview/Activities.cshtml"));
 }