From dcfd321b37e8acda1f02ecec949b6060d55241a0 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Sat, 23 Oct 2021 19:03:55 +0200 Subject: [PATCH] Continuo setup preliminare pagina parametri --- GWMS.UI/GWMS.UI.csproj | 2 +- GWMS.UI/Pages/PlantAnalisys.razor.cs | 4 +- GWMS.UI/Pages/PlantParameters.razor | 67 ++++--------- GWMS.UI/Pages/PlantParameters.razor.cs | 129 +++++-------------------- Resources/ChangeLog.html | 2 +- Resources/VersNum.txt | 2 +- Resources/manifest.xml | 2 +- 7 files changed, 47 insertions(+), 161 deletions(-) diff --git a/GWMS.UI/GWMS.UI.csproj b/GWMS.UI/GWMS.UI.csproj index 6f3649d..6840463 100644 --- a/GWMS.UI/GWMS.UI.csproj +++ b/GWMS.UI/GWMS.UI.csproj @@ -2,7 +2,7 @@ net5.0 - 1.0.2110.2318 + 1.0.2110.2319 95c9f021-52d1-4390-a670-5810b7b777b0 true true diff --git a/GWMS.UI/Pages/PlantAnalisys.razor.cs b/GWMS.UI/Pages/PlantAnalisys.razor.cs index ebfbe7e..5ef9936 100644 --- a/GWMS.UI/Pages/PlantAnalisys.razor.cs +++ b/GWMS.UI/Pages/PlantAnalisys.razor.cs @@ -269,9 +269,7 @@ namespace GWMS.UI.Pages { SearchRecords = await DataService.PlantsAnalisysGetByCode(AppMService.Order_Filter); SearchRecords = SearchRecords.Where(x => x.HasRefill || !_ShowOnlyRefill).ToList(); - ListRecords = SearchRecords - - .Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); + ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); } catch (Exception exc) { diff --git a/GWMS.UI/Pages/PlantParameters.razor b/GWMS.UI/Pages/PlantParameters.razor index afb301f..ddc1d0d 100644 --- a/GWMS.UI/Pages/PlantParameters.razor +++ b/GWMS.UI/Pages/PlantParameters.razor @@ -42,7 +42,8 @@
@if (currRecord != null) { - + Editor parametri + @**@ } @if (ListRecords == null) { @@ -59,63 +60,30 @@ - - - - - - + + + + + @* + *@ @foreach (var record in ListRecords) { - @**@ - + - - - - + } @@ -126,6 +94,5 @@ } \ No newline at end of file diff --git a/GWMS.UI/Pages/PlantParameters.razor.cs b/GWMS.UI/Pages/PlantParameters.razor.cs index 8bd7f82..ea54494 100644 --- a/GWMS.UI/Pages/PlantParameters.razor.cs +++ b/GWMS.UI/Pages/PlantParameters.razor.cs @@ -10,6 +10,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using static GWMS.Data.IobObjects; namespace GWMS.UI.Pages { @@ -19,13 +20,9 @@ namespace GWMS.UI.Pages #region Private Fields private static NLog.Logger Log = LogManager.GetCurrentClassLogger(); - private bool _ShowOnlyRefill = false; - private OrderModel currRecord = null; - - private List ListRecords; + private objItem currRecord = null; + private List ListRecords; private List PlantsList; - private List SearchRecords; - private List SuppliersList; #endregion Private Fields @@ -40,40 +37,8 @@ namespace GWMS.UI.Pages #region Private Properties - private int _currPage { get; set; } = 1; - - private int _numRecord { get; set; } = 10; - - private int currPage - { - get => _currPage; - set - { - if (_currPage != value) - { - _currPage = value; - var pUpd = Task.Run(async () => await ReloadData()); - pUpd.Wait(); - } - } - } - private bool isLoading { get; set; } = false; - private int numRecord - { - get => _numRecord; - set - { - if (_numRecord != value) - { - _numRecord = value; - var pUpd = Task.Run(async () => await ReloadData()); - pUpd.Wait(); - } - } - } - private int SelPlantId { get @@ -96,42 +61,23 @@ namespace GWMS.UI.Pages } } - private int SelSupplierId + private string SelPlantCode { get { - int answ = 0; - if (AppMService.Order_Filter != null) + string answ = ""; + // cerco in elenco + var currPlant = PlantsList + .Where(x => x.PlantId == SelPlantId) + .FirstOrDefault(); + if (currPlant != null) { - answ = AppMService.Order_Filter.SupplierId; + answ = currPlant.PlantCode; } return answ; } - set - { - if (!AppMService.Order_Filter.SupplierId.Equals(value)) - { - AppMService.Order_Filter.SupplierId = value; - var pUpd = Task.Run(async () => await ReloadData()); - pUpd.Wait(); - } - } } - private bool ShowOnlyRefill - { - get - { - return _ShowOnlyRefill; - } - set - { - _ShowOnlyRefill = value; - currPage = 1; - var pUpd = Task.Run(async () => await ReloadData()); - pUpd.Wait(); - } - } #endregion Private Properties @@ -201,9 +147,9 @@ namespace GWMS.UI.Pages get { int answ = 0; - if (SearchRecords != null) + if (ListRecords != null) { - answ = SearchRecords.Count; + answ = ListRecords.Count; } return answ; } @@ -213,15 +159,6 @@ namespace GWMS.UI.Pages #region Public Properties - public bool ShowAddNew - { - get - { - bool answ = false; - answ = (SelSupplierId > 0 && SelPlantId > 0); - return answ; - } - } #endregion Public Properties @@ -267,11 +204,7 @@ namespace GWMS.UI.Pages ListRecords = null; try { - SearchRecords = await DataService.PlantsAnalisysGetByCode(AppMService.Order_Filter); - SearchRecords = SearchRecords.Where(x => x.HasRefill || !_ShowOnlyRefill).ToList(); - ListRecords = SearchRecords - - .Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); + ListRecords = await DataService.getCurrObjItems(SelPlantCode); } catch (Exception exc) { @@ -284,14 +217,14 @@ namespace GWMS.UI.Pages #region Protected Methods +#if false /// /// Creazione nuovo record Ordine /// protected void CreateNew(PlantLevSumDTO currItem) { var currPlant = PlantsList.Where(x => x.PlantId == SelPlantId).FirstOrDefault(); - var currSuppl = SuppliersList.Where(x => x.SupplierId == SelSupplierId).FirstOrDefault(); - if (currPlant != null && currSuppl != null) + if (currPlant != null) { DateTime ordDate = currItem.DataRif.AddDays(-1); // creo un nuovo record @@ -310,36 +243,26 @@ namespace GWMS.UI.Pages ExecutionQty = Math.Ceiling((currItem.LevelMax - currItem.LevelMin) / currItem.DeltaMin) * currItem.DeltaMin, OrderQty = Math.Ceiling((currItem.LevelMax - currItem.LevelMin) / 2000) * 2000 }; - //// aggiorno filtro - //AppMService.Order_Filter = SelectOrderData.Init(5, 10); } - } + } +#endif - protected void Edit(PlantLevSumDTO selRecord) + protected void Edit(objItem selRecord) { // rileggo dal DB il record corrente... var pUpd = Task.Run(async () => { - currRecord = await DataService.OrderGetById(selRecord.OrdersIds.FirstOrDefault()); + currRecord = selRecord; }); pUpd.Wait(); } - protected void ForceReload(int newNum) - { - numRecord = newNum; - } - - protected void ForceReloadPage(int newNum) - { - currPage = newNum; - } protected override async Task OnInitializedAsync() { AppMService.ShowSearch = false; - AppMService.PageName = "Ordini"; - AppMService.PageIcon = "fas fa-file-invoice pr-2"; + AppMService.PageName = "Parametri Impianto"; + AppMService.PageIcon = "fas fa-folder-open pr-2"; AppMService.EA_SearchUpdated += OnSeachUpdated; await ReloadAllData(); } @@ -347,7 +270,6 @@ namespace GWMS.UI.Pages protected async Task ReloadAllData() { isLoading = true; - SuppliersList = await DataService.SuppliersGetAll(); PlantsList = null; await GetClaimsData(); // se ho un plantId valido --> altrimenti non abilitato @@ -379,14 +301,13 @@ namespace GWMS.UI.Pages { SelPlantId = 0; currRecord = null; - SearchRecords = null; ListRecords = null; AppMService.Order_Filter = SelectOrderData.Init(5, 10); await DataService.PlantsAnalisysReset(AppMService.Order_Filter); await ReloadAllData(); } - protected void Select(OrderModel selRecord) + protected void Select(objItem selRecord) { // applico filtro da selezione currRecord = selRecord; @@ -403,14 +324,14 @@ namespace GWMS.UI.Pages #region Public Methods - public string checkSelect(int OrderId) + public string checkSelect(string uid) { string answ = ""; if (currRecord != null) { try { - answ = (currRecord.OrderId == OrderId) ? "table-info" : ""; + answ = (currRecord.uid == uid) ? "table-info" : ""; } catch { } diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index 22e2a90..70bfadd 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ GWMS - Gas Warehouse Management System -

Versione: 1.0.2110.2318

+

Versione: 1.0.2110.2319


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index a3035f5..648be46 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -1.0.2110.2318 +1.0.2110.2319 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index c4cfd5b..f671a59 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.0.2110.2318 + 1.0.2110.2319 http://nexus.steamware.net/repository/SWS/GWMS/stable/0/GWMS.UI.zip http://nexus.steamware.net/repository/SWS/GWMS/stable/0/ChangeLog.html false
ImpiantoDataLivello AperturaLivello ChiusuraCarico Ordine ParametroValore attuale/richiestoUpdateLast messageCarico Ordine
-
@record.PlantCode
-
@record.PlantDesc
+
@record.name
+
@record.uid
-
@record.DataRif.ToString("yyyy.MM.dd")
-
@record.DataRif.ToString("dddd")
+
@record.value
+
@record.reqValue
@record.LevelStart.ToString("N0")@record.LevelEnd.ToString("N0") - @if (record.HasRefill) - { - if (record.HasOrder) - { - @record.LevelMin.ToString("N0") @record.LevelMax.ToString("N0") - } - else - { - @record.LevelMin.ToString("N0") @record.LevelMax.ToString("N0") - } - - } - - @if (record.HasOrder) - { - @if (currRecord == null) - { - - } - else - { - - } - } - else if (ShowAddNew && record.HasRefill) - { - - } + @record.lastRead.ToString("yyyy.MM.dd hh:mm:ss") +
@record.lastMessage
+
@record.lastRequest