diff --git a/GWMS.UI/Controllers/PlantDataController.cs b/GWMS.UI/Controllers/PlantDataController.cs new file mode 100644 index 0000000..2a9bd19 --- /dev/null +++ b/GWMS.UI/Controllers/PlantDataController.cs @@ -0,0 +1,74 @@ +using GWMS.UI.Data; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 + +namespace GWMS.UI.Controllers +{ + [Route("api/PlantData")] + [ApiController] + public class PlantDataController : ControllerBase + { + #region Public Constructors + + public PlantDataController(GWMSDataService DataService) + { + _DataService = DataService; + } + + #endregion Public Constructors + + #region Protected Properties + + protected GWMSDataService _DataService { get; set; } + + #endregion Protected Properties + + #region Public Methods + + // DELETE api/PlantDataController/5 + [HttpDelete("{id}")] + public void Delete(int id) + { + } + + // GET: api/PlantDataController + [HttpGet] + public async Task> Get() + { + // serializzo i dati di PlantDTO dell'impianto richiesto + List ListRecords = await _DataService.PlantsGetAll(); + return ListRecords; + } + + // GET api/PlantDataController/5 + [HttpGet("{id}")] + public async Task Get(int id) + { + // serializzo i dati di PlantDTO dell'impianto richiesto + var ListRecords = await _DataService.PlantsGetAll(); + //seleziono plant... + var SelRecords = ListRecords.Where(X => X.PlantId == id).FirstOrDefault(); + return SelRecords; + } + + // POST api/PlantDataController + [HttpPost] + public void Post([FromBody] string value) + { + } + + // PUT api/PlantDataController/5 + [HttpPut("{id}")] + public void Put(int id, [FromBody] string value) + { + } + + #endregion Public Methods + } +} \ No newline at end of file diff --git a/GWMS.UI/Controllers/PlantLogController.cs b/GWMS.UI/Controllers/PlantLogController.cs new file mode 100644 index 0000000..a7bbacf --- /dev/null +++ b/GWMS.UI/Controllers/PlantLogController.cs @@ -0,0 +1,85 @@ +using GWMS.Data.DatabaseModels; +using GWMS.UI.Data; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 + +namespace GWMS.UI.Controllers +{ + [Route("api/PlantLog")] + [ApiController] + public class PlantLogController : ControllerBase + { + #region Public Constructors + + public PlantLogController(GWMSDataService DataService) + { + _DataService = DataService; + } + + #endregion Public Constructors + + #region Protected Properties + + protected GWMSDataService _DataService { get; set; } + + #endregion Protected Properties + + #region Public Methods + + // DELETE api/PlantDataController/5 + [HttpDelete("{id}")] + public void Delete(int id) + { + } + + // GET: api/PlantDataController + [HttpGet] + public async Task> Get() + { + // arrotondo ai 5 minuti + DateTime adesso = DateTime.Now; + int dayHour = adesso.Hour; + int dayMin = (adesso.Minute / 5) * 5; + DateTime limite = DateTime.Today.AddHours(dayHour).AddMinutes(dayMin); + + // serializzo i dati di PlantDTO dell'impianto richiesto + var ListRecords = await _DataService.PlantLogGetFilt(0, limite, 100); + return ListRecords; + } + + // GET api/PlantDataController/5 + [HttpGet("{id}")] + public async Task> Get(int id) + { + // arrotondo ai 5 minuti + DateTime adesso = DateTime.Now; + int dayHour = adesso.Hour; + int dayMin = (adesso.Minute / 5) * 5; + DateTime limite = DateTime.Today.AddHours(dayHour).AddMinutes(dayMin); + + // serializzo i dati di PlantDTO dell'impianto richiesto + var ListRecords = await _DataService.PlantLogGetFilt(id, limite, 100); + return ListRecords; + } + + // POST api/PlantDataController + [HttpPost] + public void Post([FromBody] string value) + { + } + + // PUT api/PlantDataController/5 + [HttpPut("{id}")] + public void Put(int id, [FromBody] string value) + { + } + + #endregion Public Methods + } +} \ No newline at end of file diff --git a/GWMS.sln b/GWMS.sln index 632e0ea..d2bc288 100644 --- a/GWMS.sln +++ b/GWMS.sln @@ -9,6 +9,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GWMS.UI", "GWMS.UI\GWMS.UI. EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GWMS.User", "GWMS.User\GWMS.User.csproj", "{3112DC8B-4752-4D43-A9A7-41AC40A38DFD}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GWMS.API", "GWMS.API\GWMS.API.csproj", "{F455A3A5-89FD-49E3-B5B6-ED8B0DCEC444}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -27,6 +29,10 @@ Global {3112DC8B-4752-4D43-A9A7-41AC40A38DFD}.Debug|Any CPU.Build.0 = Debug|Any CPU {3112DC8B-4752-4D43-A9A7-41AC40A38DFD}.Release|Any CPU.ActiveCfg = Release|Any CPU {3112DC8B-4752-4D43-A9A7-41AC40A38DFD}.Release|Any CPU.Build.0 = Release|Any CPU + {F455A3A5-89FD-49E3-B5B6-ED8B0DCEC444}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F455A3A5-89FD-49E3-B5B6-ED8B0DCEC444}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F455A3A5-89FD-49E3-B5B6-ED8B0DCEC444}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F455A3A5-89FD-49E3-B5B6-ED8B0DCEC444}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index a316566..5ce75ed 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo statistiche MAPO -

Versione: 1.0.2106.2516

+

Versione: 1.0.2106.2910


Note di rilascio:
    diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index 7bae601..5944cca 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -1.0.2106.2516 +1.0.2106.2910 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index 289d18b..ff87e4a 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.0.2106.2516 + 1.0.2106.2910 http://nexus.steamware.net/repository/SWS/MP-STATS/stable/0/GWMS.UI.zip http://nexus.steamware.net/repository/SWS/MP-STATS/stable/0/ChangeLog.html false