From b68cc2ac3fd46084e25a858d91f4e4d17d2f0fff Mon Sep 17 00:00:00 2001 From: Luke Else Date: Wed, 26 Jan 2022 13:11:04 +0000 Subject: [PATCH] Created NavData Model Create Navdata Model and add Navata controller (Currently empty) --- Controllers/NavdataController.cs | 33 +++++++++++++++++++++++ EFB.csproj | 1 + Models/NavdataModel.cs | 45 ++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 Controllers/NavdataController.cs create mode 100644 Models/NavdataModel.cs diff --git a/Controllers/NavdataController.cs b/Controllers/NavdataController.cs new file mode 100644 index 0000000..5452bf4 --- /dev/null +++ b/Controllers/NavdataController.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Logging; + +namespace EFB.Controllers +{ + //[Route("[controller]")] + public class NavdataController : Controller + { + private readonly ILogger _logger; + + public NavdataController(ILogger logger) + { + _logger = logger; + } + + public IActionResult Index() + { + return View(); + } + + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] + public IActionResult Error() + { + return View("Error!"); + } + + } +} \ No newline at end of file diff --git a/EFB.csproj b/EFB.csproj index 1afd1da..aa74eb8 100644 --- a/EFB.csproj +++ b/EFB.csproj @@ -4,5 +4,6 @@ + \ No newline at end of file diff --git a/Models/NavdataModel.cs b/Models/NavdataModel.cs new file mode 100644 index 0000000..405d0d3 --- /dev/null +++ b/Models/NavdataModel.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using MySql.Data.MySqlClient; + +namespace EFB.Models +{ + public class NavdataModel + { + public int Id { get; set; } + public string Name { get; set; } + public int? Frequency { get; set; } + public string Latitude { get; set; } + public string Longitude { get; set; } + + + public NavdataModel(int id, string name, string latitude, string longitude){ + Id = id; + Name = name; + Frequency = null; + Latitude = latitude; + Longitude = longitude; + } + + public NavdataModel(int id, string name, int frequency, string latitude, string longitude){ + Id = id; + Name = name; + Frequency = frequency; + Latitude = latitude; + Longitude = longitude; + } + + public NavdataModel[] Populate(){ + MySqlConnection db = new MySqlConnection("root:XXXXXXX@XXX.XXX.XXX.XXX:3306/EFB"); + } + + + + + + + + } +} \ No newline at end of file