- @if (ListRecords == null)
+ @if (ListRecords == null || isLoading)
{
}
@@ -55,9 +55,9 @@
ID
Mat.Code
Descr.
-
W (mm)
-
H (mm)
-
L (mm)
+
W (mm)
+
H (mm)
+ @*
L (mm) *@
@*
*@
@@ -66,10 +66,23 @@
{
+ DoSelect(item)">
DoEdit(item)">
- @item.MatId
+ @if (item.IsBeam)
+ {
+
+
+
+ }
+ else if (@item.IsWall)
+ {
+
+
+
+ }
+ @item.MatId
@item.MatCode
@@ -77,15 +90,22 @@
@item.MatDesc
-
- @($"{item.WMm:N2}")
+
+ @if (item.IsBeam)
+ {
+ @($"{item.WMm:N2}")
+ }
+ else
+ {
+ -
+ }
-
+
@($"{item.HMm:N2}")
-
- @($"{item.LMm:N2}")
-
+ @*
+ @($"{item.LMm:N2}")
+ *@
@*
DeleteRecord(item)">
*@
diff --git a/MagMan.UI/Components/MaterialMan.razor.cs b/MagMan.UI/Components/MaterialMan.razor.cs
index 12dd2b8..fbb97ec 100644
--- a/MagMan.UI/Components/MaterialMan.razor.cs
+++ b/MagMan.UI/Components/MaterialMan.razor.cs
@@ -1,6 +1,7 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
+// Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this
+// file to you under the MIT license.
using EgwCoreLib.Razor;
+using MagMan.Core.Services;
using MagMan.Data.Admin.DbModels;
using MagMan.Data.Admin.Services;
using MagMan.Data.Tenant.DbModels;
@@ -18,6 +19,9 @@ namespace MagMan.UI.Components
[Parameter]
public int CustomerId { get; set; } = 0;
+ [Parameter]
+ public EventCallback E_MaterialSel { get; set; }
+
[Parameter]
public int KeyNum { get; set; } = 0;
@@ -25,17 +29,20 @@ namespace MagMan.UI.Components
#region Protected Properties
+ [Inject]
+ protected MessageService AppMService { get; set; } = null!;
+
[Inject]
protected IConfiguration Configuration { get; set; } = null!;
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
+ protected int totalCount { get; set; } = 0;
+
[Inject]
protected TenantService TService { get; set; } = null!;
- protected int totalCount { get; set; } = 0;
-
#endregion Protected Properties
#region Protected Methods
@@ -45,7 +52,11 @@ namespace MagMan.UI.Components
string answ = "";
if (CurrItem != null)
{
- answ = curItem.MatId == CurrItem.MatId? "table-info" : "";
+ answ = curItem.MatId == CurrItem.MatId ? "table-info" : "";
+ }
+ else
+ {
+ answ = curItem.MatId == MaterialId ? "table-info" : "";
}
return answ;
}
@@ -71,6 +82,22 @@ namespace MagMan.UI.Components
protected void DoEdit(MaterialModel? selItem)
{
CurrItem = selItem;
+ if (selItem == null)
+ {
+ DoSelect(null);
+ }
+ }
+ protected void DoSelect(MaterialModel? selItem)
+ {
+ if (selItem != null)
+ {
+ MaterialId = selItem.MatId;
+ }
+ else
+ {
+ MaterialId = 0;
+ }
+ E_MaterialSel.InvokeAsync(selItem);
}
protected async Task ForceReload(bool force)
@@ -79,6 +106,12 @@ namespace MagMan.UI.Components
await ReloadData();
}
+ protected override void OnInitialized()
+ {
+ currSearch = "";
+ AppMService.EA_SearchUpdated += AppMService_EA_SearchUpdated;
+ }
+
protected override async Task OnParametersSetAsync()
{
await ReloadData();
@@ -88,11 +121,14 @@ namespace MagMan.UI.Components
{
numRecord = newNum;
currPage = 1;
+ InvokeAsync(ReloadData);
}
protected void SetPage(int newNum)
{
currPage = newNum;
+ DoSelect(null);
+ InvokeAsync(ReloadData);
}
protected async Task SortRequested(Sorter.SortCallBack e)
@@ -104,11 +140,13 @@ namespace MagMan.UI.Components
#endregion Protected Methods
-
#region Private Fields
private MaterialModel? CurrItem = null;
+ private int MaterialId = 0;
+ private string currSearch = "";
+ private int filtType = 0;
private List? ListRecords = null;
private List? SearchRecords = null;
@@ -123,30 +161,6 @@ namespace MagMan.UI.Components
private int currPage { get; set; } = 1;
- private bool isLoading { get; set; } = false;
-
- private int numRecord { get; set; } = 10;
-
- #endregion Private Properties
-
- #region Private Methods
-
- private async Task ReloadData()
- {
- isLoading = true;
- ListRecords = null;
- SearchRecords = await TService.MaterialGetAll(KeyNum, false);
- // verifico se filtrare x beam/wall
- if (FiltType> 0)
- {
- SearchRecords = SearchRecords.Where(x => (x.IsBeam && FiltType == 1) || (x.IsWall && FiltType == 2)).ToList();
- }
- totalCount = SearchRecords.Count;
- SortTable();
- isLoading = false;
- }
-
- private int filtType = 0;
private int FiltType
{
get => filtType;
@@ -155,12 +169,48 @@ namespace MagMan.UI.Components
if (filtType != value)
{
filtType = value;
- var pUpd = Task.Run(async () => await ReloadData());
- pUpd.Wait();
+ InvokeAsync(ReloadData);
+ InvokeAsync(StateHasChanged);
}
}
}
+ private bool isLoading { get; set; } = false;
+
+ private int numRecord { get; set; } = 10;
+
+ #endregion Private Properties
+
+ #region Private Methods
+
+ private async void AppMService_EA_SearchUpdated()
+ {
+ currSearch = AppMService.SearchVal;
+ await ReloadData();
+ }
+
+ private async Task ReloadData()
+ {
+ isLoading = true;
+ await InvokeAsync(StateHasChanged);
+ ListRecords = null;
+ SearchRecords = await TService.MaterialGetAll(KeyNum, false);
+ // verifico se filtrare x beam/wall
+ if (FiltType > 0)
+ {
+ SearchRecords = SearchRecords.Where(x => (x.IsBeam && FiltType == 1) || (x.IsWall && FiltType == 2)).ToList();
+ }
+ // verifico filtro per ricerca
+ if (!string.IsNullOrEmpty(currSearch))
+ {
+ SearchRecords = SearchRecords.Where(x => x.MatCode.Contains(currSearch, StringComparison.InvariantCultureIgnoreCase) || x.MatDesc.Contains(currSearch, StringComparison.InvariantCultureIgnoreCase)).ToList();
+ }
+ totalCount = SearchRecords.Count;
+ SortTable();
+ isLoading = false;
+ await InvokeAsync(StateHasChanged);
+ }
+
private void SortTable()
{
if (SearchRecords != null)
@@ -170,7 +220,7 @@ namespace MagMan.UI.Components
{
switch (sortField)
{
- case "MatId":
+ case "RawItemId":
if (sortAsc)
{
SearchRecords = SearchRecords.OrderBy(x => x.MatId).ThenBy(x => x.MatCode).ToList();
diff --git a/MagMan.UI/Components/SearchMod.razor b/MagMan.UI/Components/SearchMod.razor
index 05ade27..cc1a2b1 100644
--- a/MagMan.UI/Components/SearchMod.razor
+++ b/MagMan.UI/Components/SearchMod.razor
@@ -3,8 +3,6 @@
diff --git a/MagMan.UI/Controllers/InventoryController.cs b/MagMan.UI/Controllers/InventoryController.cs
index 0fa8fc4..f71323c 100644
--- a/MagMan.UI/Controllers/InventoryController.cs
+++ b/MagMan.UI/Controllers/InventoryController.cs
@@ -1,4 +1,6 @@
-using MagMan.Core;
+using k8s.Models;
+using MagMan.Core;
+using MagMan.Core.DTO;
using MagMan.Core.Services;
using MagMan.Data.Admin.DbModels;
using MagMan.Data.Admin.Services;
@@ -20,12 +22,12 @@ namespace MagMan.UI.Controllers
/// Classe per logging
///
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
- private MTAdminService MTAdminService { get; set; } = null!;
+ private MTAdminService MTAdmService { get; set; } = null!;
private static JsonSerializerSettings? JSSettings;
private TenantService TService { get; set; } = null!;
public InventoryController(MTAdminService MTDataService, TenantService TDataService)
{
- MTAdminService = MTDataService;
+ MTAdmService = MTDataService;
TService = TDataService;
// json serializer... FIX errore loop circolare https://www.ryadel.com/en/jsonserializationexception-self-referencing-loop-detected-error-fix-entity-framework-asp-net-core/
JSSettings = new JsonSerializerSettings()
@@ -68,7 +70,7 @@ namespace MagMan.UI.Controllers
public async Task> Get(string id, int MatId)
{
// in primis recupero codice chiave da token...
- int nKey = await MTAdminService.MainKeyByToken(id);
+ int nKey = await MTAdmService.MainKeyByToken(id);
// ora recupero direttametne i materiali
var ListRecords = await TService.MaterialGetFilt(nKey, MatId, true);
return ListRecords;
@@ -89,11 +91,11 @@ namespace MagMan.UI.Controllers
if (!string.IsNullOrEmpty(id) && rawList != null && rawList.ItemList != null)
{
// in primis recupero codice chiave da token...
- int nKey = await MTAdminService.MainKeyByToken(id);
+ int nKey = await MTAdmService.MainKeyByToken(id);
if (nKey > 0)
{
// creo oggetti materiale da lista ricevuta
- List matList = rawList.ItemList.Select(jpl => TService.ItemFromDto(jpl)).ToList();
+ List matList = rawList.ItemList.Select(jpl => TService.ItemFromDto(jpl, true)).ToList();
foreach (var item in matList)
{
@@ -108,10 +110,14 @@ namespace MagMan.UI.Controllers
fatto = false;
}
}
+ // resetto cache redis
+ await MTAdmService.FlushRedisCache();
}
}
answ = fatto ? "OK" : "NO";
return answ;
}
+
+
}
}
diff --git a/MagMan.UI/Controllers/MaterialsController.cs b/MagMan.UI/Controllers/MaterialsController.cs
index 3534796..ef8aa5f 100644
--- a/MagMan.UI/Controllers/MaterialsController.cs
+++ b/MagMan.UI/Controllers/MaterialsController.cs
@@ -19,12 +19,12 @@ namespace MagMan.UI.Controllers
/// Classe per logging
///
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
- private MTAdminService MTAdminService { get; set; } = null!;
+ private MTAdminService MTAdmService { get; set; } = null!;
private static JsonSerializerSettings? JSSettings;
private TenantService TService { get; set; } = null!;
public MaterialsController(MTAdminService MTDataService, TenantService TDataService)
{
- MTAdminService = MTDataService;
+ MTAdmService = MTDataService;
TService = TDataService;
// json serializer... FIX errore loop circolare https://www.ryadel.com/en/jsonserializationexception-self-referencing-loop-detected-error-fix-entity-framework-asp-net-core/
JSSettings = new JsonSerializerSettings()
@@ -66,7 +66,7 @@ namespace MagMan.UI.Controllers
public async Task> Get(string id)
{
// in primis recupero codice chiave da token...
- int nKey = await MTAdminService.MainKeyByToken(id);
+ int nKey = await MTAdmService.MainKeyByToken(id);
// ora recupero direttametne i materiali
var ListRecords = await TService.MaterialGetAll(nKey, false);
return ListRecords;
@@ -87,7 +87,7 @@ namespace MagMan.UI.Controllers
if (!string.IsNullOrEmpty(id) && rawList != null && rawList.MatList != null)
{
// in primis recupero codice chiave da token...
- int nKey = await MTAdminService.MainKeyByToken(id);
+ int nKey = await MTAdmService.MainKeyByToken(id);
if (nKey > 0)
{
// creo oggetti materiale da lista ricevuta
@@ -106,6 +106,8 @@ namespace MagMan.UI.Controllers
fatto = false;
}
}
+ // resetto cache redis
+ await MTAdmService.FlushRedisCache();
}
}
answ = fatto ? "OK" : "NO";
diff --git a/MagMan.UI/Controllers/ProjectsController.cs b/MagMan.UI/Controllers/ProjectsController.cs
index 1ef0461..38b575a 100644
--- a/MagMan.UI/Controllers/ProjectsController.cs
+++ b/MagMan.UI/Controllers/ProjectsController.cs
@@ -1,8 +1,15 @@
-using MagMan.Data.Admin.DbModels;
+using k8s.Models;
+using MagMan.Core;
+using MagMan.Core.DTO;
+using MagMan.Data.Admin.DbModels;
using MagMan.Data.Admin.Services;
+using MagMan.Data.Tenant.DbModels;
+using MagMan.Data.Tenant.Services;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json;
using NLog;
+using System.Diagnostics;
namespace MagMan.UI.Controllers
{
@@ -14,10 +21,18 @@ namespace MagMan.UI.Controllers
/// Classe per logging
///
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
- private MTAdminService _DataService { get; set; } = null!;
- public ProjectsController(MTAdminService DataService)
+ private MTAdminService MTAdmService { get; set; } = null!;
+ private static JsonSerializerSettings? JSSettings;
+ private TenantService TService { get; set; } = null!;
+ public ProjectsController(MTAdminService MTDataService, TenantService TDataService)
{
- _DataService = DataService;
+ MTAdmService = MTDataService;
+ TService = TDataService;
+ // json serializer... FIX errore loop circolare https://www.ryadel.com/en/jsonserializationexception-self-referencing-loop-detected-error-fix-entity-framework-asp-net-core/
+ JSSettings = new JsonSerializerSettings()
+ {
+ ReferenceLoopHandling = ReferenceLoopHandling.Ignore
+ };
Log.Info("Avviata classe ProjectsController");
}
@@ -52,8 +67,47 @@ namespace MagMan.UI.Controllers
[HttpGet("{id}")]
public async Task> Get(string id, int KeyNum)
{
- var ListRecords = await _DataService.MachineGetByToken(id);
+ var ListRecords = await MTAdmService.MachineGetByToken(id);
return ListRecords;
}
+
+ ///
+ /// Processa una chiamata POST per l'invio di un oggetto di aggiornamento progetto
+ /// PUT: api/Inventory/upsert/00000000-0000-0000-0000-000000000000
+ ///
+ /// token comunicazione
+ ///
+ [HttpPost("upsert/{id}")]
+ public async Task upsert(string id, [FromBody] ProjectDTO projectData)
+ {
+ string answ = "ND";
+ bool fatto = false;
+ // verifico ci sia valore
+ if (!string.IsNullOrEmpty(id) && projectData != null)
+ {
+ // in primis recupero codice chiave da token...
+ int nKey = await MTAdmService.MainKeyByToken(id);
+ if (nKey > 0)
+ {
+ // converto ProjDto --> DB
+ var currRec = TService.ProjectFromDto(projectData);
+ try
+ {
+ await TService.ProjectUpdate(nKey, currRec);
+ fatto = true;
+ }
+ catch (Exception exc)
+ {
+ Log.Error($"ProjectsController.upsert | Errore in fase salvataggio ProjectDTO{Environment.NewLine}{exc}");
+ fatto = false;
+ }
+ // resetto cache redis
+ await MTAdmService.FlushRedisCache();
+
+ }
+ }
+ answ = fatto ? "OK" : "NO";
+ return answ;
+ }
}
}
diff --git a/MagMan.UI/Controllers/ResourcesController.cs b/MagMan.UI/Controllers/ResourcesController.cs
new file mode 100644
index 0000000..81edb1b
--- /dev/null
+++ b/MagMan.UI/Controllers/ResourcesController.cs
@@ -0,0 +1,117 @@
+using k8s.Models;
+using MagMan.Core;
+using MagMan.Core.DTO;
+using MagMan.Data.Admin.DbModels;
+using MagMan.Data.Admin.Services;
+using MagMan.Data.Tenant.DbModels;
+using MagMan.Data.Tenant.Services;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json;
+using NLog;
+
+namespace MagMan.UI.Controllers
+{
+ [Route("api/[controller]")]
+ [ApiController]
+ public class ResourcesController : ControllerBase
+ {
+ ///
+ /// Classe per logging
+ ///
+ private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
+ private MTAdminService MTAdmService { get; set; } = null!;
+ private static JsonSerializerSettings? JSSettings;
+ private TenantService TService { get; set; } = null!;
+ public ResourcesController(MTAdminService MTDataService, TenantService TDataService)
+ {
+ MTAdmService = MTDataService;
+ TService = TDataService;
+ // json serializer... FIX errore loop circolare https://www.ryadel.com/en/jsonserializationexception-self-referencing-loop-detected-error-fix-entity-framework-asp-net-core/
+ JSSettings = new JsonSerializerSettings()
+ {
+ ReferenceLoopHandling = ReferenceLoopHandling.Ignore
+ };
+ Log.Info("Avviata classe ResourcesController");
+ }
+
+ ///
+ /// Controllo status Alive
+ /// GET: api/Machines/alive
+ ///
+ ///
+ [HttpGet("alive")]
+ public string alive()
+ {
+ //Log.Debug("Chiamata alive");
+ return $"OK";
+ }
+
+ // GET api/Machines/5
+ [HttpGet]
+ public async Task> Get()
+ {
+ // se non ho chaive --> vuoto!
+ List ListRecords = new List();
+ await Task.Delay(100);
+ return ListRecords;
+ }
+
+ ///
+ /// Elenco Macchine dato RestToken
+ ///
+ /// Rest Token cliente
+ ///
+ // GET api/Machines/2cba60c7-7be4-40b1-aa0d-52e7c71fc1a7
+ [HttpGet("{id}")]
+ public async Task> Get(string id, int KeyNum)
+ {
+ var ListRecords = await MTAdmService.MachineGetByToken(id);
+ return ListRecords;
+ }
+
+ ///
+ /// Processa una chiamata POST per l'invio di un oggetto di aggiornamento risorse progetto (RestPayload.Resources)
+ /// PUT: api/Inventory/upsert/00000000-0000-0000-0000-000000000000
+ ///
+ /// token comunicazione
+ ///
+ [HttpPost("upsert/{id}")]
+ public async Task upsert(string id, [FromBody] RestPayload.Resources projectData)
+ {
+ string answ = "ND";
+ bool fatto = false;
+ // verifico ci sia valore
+ if (!string.IsNullOrEmpty(id) && projectData != null)
+ {
+ // in primis recupero codice chiave da token...
+ int nKey = await MTAdmService.MainKeyByToken(id);
+ if (nKey > 0)
+ {
+#if false
+ // creo oggetti materiale da lista ricevuta
+ List matList = item2Consume.ItemList.Select(jpl => TService.ItemFromDto(jpl, true)).ToList();
+
+ foreach (var item in matList)
+ {
+ try
+ {
+ await TService.ItemUpdate(nKey, item);
+ fatto = true;
+ }
+ catch (Exception exc)
+ {
+ Log.Error($"InventoryController.upsert | Errore in fase salvataggio ItemDto{Environment.NewLine}{exc}");
+ fatto = false;
+ }
+ }
+#endif
+ // resetto cache redis
+ await MTAdmService.FlushRedisCache();
+ }
+ }
+ answ = fatto ? "OK" : "NO";
+ return answ;
+ }
+ }
+}
diff --git a/MagMan.UI/MagMan.UI.csproj b/MagMan.UI/MagMan.UI.csproj
index 963cf73..1a68aab 100644
--- a/MagMan.UI/MagMan.UI.csproj
+++ b/MagMan.UI/MagMan.UI.csproj
@@ -2,7 +2,7 @@
net6.0
- 1.0.2401.1911
+ 1.0.2401.2220
enable
enable
true
@@ -36,7 +36,7 @@
-
+
diff --git a/MagMan.UI/Pages/AdminArea.razor b/MagMan.UI/Pages/AdminArea.razor
index c15ffb1..d925cba 100644
--- a/MagMan.UI/Pages/AdminArea.razor
+++ b/MagMan.UI/Pages/AdminArea.razor
@@ -22,19 +22,7 @@
@if (currMode != CtMode.Company)
{
-
- Cliente
-
- --- Selezionare Cliente ---
- @if (CustomersList != null)
- {
- @foreach (var item in CustomersList)
- {
- @item.Name [@item.CustomerID]
- }
- }
-
-
+
}
diff --git a/MagMan.UI/Pages/AdminArea.razor.cs b/MagMan.UI/Pages/AdminArea.razor.cs
index 1e2e4e1..c035dc3 100644
--- a/MagMan.UI/Pages/AdminArea.razor.cs
+++ b/MagMan.UI/Pages/AdminArea.razor.cs
@@ -31,12 +31,16 @@ namespace MagMan.UI.Pages
#region Protected Methods
- protected override async Task OnInitializedAsync()
+ protected override void OnInitialized()
{
AppMService.ShowSearch = false;
AppMService.PageName = "Admin Area";
AppMService.PageIcon = "fa-solid fa-house pr-2";
- await ReloadData();
+ }
+
+ protected void SaveCust(int newCustId)
+ {
+ CustomerID = newCustId;
}
#endregion Protected Methods
@@ -44,14 +48,12 @@ namespace MagMan.UI.Pages
#region Private Fields
private CtMode currMode = CtMode.Company;
- private int CustomerID = 0;
- private List? CustomersList = null;
#endregion Private Fields
#region Private Properties
- private bool isLoading { get; set; } = false;
+ private int CustomerID { get; set; } = 0;
[Inject]
private NavigationManager NavMan { get; set; } = null!;
@@ -66,13 +68,6 @@ namespace MagMan.UI.Pages
return answ;
}
- private async Task ReloadData()
- {
- isLoading = true;
- CustomersList = await MTService.CustomerGetAll();
- isLoading = false;
- }
-
private void SetMode(CtMode newMode)
{
currMode = newMode;
diff --git a/MagMan.UI/Pages/Index.razor b/MagMan.UI/Pages/Index.razor
index ba53cc2..d1470ea 100644
--- a/MagMan.UI/Pages/Index.razor
+++ b/MagMan.UI/Pages/Index.razor
@@ -55,7 +55,7 @@
-
+
Dati Macchine
@@ -65,7 +65,7 @@
-
+
Magazzino
diff --git a/MagMan.UI/Pages/WareHouse.razor b/MagMan.UI/Pages/WareHouse.razor
index 9990900..91abc55 100644
--- a/MagMan.UI/Pages/WareHouse.razor
+++ b/MagMan.UI/Pages/WareHouse.razor
@@ -4,29 +4,9 @@
-
- @foreach (var item in Enum.GetValues(typeof(CtMode)))
- {
-
- SetMode((CtMode)item)">@((CtMode)item)
-
- }
-
-
- Cliente
-
- --- Selezionare Cliente ---
- @if (CustomersList != null)
- {
- @foreach (var item in CustomersList)
- {
- @item.Name [@item.CustomerID]
- }
- }
-
-
+
@if (CustomerID == 0)
@@ -40,12 +20,15 @@
}
else
{
- @if (currMode == CtMode.Materials)
- {
-
- }
- else if (currMode == CtMode.Items)
- {
-
- }
+
+
+
+
+ @if (MaterialSel != null)
+ {
+
+
+
+ }
+
}
\ No newline at end of file
diff --git a/MagMan.UI/Pages/WareHouse.razor.cs b/MagMan.UI/Pages/WareHouse.razor.cs
index 864137c..3a501b0 100644
--- a/MagMan.UI/Pages/WareHouse.razor.cs
+++ b/MagMan.UI/Pages/WareHouse.razor.cs
@@ -1,72 +1,83 @@
using MagMan.Core.Services;
using MagMan.Data.Admin.DbModels;
using MagMan.Data.Admin.Services;
+using MagMan.Data.Tenant.DbModels;
using Microsoft.AspNetCore.Components;
+using YamlDotNet.Core.Tokens;
namespace MagMan.UI.Pages
{
public partial class WareHouse
{
+ #region Protected Fields
+
+ protected int nKey = 0;
+
+ #endregion Protected Fields
+
+ #region Protected Properties
+
[Inject]
protected MessageService AppMService { get; set; } = null!;
+ protected int CustomerID { get; set; } = 0;
+
+ protected string mainCss
+ {
+ get => MaterialSel == null ? "col-12" : "col-6 small";
+ }
+
[Inject]
protected MTAdminService MTService { get; set; } = null!;
+
+ #endregion Protected Properties
+
+ #region Protected Methods
+
protected override async Task OnInitializedAsync()
{
- AppMService.ShowSearch = false;
+ AppMService.ShowSearch = true;
AppMService.PageName = "Warehouse Area";
AppMService.PageIcon = "fa-solid fa-warehouse pr-2";
+ // rileggo dati
await ReloadData();
}
+ protected async Task SaveCust(int newCustId)
+ {
+ CustomerID = newCustId;
+ await ReloadData();
+ }
+
+ protected void SaveMat(MaterialModel? newMat)
+ {
+ MaterialSel = newMat;
+ }
+
+ #endregion Protected Methods
+
+ #region Private Fields
+
+ private int KeyNum = 0;
+ private MaterialModel? MaterialSel = null;
+
+ #endregion Private Fields
+
+ #region Private Properties
+
+ private bool isLoading { get; set; } = false;
+
+ #endregion Private Properties
+
+ #region Private Methods
+
private async Task ReloadData()
{
isLoading = true;
- CustomersList = await MTService.CustomerGetAll();
nKey = await MTService.MainKeyByCustomer(CustomerID);
isLoading = false;
}
- protected int nKey = 0;
-
- private bool isLoading { get; set; } = false;
- private CtMode currMode = CtMode.Materials;
- protected int CustomerID
- {
- get => customerID;
- set
- {
- if (customerID != value)
- {
- customerID = value;
- // update keys
- var pUpd = Task.Run(async () => await ReloadData());
- pUpd.Wait();
- }
- }
- }
- private int customerID = 0;
- private int KeyNum = 0;
- private List? CustomersList = null;
-
- protected enum CtMode
- {
- Materials,
- Items,
- //Deposit,
- //Pickup
- }
-
- private string IsActive(CtMode modeReq)
- {
- string answ = currMode == modeReq ? "active" : "";
- return answ;
- }
-
- private void SetMode(CtMode newMode)
- {
- currMode = newMode;
- }
+ #endregion Private Methods
}
}
\ No newline at end of file
diff --git a/MagMan.UI/Shared/NavMenu.razor b/MagMan.UI/Shared/NavMenu.razor
index 8c09629..8d63bc6 100644
--- a/MagMan.UI/Shared/NavMenu.razor
+++ b/MagMan.UI/Shared/NavMenu.razor
@@ -46,6 +46,11 @@
Dati Macchine
+
+
+ Progetti
+
+
Magazzino
diff --git a/README.md b/README.md
index eaa78d9..6b5e52a 100644
--- a/README.md
+++ b/README.md
@@ -4,13 +4,13 @@ Gestione magazzino per applicazioni BeamWall, integrato con EgtBeamWall.
## Prerequisiti e versioni
-Un prerequisito è il disaccoppiamento tra EgtB&W ed il componente MagMan: abbiamo che il sw EgtB&W è basato su **netFramework 4.7.2** mentre l'applciazione, che deve girare su windows e linux e quindi **dotNet Core 6.0** LTS o successivi, non può essere direttamente connessa tramite dll
+Un prerequisito è il disaccoppiamento tra EgtB&W ed il componente MagMan: abbiamo che il sw EgtB&W è basato su **netFramework 4.7.2** mentre l'applicazione, che deve girare su windows e linux e quindi **dotNet Core 6.0** LTS o successivi, non può essere direttamente connessa tramite dll
In particoalre il problema c'è a livello delle librerie di accesso EntityFramework.
Per superare il problema il disaccoppiamento sarà svolto tramite chaimate **REST** che il client (applicazione EgtB&W) farà al server.
-Inoltre la distribuzione della funzionalità, per essere semplificata,a vverra tramite apposito pacchetto nuget ospitato sul repository nexus aziendale.
+Inoltre la distribuzione della funzionalità, per essere semplificata, avverrà tramite apposito pacchetto nuget ospitato sul repository nexus aziendale.
## Descrizione
@@ -23,6 +23,7 @@ Il sofware è previsto in modalità **multi-tenant**, dove verrà generato un DB
Di base il sistema deve prevedere il riconoscimento degli utenti e/o dei software EgalWare licenziati e reindirizzare l'impiego delle funzionalità avanzate verso il DB dedicato al cliente.
+
## Architettura
Il progetto è pensato in architettura **multi-tenant** per la versione **online**, ovvero un unico indirizzo web (tramite load balancers x reverse proxy) che fornisce l'applicazione a tutti i clienti.
diff --git a/README.pdf b/README.pdf
index 660cfaf..1109a44 100644
Binary files a/README.pdf and b/README.pdf differ
diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html
index 5205fbd..943797f 100644
--- a/Resources/ChangeLog.html
+++ b/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
MagMan - Wood Warehouse Management System
- Versione: 1.0.2401.1911
+ Versione: 1.0.2401.2220
Note di rilascio:
diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt
index 07a28f9..68903f3 100644
--- a/Resources/VersNum.txt
+++ b/Resources/VersNum.txt
@@ -1 +1 @@
-1.0.2401.1911
+1.0.2401.2220
diff --git a/Resources/manifest.xml b/Resources/manifest.xml
index c10d440..912635f 100644
--- a/Resources/manifest.xml
+++ b/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
-
1.0.2401.1911
+ 1.0.2401.2220
http://nexus.steamware.net/repository/SWS/MagMan/stable/0/MagMan.UI.zip
http://nexus.steamware.net/repository/SWS/MagMan/stable/0/ChangeLog.html
false
diff --git a/TestConsoleApp/App.config b/TestConsoleApp/App.config
index 56efbc7..f7ec97c 100644
--- a/TestConsoleApp/App.config
+++ b/TestConsoleApp/App.config
@@ -1,6 +1,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TestConsoleApp/Program.cs b/TestConsoleApp/Program.cs
index abe6c0c..ea4335a 100644
--- a/TestConsoleApp/Program.cs
+++ b/TestConsoleApp/Program.cs
@@ -44,7 +44,7 @@ namespace DemoApp
Console.WriteLine("Premere un tasto per lettura archivio materiali");
answ = Console.ReadLine();
// leggo materiali
- var matList = await commLib.GetMaterials();
+ var matList = await commLib.MaterialsGet();
if (matList != null)
{
foreach (var item in matList)
@@ -65,7 +65,7 @@ namespace DemoApp
}
answ = Console.ReadLine();
// leggo inventario
- var inventList = await commLib.GetInventario(0);
+ var inventList = await commLib.InventarioGet(0);
if (inventList != null)
{
foreach (var itemMat in inventList)