diff --git a/MP.INVE/Components/InveSessionList.razor.cs b/MP.INVE/Components/InveSessionList.razor.cs
index 53d0c314..c7c22979 100644
--- a/MP.INVE/Components/InveSessionList.razor.cs
+++ b/MP.INVE/Components/InveSessionList.razor.cs
@@ -131,7 +131,7 @@ namespace MP.INVE.Components
};
await MIDataservice.InsertNewSessione(newSess);
- NavManager.NavigateTo(NavManager.Uri, true);
+ NavManager.NavigateTo("Session", true);
await reloadData();
}
else
@@ -150,7 +150,7 @@ namespace MP.INVE.Components
if (alert)
{
await MIDataservice.deleteSessione(session);
- NavManager.NavigateTo(NavManager.Uri, true);
+ NavManager.NavigateTo("Session", true);
await reloadData();
}
}
diff --git a/MP.INVE/Components/MagList.razor b/MP.INVE/Components/MagList.razor
new file mode 100644
index 00000000..d8a0cec8
--- /dev/null
+++ b/MP.INVE/Components/MagList.razor
@@ -0,0 +1,93 @@
+@if (reqNew)
+{
+
+
+
+
+
+
+
+
+ Codice magazzino
+
+
+
+
+
+
+
+
+
+
+
+
+ @if (codMag != "")
+ {
+
+
+
+ }
+
+
+
+
+
+
+}
+
+
+
+ | ID magazzino |
+ Codice magazzino |
+ Codice azienda |
+ Descrizione |
+ |
+
+
+
+ @if (elencoMagazzini != null)
+ {
+ @foreach (var item in elencoMagazzini)
+ {
+
+ |
+ @item.MagID
+ |
+
+ @item.CodMag
+ |
+
+
+ @item.CodCS
+ |
+
+ @item.DescMag
+ |
+
+
+ |
+
+
+ }
+ }
+
+
+
+
diff --git a/MP.INVE/Components/MagList.razor.cs b/MP.INVE/Components/MagList.razor.cs
new file mode 100644
index 00000000..9f41e6b6
--- /dev/null
+++ b/MP.INVE/Components/MagList.razor.cs
@@ -0,0 +1,145 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Components;
+using System.Net.Http;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Components.Authorization;
+using Microsoft.AspNetCore.Components.Forms;
+using Microsoft.AspNetCore.Components.Routing;
+using Microsoft.AspNetCore.Components.Web;
+using Microsoft.AspNetCore.Components.Web.Virtualization;
+using Microsoft.JSInterop;
+using MP.INVE;
+using MP.INVE.Shared;
+using MP.INVE.Components;
+using Blazored.LocalStorage;
+using Blazored.SessionStorage;
+using MP.Data.DatabaseModels;
+using MP.INVE.Data;
+
+namespace MP.INVE.Components
+{
+ public partial class MagList
+ {
+ [Inject]
+ private IConfiguration Configuration { get; set; } = null!;
+
+ [Inject]
+ private ISessionStorageService sessionStorage { get; set; } = null!;
+ [Inject]
+ private ILocalStorageService localStorage { get; set; } = null!;
+
+ [Inject]
+ private MiDataService MIDataservice { get; set; } = null!;
+
+ [Inject]
+ private NavigationManager NavManager { get; set; } = null!;
+
+ [Inject]
+ private IJSRuntime JSRuntime { get; set; } = null!;
+
+ [Parameter]
+ public SelectMagListParams currParams { get; set; } = null!;
+
+ [Parameter]
+ public bool isLoading { get; set; }
+
+ protected override async Task OnParametersSetAsync()
+ {
+ await reloadData();
+ }
+ private void closeNew()
+ {
+ reqNew = false;
+ codMag = "";
+ desc = "";
+ }
+ private List? elencoMagazzini;
+ private List? SearchRecords;
+ private async Task insertNewMag()
+ {
+ var alert = await JSRuntime.InvokeAsync("confirm", "Confermi di voler creare un nuovo magazzino?");
+
+ if (alert)
+ {
+ AnagMagModel newMag = new AnagMagModel()
+ {
+ CodMag = codMag,
+ CodCS = "EC",
+ DescMag = desc,
+ Nascosto = false
+ };
+ await MIDataservice.InsertNewMag(newMag);
+ NavManager.NavigateTo("Elencomagazzini", true);
+ //await MIDataservice.FlushRedisCache();
+ await reloadData();
+ }
+ else
+ {
+ closeNew();
+ }
+ }
+
+ private async Task reloadData()
+ {
+ isLoading = true;
+ elencoMagazzini = null;
+ SearchRecords = null;
+ SearchRecords = MIDataservice.ElencoMagazzini();
+ totalCount = SearchRecords.Count;
+ elencoMagazzini = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
+ await Task.Delay(1);
+ await InvokeAsync(() => StateHasChanged());
+ await Task.Delay(1);
+ isLoading = false;
+ }
+ private async Task deleteMag(AnagMagModel mag)
+ {
+ var alert = await JSRuntime.InvokeAsync("confirm", "Confermi di voler eliminare il magazzino selezionato?");
+ if (alert)
+ {
+ await MIDataservice.DeleteMag(mag);
+ NavManager.NavigateTo("Elencomagazzini", true);
+ await reloadData();
+ }
+ }
+ private bool reqNew
+ {
+ get => currParams.reqNew;
+ set => currParams.reqNew = value;
+ }
+
+ private int totalCount
+ {
+ get => currParams.TotCount;
+ set => currParams.TotCount = value;
+ }
+ private int numRecord
+ {
+ get => currParams.NumRec;
+ set
+ {
+ currParams.NumRec = value;
+ StateHasChanged();
+ }
+ }
+ private int currPage
+ {
+ get => currParams.CurrPage;
+ set
+ {
+ currParams.CurrPage = value;
+ StateHasChanged();
+ }
+ }
+ private bool inCorso
+ {
+ get => currParams.inCorso;
+ set => currParams.inCorso = value;
+ }
+ private string codMag { get; set; } = "";
+ private string desc { get; set; } = "";
+ }
+}
\ No newline at end of file
diff --git a/MP.INVE/Data/SelectMagListParams.cs b/MP.INVE/Data/SelectMagListParams.cs
new file mode 100644
index 00000000..a601179b
--- /dev/null
+++ b/MP.INVE/Data/SelectMagListParams.cs
@@ -0,0 +1,60 @@
+using MP.Data;
+
+namespace MP.INVE.Data
+{
+ public class SelectMagListParams
+ {
+ #region Public Constructors
+
+ public SelectMagListParams()
+ { }
+
+ #endregion Public Constructors
+
+ #region Public Properties
+
+ public int CurrPage { get; set; } = 1;
+ public int NumRec { get; set; } = 10;
+ public int TotCount { get; set; } = 0;
+ public int MaxRecord { get; set; } = 100;
+ public bool inCorso { get; set; } = true;
+ public bool reqNew { get; set; } = false;
+
+ #endregion Public Properties
+
+ #region Public Methods
+
+ public override bool Equals(object obj)
+ {
+ if (!(obj is SelectInveSessionParams item))
+ return false;
+
+ if (MaxRecord != item.MaxRecord)
+ return false;
+
+ if (TotCount != item.TotCount)
+ return false;
+
+ if (NumRec != item.NumRec)
+
+ if (CurrPage != item.CurrPage)
+ return false;
+
+ if (inCorso != item.inCorso)
+ return false;
+
+ if (reqNew != item.reqNew)
+ return false;
+
+
+ return true;
+ }
+
+ public override int GetHashCode()
+ {
+ return base.GetHashCode();
+ }
+
+ #endregion Public Methods
+ }
+}
\ No newline at end of file
diff --git a/MP.INVE/MP.INVE.csproj b/MP.INVE/MP.INVE.csproj
index 4b888e6e..ee51c709 100644
--- a/MP.INVE/MP.INVE.csproj
+++ b/MP.INVE/MP.INVE.csproj
@@ -5,7 +5,7 @@
enable
enable
MP.INVE
- 6.16.2211.2108
+ 6.16.2211.2110
diff --git a/MP.INVE/Pages/Starter.razor b/MP.INVE/Pages/Starter.razor
index a23b7545..f4cf3b72 100644
--- a/MP.INVE/Pages/Starter.razor
+++ b/MP.INVE/Pages/Starter.razor
@@ -25,102 +25,12 @@
}
else
{
- @if (reqNew)
- {
-
-
-
-
-
-
-
-
- Codice magazzino
-
-
-
-
-
-
-
-
-
-
-
-
- @if (codMag != "")
- {
-
-
-
- }
-
-
-
-
-
-
- }
-
-
-
- | ID magazzino |
- Codice magazzino |
- Codice azienda |
- Descrizione |
- |
-
-
-
- @if (elencoMagazzini != null)
- {
- @foreach (var item in elencoMagazzini)
- {
-
- |
- @item.MagID
- |
-
- @item.CodMag
- |
-
-
- @item.CodCS
- |
-
- @item.DescMag
- |
-
-
- |
-
-
- }
- }
-
-
+
}
-
diff --git a/MP.INVE/Pages/Starter.razor.cs b/MP.INVE/Pages/Starter.razor.cs
index 25b42cc3..76cd6bf4 100644
--- a/MP.INVE/Pages/Starter.razor.cs
+++ b/MP.INVE/Pages/Starter.razor.cs
@@ -38,7 +38,52 @@ namespace MP.INVE.Pages
[Inject]
private NavigationManager NavManager { get; set; } = null!;
+ public SelectMagListParams currParams = new SelectMagListParams();
+ private int totalCount
+ {
+ get => currParams.TotCount;
+ set => currParams.TotCount = value;
+ }
+ private int numRecord
+ {
+ get => currParams.NumRec;
+ set
+ {
+ if (currParams.NumRec != value)
+ {
+ currParams.NumRec = value;
+ }
+ }
+ }
+ private int currPage
+ {
+ get => currParams.CurrPage;
+ set
+ {
+ if (currParams.CurrPage != value)
+ {
+ currParams.CurrPage = value;
+ }
+ }
+ }
+ private bool reqNew
+ {
+ get => currParams.reqNew;
+ set => currParams.reqNew = value;
+ }
+ private bool inCorso
+ {
+ get => currParams.inCorso;
+ set
+ {
+ if (currParams.inCorso != value)
+ {
+ currParams.inCorso = value;
+ }
+ }
+
+ }
private List? elencoMagazzini;
protected override async Task OnInitializedAsync()
@@ -101,57 +146,19 @@ namespace MP.INVE.Pages
await reloadData();
}
}
+ protected void ForceReload(int newNum)
+ {
+ numRecord = newNum;
+ }
+
+ protected void ForceReloadPage(int newNum)
+ {
+ currPage = newNum;
+ }
- private int idOperatore { get; set; } = 0;
- private string authKey { get; set; } = "";
- private bool reqNew { get; set; } = false;
private bool isLoading { get; set; } = false;
private string codMag { get; set; } = "";
private string desc { get; set; } = "";
-
-#if false
- protected override async Task OnAfterRenderAsync(bool firstRender)
- {
- if (firstRender)
- {
- await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{101}");
- await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{101}", rawCode);
- }
- }
-#endif
-
- protected string BaseUrlTab { get => $"{Configuration["ServerConf:BaseUrl"]}"; }
-
-#if false
- protected async Task getId()
- {
- OperatoreDTO sess = new OperatoreDTO();
- OperatoreDTO local = new OperatoreDTO();
- sess = await sessionStorage.GetItemAsync("MatrOpr");
- local = await localStorage.GetItemAsync("MatrOpr");
- if ((local != null))
- {
- string auth = local.hashAuthKey;
- idOperatore = local.MatrOpr;
- authKey = auth;
- }
- else
- {
- NavManager.NavigateTo("OperatoreLogin");
- }
- }
-#endif
-#if false
- protected string rawCode
- {
- get
- {
- string answ = "";
- answ = $"{BaseUrlTab}MatrOpr={idOperatore}&UserAuthKey={authKey}";
- return answ;
- }
- }
-#endif
}
}
\ No newline at end of file
diff --git a/MP.INVE/Resources/ChangeLog.html b/MP.INVE/Resources/ChangeLog.html
index 8b7359cb..1f572910 100644
--- a/MP.INVE/Resources/ChangeLog.html
+++ b/MP.INVE/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
Modulo MAPOINVE
- Versione: 6.16.2211.2108
+ Versione: 6.16.2211.2110
Note di rilascio:
-
diff --git a/MP.INVE/Resources/VersNum.txt b/MP.INVE/Resources/VersNum.txt
index b6004b2b..297be395 100644
--- a/MP.INVE/Resources/VersNum.txt
+++ b/MP.INVE/Resources/VersNum.txt
@@ -1 +1 @@
-6.16.2211.2108
+6.16.2211.2110
diff --git a/MP.INVE/Resources/manifest.xml b/MP.INVE/Resources/manifest.xml
index bfe84696..53362599 100644
--- a/MP.INVE/Resources/manifest.xml
+++ b/MP.INVE/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 6.16.2211.2108
+ 6.16.2211.2110
https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/MP.INVE.zip
https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/ChangeLog.html
false