- @if (record.writable)
+ @if (record.writable || editAll)
{
if (currRecord == null)
{
diff --git a/GWMS.UI/Pages/PlantParameters.razor.cs b/GWMS.UI/Pages/PlantParameters.razor.cs
index bb230ee..534878a 100644
--- a/GWMS.UI/Pages/PlantParameters.razor.cs
+++ b/GWMS.UI/Pages/PlantParameters.razor.cs
@@ -1,5 +1,4 @@
using GWMS.Data.DatabaseModels;
-using GWMS.Data.DTO;
using GWMS.UI.Data;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components;
@@ -18,30 +17,168 @@ namespace GWMS.UI.Pages
[Authorize(Roles = "SuperAdmin, Admin, User")]
public partial class PlantParameters : ComponentBase, IDisposable
{
+ #region Public Methods
+
+ public void Dispose()
+ {
+ aTimer.Stop();
+ aTimer.Dispose();
+ AppMService.EA_SearchUpdated -= OnSeachUpdated;
+ }
+
+ public async void OnSeachUpdated()
+ {
+ await UpdateData();
+ StateHasChanged();
+ }
+
+ #endregion Public Methods
+
+ #region Protected Properties
+
+ [Inject]
+ protected IJSRuntime JSRuntime { get; set; }
+
+ [Inject]
+ protected NavigationManager NavManager { get; set; }
+
+ protected int totalCount
+ {
+ get
+ {
+ int answ = 0;
+ if (ListRecords != null)
+ {
+ answ = ListRecords.Count;
+ }
+ return answ;
+ }
+ }
+
+ #endregion Protected Properties
+
+ #region Protected Methods
+
+ protected void ElapsedTimer(Object source, System.Timers.ElapsedEventArgs e)
+ {
+ var pUpd = Task.Run(async () =>
+ {
+ await ReloadData();
+ await InvokeAsync(StateHasChanged);
+ });
+ pUpd.Wait();
+ }
+
+ protected override void OnInitialized()
+ {
+ var currMode = GetQueryParm("currMode");
+ if (!string.IsNullOrWhiteSpace(currMode))
+ {
+ editAll = currMode.Equals("debug");
+ }
+ }
+
+ protected override async Task OnInitializedAsync()
+ {
+ AppMService.ShowSearch = false;
+ AppMService.PageName = "Parametri Impianto";
+ AppMService.PageIcon = "fas fa-folder-open pr-2";
+ AppMService.EA_SearchUpdated += OnSeachUpdated;
+ StartTimer();
+ await ReloadAllData();
+ }
+
+ protected void StartTimer()
+ {
+ int tOutPeriod = 3000;
+ int.TryParse(Configuration["ReloadParamTimer"], out tOutPeriod);
+ aTimer = new System.Timers.Timer(tOutPeriod);
+ aTimer.Elapsed += ElapsedTimer;
+ aTimer.Enabled = true;
+ aTimer.Start();
+ }
+
+ #endregion Protected Methods
+
#region Private Fields
private static System.Timers.Timer aTimer;
+
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
- private objItem currRecord = null;
- private List ListRecords;
- private List PlantsList;
-
- #endregion Private Fields
-
- #region Protected Fields
///
/// Valore PlantId filtrato da claim
///
- protected int ClaimPlantId = -1;
+ private int ClaimPlantId = -1;
- #endregion Protected Fields
+ private objItem currRecord = null;
+
+ private bool editAll = false;
+
+ private List ListRecords;
+
+ private List PlantsList;
+
+ #endregion Private Fields
#region Private Properties
+ [Inject]
+ private MessageService AppMService { get; set; }
+
+ [Inject]
+ private AuthenticationStateProvider AuthenticationStateProvider { get; set; }
+
[Inject]
private IConfiguration Configuration { get; set; }
+ [Inject]
+ private GWMSDataService DataService { get; set; }
+
+ private DateTime DateEnd
+ {
+ get
+ {
+ DateTime answ = DateTime.Today.AddDays(1);
+ if (AppMService.Order_Filter != null)
+ {
+ answ = AppMService.Order_Filter.DateEnd;
+ }
+ return answ;
+ }
+ set
+ {
+ if (!AppMService.Order_Filter.DateEnd.Equals(value))
+ {
+ AppMService.Order_Filter.DateEnd = value;
+ var pUpd = Task.Run(async () => await ReloadData());
+ pUpd.Wait();
+ }
+ }
+ }
+
+ private DateTime DateStart
+ {
+ get
+ {
+ DateTime answ = DateTime.Today.AddDays(-1);
+ if (AppMService.Order_Filter != null)
+ {
+ answ = AppMService.Order_Filter.DateStart;
+ }
+ return answ;
+ }
+ set
+ {
+ if (!AppMService.Order_Filter.DateStart.Equals(value))
+ {
+ AppMService.Order_Filter.DateStart = value;
+ var pUpd = Task.Run(async () => await ReloadData());
+ pUpd.Wait();
+ }
+ }
+ }
+
private bool isLoading { get; set; } = false;
private string SelPlantCode
@@ -85,98 +222,33 @@ namespace GWMS.UI.Pages
#endregion Private Properties
- #region Protected Properties
-
- [Inject]
- protected MessageService AppMService { get; set; }
-
- [Inject]
- protected AuthenticationStateProvider AuthenticationStateProvider { get; set; }
-
- [Inject]
- protected GWMSDataService DataService { get; set; }
-
- protected DateTime DateEnd
- {
- get
- {
- DateTime answ = DateTime.Today.AddDays(1);
- if (AppMService.Order_Filter != null)
- {
- answ = AppMService.Order_Filter.DateEnd;
- }
- return answ;
- }
- set
- {
- if (!AppMService.Order_Filter.DateEnd.Equals(value))
- {
- AppMService.Order_Filter.DateEnd = value;
- var pUpd = Task.Run(async () => await ReloadData());
- pUpd.Wait();
- }
- }
- }
-
- protected DateTime DateStart
- {
- get
- {
- DateTime answ = DateTime.Today.AddDays(-1);
- if (AppMService.Order_Filter != null)
- {
- answ = AppMService.Order_Filter.DateStart;
- }
- return answ;
- }
- set
- {
- if (!AppMService.Order_Filter.DateStart.Equals(value))
- {
- AppMService.Order_Filter.DateStart = value;
- var pUpd = Task.Run(async () => await ReloadData());
- pUpd.Wait();
- }
- }
- }
-
- protected bool editAll
- {
- get
- {
- bool answ = false;
- var currMode = GetQueryParm("currMode");
- if (!string.IsNullOrEmpty(currMode))
- {
- answ = currMode.Equals("debug");
- }
- return answ;
- }
- }
-
- [Inject]
- protected IJSRuntime JSRuntime { get; set; }
-
- [Inject]
- protected NavigationManager NavManager { get; set; }
-
- protected int totalCount
- {
- get
- {
- int answ = 0;
- if (ListRecords != null)
- {
- answ = ListRecords.Count;
- }
- return answ;
- }
- }
-
- #endregion Protected Properties
-
#region Private Methods
+ private string checkSelect(string uid)
+ {
+ string answ = "";
+ if (currRecord != null)
+ {
+ try
+ {
+ answ = (currRecord.uid == uid) ? "table-info" : "";
+ }
+ catch
+ { }
+ }
+ return answ;
+ }
+
+ private void Edit(objItem selRecord)
+ {
+ currRecord = selRecord;
+ }
+
+ private async Task ForceReload()
+ {
+ await ReloadData();
+ }
+
///
/// Recupero Claims dell'utente...
///
@@ -201,54 +273,15 @@ namespace GWMS.UI.Pages
}
}
- private async Task ReloadData()
- {
- isLoading = true;
- ListRecords = null;
- try
- {
- ListRecords = await DataService.getCurrObjItems(SelPlantCode);
- }
- catch (Exception exc)
- {
- Log.Error($"Eccezione in ReloadData:{Environment.NewLine}{exc}");
- }
- isLoading = false;
- }
-
- #endregion Private Methods
-
- #region Protected Methods
-
- protected void Edit(objItem selRecord)
- {
- currRecord = selRecord;
- }
-
- protected async Task ForceReload()
- {
- await ReloadData();
- }
-
// Blazor: get query parm from the URL
- protected string GetQueryParm(string parmName)
+ private string GetQueryParm(string parmName)
{
var uriBuilder = new UriBuilder(NavManager.Uri);
var q = System.Web.HttpUtility.ParseQueryString(uriBuilder.Query);
return q[parmName] ?? "";
}
- protected override async Task OnInitializedAsync()
- {
- AppMService.ShowSearch = false;
- AppMService.PageName = "Parametri Impianto";
- AppMService.PageIcon = "fas fa-folder-open pr-2";
- AppMService.EA_SearchUpdated += OnSeachUpdated;
- StartTimer();
- await ReloadAllData();
- }
-
- protected async Task ReloadAllData()
+ private async Task ReloadAllData()
{
isLoading = true;
PlantsList = null;
@@ -272,7 +305,22 @@ namespace GWMS.UI.Pages
await ReloadData();
}
- protected async Task RemoveItem(objItem selRecord)
+ private async Task ReloadData()
+ {
+ isLoading = true;
+ ListRecords = null;
+ try
+ {
+ ListRecords = await DataService.getCurrObjItems(SelPlantCode);
+ }
+ catch (Exception exc)
+ {
+ Log.Error($"Eccezione in ReloadData:{Environment.NewLine}{exc}");
+ }
+ isLoading = false;
+ }
+
+ private async Task RemoveItem(objItem selRecord)
{
if (!await JSRuntime.InvokeAsync("confirm", $"Sicuro di voler rimuovere il parametro {selRecord.uid} ({selRecord.name})?"))
return;
@@ -284,77 +332,25 @@ namespace GWMS.UI.Pages
await ReloadAllData();
}
- protected void ResetData()
+ private void ResetData()
{
DataService.rollBackEdit(currRecord);
currRecord = null;
}
- protected void Select(objItem selRecord)
+ private void Select(objItem selRecord)
{
// applico filtro da selezione
currRecord = selRecord;
}
- protected async Task UpdateData()
+ private async Task UpdateData()
{
currRecord = null;
await DataService.PlantsAnalisysResetAsync(AppMService.Order_Filter);
await ReloadData();
}
- #endregion Protected Methods
-
- #region Public Methods
-
- public string checkSelect(string uid)
- {
- string answ = "";
- if (currRecord != null)
- {
- try
- {
- answ = (currRecord.uid == uid) ? "table-info" : "";
- }
- catch
- { }
- }
- return answ;
- }
-
- public void Dispose()
- {
- aTimer.Stop();
- aTimer.Dispose();
- AppMService.EA_SearchUpdated -= OnSeachUpdated;
- }
-
- public void ElapsedTimer(Object source, System.Timers.ElapsedEventArgs e)
- {
- var pUpd = Task.Run(async () =>
- {
- await ReloadData();
- await InvokeAsync(StateHasChanged);
- });
- pUpd.Wait();
- }
-
- public async void OnSeachUpdated()
- {
- await UpdateData();
- StateHasChanged();
- }
-
- public void StartTimer()
- {
- int tOutPeriod = 3000;
- int.TryParse(Configuration["ReloadParamTimer"], out tOutPeriod);
- aTimer = new System.Timers.Timer(tOutPeriod);
- aTimer.Elapsed += ElapsedTimer;
- aTimer.Enabled = true;
- aTimer.Start();
- }
-
- #endregion Public Methods
+ #endregion Private Methods
}
}
\ No newline at end of file
diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html
index 6cfc8f2..2f10f09 100644
--- a/Resources/ChangeLog.html
+++ b/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
GWMS - Gas Warehouse Management System
- Versione: 1.2.2603.0409
+ Versione: 1.2.2603.1216
Note di rilascio:
-
diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt
index 62030f0..193fa0d 100644
--- a/Resources/VersNum.txt
+++ b/Resources/VersNum.txt
@@ -1 +1 @@
-1.2.2603.0409
+1.2.2603.1216
diff --git a/Resources/manifest.xml b/Resources/manifest.xml
index 1c378c5..8aac760 100644
--- a/Resources/manifest.xml
+++ b/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 1.2.2603.0409
+ 1.2.2603.1216
http://nexus.steamware.net/repository/SWS/GWMS/stable/0/GWMS.UI.zip
http://nexus.steamware.net/repository/SWS/GWMS/stable/0/ChangeLog.html
false
|