Example #1
0
        public async Task OnGetAsync(string stub)
        {
            Breadcrums.Add(new Breadcrum(stub, $"/Developers/{stub}"));

            var dataCategories = await _cacheManager.DataCategories.Get();

            var stubDataCategory = dataCategories
                                   .FirstOrDefault(dc => dc.Stub.Equals(stub, StringComparison.OrdinalIgnoreCase));

            if (stubDataCategory != null)
            {
                DataCategory = stubDataCategory;
            }
        }
Example #2
0
 public void OnGet(string stub)
 {
     Breadcrums.Add(new Breadcrum(stub, $"/Charts/{stub}"));
 }
Example #3
0
 public IndexModel()
 {
     Breadcrums.Add(new Breadcrum("Charts", "/Charts"));
 }
        public DevelopersModel(ILogger <PrivacyModel> logger)
        {
            _logger = logger;

            Breadcrums.Add(new Breadcrum("Developers", ""));
        }
        public ResearchDevelopmentModel(ILogger <PrivacyModel> logger)
        {
            _logger = logger;

            Breadcrums.Add(new Breadcrum("R&D", string.Empty));
        }
Example #6
0
        public ChartsModel(ILogger <PrivacyModel> logger)
        {
            _logger = logger;

            Breadcrums.Add(new Breadcrum("Charts", ""));
        }
        public AboutModel(ILogger <PrivacyModel> logger)
        {
            _logger = logger;

            Breadcrums.Add(new Breadcrum("About", ""));
        }
Example #8
0
        public HelpModel(ILogger <PrivacyModel> logger)
        {
            _logger = logger;

            Breadcrums.Add(new Breadcrum("Help", string.Empty));
        }
Example #9
0
        public async Task OnGetAsync(string dataCategoryStub, string dataSetStub)
        {
            Breadcrums.Add(new Breadcrum(dataCategoryStub, $"/Developers/{dataCategoryStub}"));
            Breadcrums.Add(new Breadcrum("View", $"/Developers/{dataCategoryStub}/{dataSetStub}"));

            var dataCategories = await _cacheManager.DataCategories.Get();

            var stubDataCategory = dataCategories
                                   .FirstOrDefault(dc => dc.Stub.Equals(dataCategoryStub, StringComparison.OrdinalIgnoreCase));

            if (stubDataCategory == null)
            {
                return;
            }

            DataCategory = stubDataCategory;

            var stubDataSet = DataCategory.DataSets
                              .FirstOrDefault(ds => ds.Stub.Equals(dataSetStub, StringComparison.OrdinalIgnoreCase));

            DataSet = stubDataSet;

            if (DataSet == null)
            {
                return;
            }

            try
            {
                if (DataSet.Live)
                {
                    var liveData = await _cacheManager.GetLiveDataCache();

                    var json = string.Empty;

                    switch (DataSet.Filename)
                    {
                    case LiveDataCache.FlightsArrivals:
                        json = System.Text.Json.JsonSerializer.Serialize(liveData.AirportArrivals);
                        break;

                    case LiveDataCache.FlightsDepartures:
                        json = System.Text.Json.JsonSerializer.Serialize(liveData.AirportDepartures);
                        break;

                    case LiveDataCache.SailingsHarbour:
                        json = System.Text.Json.JsonSerializer.Serialize(liveData.Harbour);
                        break;
                    }

                    DataTable = JsonConvert.DeserializeObject <DataTable>(json);
                }
                else
                {
                    DataTable = JsonConvert.DeserializeObject <DataTable>(DataSet.CurrentDataJson.Json);
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex, "Exception parsing JSON to DataTable [{dataCategoryStub} - {dataSetStub}]",
                          dataCategoryStub, dataSetStub);
                Error = true;
            }
        }
Example #10
0
 public DataViewModel(CacheManager cacheManager)
 {
     Breadcrums.Add(new Breadcrum("Developers", "/Developers"));
     _cacheManager = cacheManager;
 }
Example #11
0
 public void OnGet()
 {
     Breadcrums.Add(new Breadcrum("Buses", $"/Charts/Buses"));
 }
Example #12
0
 public BusesModel()
 {
     Breadcrums.Add(new Breadcrum("Charts", "/Charts"));
 }
 public Housing()
 {
     Breadcrums.Add(new Breadcrum("Charts", "/Charts"));
     Breadcrums.Add(new Breadcrum("Housing", $"/Charts/Housing"));
 }
Example #14
0
        public MapsModel(ILogger <PrivacyModel> logger)
        {
            _logger = logger;

            Breadcrums.Add(new Breadcrum("Maps", string.Empty));
        }