diff --git a/MagMan.UI/Components/CmpTop.razor.cs b/MagMan.UI/Components/CmpTop.razor.cs
index 7e309de..12f1112 100644
--- a/MagMan.UI/Components/CmpTop.razor.cs
+++ b/MagMan.UI/Components/CmpTop.razor.cs
@@ -1,22 +1,13 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
using Microsoft.AspNetCore.Components;
+using MagMan.UI.Components;
+using System.Security.Claims;
+using Microsoft.AspNetCore.Components.Authorization;
+using MagMan.Core.Services;
namespace MagMan.UI.Components
{
public partial class CmpTop
{
- #region Private Properties
-
- private string PageIcon { get; set; } = "";
-
- private string PageName { get; set; } = "";
-
- [CascadingParameter(Name = "ShowSearch")]
- private bool ShowSearch { get; set; } = false;
-
- #endregion Private Properties
-
#region Public Methods
public void Dispose()
@@ -36,6 +27,13 @@ namespace MagMan.UI.Components
#endregion Public Methods
+ #region Protected Properties
+
+ [Inject]
+ protected MessageService AppMessages { get; set; } = null!;
+
+ #endregion Protected Properties
+
#region Protected Methods
protected override void OnInitialized()
@@ -49,5 +47,16 @@ namespace MagMan.UI.Components
}
#endregion Protected Methods
+
+ #region Private Properties
+
+ private string PageIcon { get; set; } = "";
+
+ private string PageName { get; set; } = "";
+
+ [CascadingParameter(Name = "ShowSearch")]
+ private bool ShowSearch { get; set; } = false;
+
+ #endregion Private Properties
}
}
\ No newline at end of file
diff --git a/MagMan.UI/Components/CustomerEdit.razor b/MagMan.UI/Components/CustomerEdit.razor
index 3f140c9..853870a 100644
--- a/MagMan.UI/Components/CustomerEdit.razor
+++ b/MagMan.UI/Components/CustomerEdit.razor
@@ -1,13 +1,19 @@
@if (CurrRecord != null)
{
-
+
-
+
+
-
diff --git a/MagMan.UI/Controllers/ItemsController.cs b/MagMan.UI/Controllers/InventoryController.cs
similarity index 69%
rename from MagMan.UI/Controllers/ItemsController.cs
rename to MagMan.UI/Controllers/InventoryController.cs
index 0543984..a2f1b9b 100644
--- a/MagMan.UI/Controllers/ItemsController.cs
+++ b/MagMan.UI/Controllers/InventoryController.cs
@@ -1,4 +1,5 @@
using MagMan.Core;
+using MagMan.Core.Services;
using MagMan.Data.Admin.DbModels;
using MagMan.Data.Admin.Services;
using MagMan.Data.Tenant.DbModels;
@@ -13,7 +14,7 @@ namespace MagMan.UI.Controllers
{
[Route("api/[controller]")]
[ApiController]
- public class ItemsController : ControllerBase
+ public class InventoryController : ControllerBase
{
///
/// Classe per logging
@@ -22,7 +23,7 @@ namespace MagMan.UI.Controllers
private MTAdminService MTAdminService { get; set; } = null!;
private static JsonSerializerSettings? JSSettings;
private TenantService TService { get; set; } = null!;
- public ItemsController(MTAdminService MTDataService, TenantService TDataService)
+ public InventoryController(MTAdminService MTDataService, TenantService TDataService)
{
MTAdminService = MTDataService;
TService = TDataService;
@@ -31,12 +32,12 @@ namespace MagMan.UI.Controllers
{
ReferenceLoopHandling = ReferenceLoopHandling.Ignore
};
- Log.Info("Avviata classe ItemsController");
+ Log.Info("Avviata classe InventoryController");
}
///
/// Controllo status Alive
- /// GET: api/Items/alive
+ /// GET: api/Inventory/alive
///
///
[HttpGet("alive")]
@@ -46,11 +47,11 @@ namespace MagMan.UI.Controllers
return $"OK";
}
- // GET api/Items
+ // GET api/Inventory
[HttpGet]
public async Task> Get()
{
- // se non ho chaive --> vuoto!
+ // se non ho chiave --> vuoto!
List ListRecords = new List();
await Task.Delay(100);
return ListRecords;
@@ -62,20 +63,20 @@ namespace MagMan.UI.Controllers
/// Rest Token cliente
/// ID del materiale cercato
///
- // GET api/Items/00000000-0000-0000-0000-000000000000
+ // GET api/Inventory/00000000-0000-0000-0000-000000000000
[HttpGet("{id}")]
- public async Task> Get(string id, int MatId)
+ public async Task> Get(string id, int MatId)
{
// in primis recupero codice chiave da token...
int nKey = await MTAdminService.MainKeyByToken(id);
// ora recupero direttametne i materiali
- var ListRecords = await TService.ItemGetByMat(nKey, MatId);
+ var ListRecords = await TService.MaterialGetFilt(nKey, MatId, true);
return ListRecords;
}
///
/// Processa una chiamata POST per l'invio di un array Json di oggetti MaterialModel da salvare
- /// PUT: api/Items/upsert/00000000-0000-0000-0000-000000000000
+ /// PUT: api/Inventory/upsert/00000000-0000-0000-0000-000000000000
///
/// token comunicazione
///
@@ -89,20 +90,23 @@ namespace MagMan.UI.Controllers
{
// in primis recupero codice chiave da token...
int nKey = await MTAdminService.MainKeyByToken(id);
- // creo oggetti materiale da lista ricevuta
- List matList = rawList.ItemList.Select(jpl => TService.ItemFromDto(jpl)).ToList();
-
- foreach (var item in matList)
+ if (nKey > 0)
{
- try
+ // creo oggetti materiale da lista ricevuta
+ List matList = rawList.ItemList.Select(jpl => TService.ItemFromDto(jpl)).ToList();
+
+ foreach (var item in matList)
{
- await TService.ItemUpdate(nKey, item);
- fatto = true;
- }
- catch (Exception exc)
- {
- Log.Error($"ItemsController.upsert | Errore in fase salvataggio ItemDto{Environment.NewLine}{exc}");
- fatto = false;
+ 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;
+ }
}
}
}
diff --git a/MagMan.UI/Controllers/MaterialsController.cs b/MagMan.UI/Controllers/MaterialsController.cs
index 754dafc..3534796 100644
--- a/MagMan.UI/Controllers/MaterialsController.cs
+++ b/MagMan.UI/Controllers/MaterialsController.cs
@@ -68,7 +68,7 @@ namespace MagMan.UI.Controllers
// in primis recupero codice chiave da token...
int nKey = await MTAdminService.MainKeyByToken(id);
// ora recupero direttametne i materiali
- var ListRecords = await TService.MaterialGetAll(nKey);
+ var ListRecords = await TService.MaterialGetAll(nKey, false);
return ListRecords;
}
@@ -88,20 +88,23 @@ namespace MagMan.UI.Controllers
{
// in primis recupero codice chiave da token...
int nKey = await MTAdminService.MainKeyByToken(id);
- // creo oggetti materiale da lista ricevuta
- List matList = rawList.MatList.Select(jpl => TService.MaterialFromDto(jpl)).ToList();
-
- foreach (var item in matList)
+ if (nKey > 0)
{
- try
+ // creo oggetti materiale da lista ricevuta
+ List matList = rawList.MatList.Select(jpl => TService.MaterialFromDto(jpl)).ToList();
+
+ foreach (var item in matList)
{
- await TService.MaterialUpdate(nKey, item);
- fatto = true;
- }
- catch (Exception exc)
- {
- Log.Error($"MaterialsController.upsert | Errore in fase salvataggio MaterialDto{Environment.NewLine}{exc}");
- fatto = false;
+ try
+ {
+ await TService.MaterialUpdate(nKey, item);
+ fatto = true;
+ }
+ catch (Exception exc)
+ {
+ Log.Error($"MaterialsController.upsert | Errore in fase salvataggio MaterialDto{Environment.NewLine}{exc}");
+ fatto = false;
+ }
}
}
}
diff --git a/MagMan.UI/MagMan.UI.csproj b/MagMan.UI/MagMan.UI.csproj
index da783b1..d3d412c 100644
--- a/MagMan.UI/MagMan.UI.csproj
+++ b/MagMan.UI/MagMan.UI.csproj
@@ -2,7 +2,7 @@
net6.0
- 1.0.2401.1614
+ 1.0.2401.1715
enable
enable
true
diff --git a/MagMan.UI/Pages/AdminArea.razor.cs b/MagMan.UI/Pages/AdminArea.razor.cs
index cd24a4b..1e2e4e1 100644
--- a/MagMan.UI/Pages/AdminArea.razor.cs
+++ b/MagMan.UI/Pages/AdminArea.razor.cs
@@ -1,9 +1,6 @@
-// Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this
-// file to you under the MIT license.
-using k8s.Models;
+using MagMan.Core.Services;
using MagMan.Data.Admin.DbModels;
using MagMan.Data.Admin.Services;
-using MagMan.Data.Tenant.Services;
using Microsoft.AspNetCore.Components;
namespace MagMan.UI.Pages
diff --git a/MagMan.UI/Pages/Index.razor.cs b/MagMan.UI/Pages/Index.razor.cs
index 98bd9f5..5c29f2f 100644
--- a/MagMan.UI/Pages/Index.razor.cs
+++ b/MagMan.UI/Pages/Index.razor.cs
@@ -1,6 +1,5 @@
-using MagMan.Data.Tenant.Services;
+using MagMan.Core.Services;
using Microsoft.AspNetCore.Components;
-using System;
namespace MagMan.UI.Pages
{
diff --git a/MagMan.UI/Pages/ResetCache.razor.cs b/MagMan.UI/Pages/ResetCache.razor.cs
index 5b1fec6..4f66efc 100644
--- a/MagMan.UI/Pages/ResetCache.razor.cs
+++ b/MagMan.UI/Pages/ResetCache.razor.cs
@@ -1,11 +1,6 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-using k8s.KubeConfigModels;
+using MagMan.Core.Services;
using MagMan.Data.Admin.Services;
-using MagMan.Data.Tenant.Services;
-using MagMan.UI.Shared;
using Microsoft.AspNetCore.Components;
-using System;
namespace MagMan.UI.Pages
{
diff --git a/MagMan.UI/Pages/WareHouse.razor.cs b/MagMan.UI/Pages/WareHouse.razor.cs
index e48c733..864137c 100644
--- a/MagMan.UI/Pages/WareHouse.razor.cs
+++ b/MagMan.UI/Pages/WareHouse.razor.cs
@@ -1,9 +1,6 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-using k8s.Models;
+using MagMan.Core.Services;
using MagMan.Data.Admin.DbModels;
using MagMan.Data.Admin.Services;
-using MagMan.Data.Tenant.Services;
using Microsoft.AspNetCore.Components;
namespace MagMan.UI.Pages
diff --git a/MagMan.UI/Shared/MainLayout.razor b/MagMan.UI/Shared/MainLayout.razor
index 0e5211b..2131c01 100644
--- a/MagMan.UI/Shared/MainLayout.razor
+++ b/MagMan.UI/Shared/MainLayout.razor
@@ -1,10 +1,5 @@
@inherits LayoutComponentBase
-@using MagMan.UI.Components
-@inject MessageService MessageService
-@implements IDisposable
-
-
MagMan UI
@@ -27,46 +22,3 @@
-
-@code {
- bool ShowSearch { get; set; } = false;
-
- protected override void OnInitialized()
- {
- MessageService.EA_ShowSearch += OnShowSearch;
- MessageService.EA_HideSearch += OnHideSearch;
- }
- public void OnShowSearch()
- {
- ShowSearch = true;
- InvokeAsync(() =>
- {
- StateHasChanged();
- });
- }
- public void OnHideSearch()
- {
- ShowSearch = false;
- InvokeAsync(() =>
- {
- StateHasChanged();
- });
- }
-
- public void Dispose()
- {
- MessageService.EA_ShowSearch -= OnShowSearch;
- MessageService.EA_ShowSearch -= OnHideSearch;
- }
-
- protected bool navLarge { get; set; } = true;
-
- protected string sideClass { get; set; } = "sidebar";
-
- protected void UpdateNavDisplay()
- {
- navLarge = !navLarge;
- sideClass = navLarge ? "sidebar" : "sidebarSmall";
- }
-
-}
diff --git a/MagMan.UI/Shared/MainLayout.razor.cs b/MagMan.UI/Shared/MainLayout.razor.cs
new file mode 100644
index 0000000..a719d54
--- /dev/null
+++ b/MagMan.UI/Shared/MainLayout.razor.cs
@@ -0,0 +1,68 @@
+using MagMan.Core.Services;
+using Microsoft.AspNetCore.Components;
+
+namespace MagMan.UI.Shared
+{
+ public partial class MainLayout : IDisposable
+ {
+ #region Public Methods
+
+ public void Dispose()
+ {
+ MessageService.EA_ShowSearch -= OnShowSearch;
+ MessageService.EA_ShowSearch -= OnHideSearch;
+ }
+
+ public void OnHideSearch()
+ {
+ ShowSearch = false;
+ InvokeAsync(() =>
+ {
+ StateHasChanged();
+ });
+ }
+
+ public void OnShowSearch()
+ {
+ ShowSearch = true;
+ InvokeAsync(() =>
+ {
+ StateHasChanged();
+ });
+ }
+
+ #endregion Public Methods
+
+ #region Protected Properties
+
+ [Inject]
+ protected MessageService MessageService { get; set; } = null!;
+
+ protected bool navLarge { get; set; } = true;
+ protected string sideClass { get; set; } = "sidebar";
+
+ #endregion Protected Properties
+
+ #region Protected Methods
+
+ protected override void OnInitialized()
+ {
+ MessageService.EA_ShowSearch += OnShowSearch;
+ MessageService.EA_HideSearch += OnHideSearch;
+ }
+
+ protected void UpdateNavDisplay()
+ {
+ navLarge = !navLarge;
+ sideClass = navLarge ? "sidebar" : "sidebarSmall";
+ }
+
+ #endregion Protected Methods
+
+ #region Private Properties
+
+ private bool ShowSearch { get; set; } = false;
+
+ #endregion Private Properties
+ }
+}
\ No newline at end of file
diff --git a/MagMan.UI/_Imports.razor b/MagMan.UI/_Imports.razor
index 848ba8c..1e0d96a 100644
--- a/MagMan.UI/_Imports.razor
+++ b/MagMan.UI/_Imports.razor
@@ -1,6 +1,7 @@
@using EgwCoreLib.Razor
@using MagMan.Core
@using MagMan.Core.DTO
+@using MagMan.Core.Services
@using MagMan.Data
@using MagMan.Data.Admin
@using MagMan.Data.Admin.DbModels
diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html
index bbca584..18377ce 100644
--- a/Resources/ChangeLog.html
+++ b/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
MagMan - Wood Warehouse Management System
-
Versione: 1.0.2401.1614
+
Versione: 1.0.2401.1715
Note di rilascio:
-
diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt
index e6729af..4180614 100644
--- a/Resources/VersNum.txt
+++ b/Resources/VersNum.txt
@@ -1 +1 @@
-1.0.2401.1614
+1.0.2401.1715
diff --git a/Resources/manifest.xml b/Resources/manifest.xml
index fbd45fb..fbe1319 100644
--- a/Resources/manifest.xml
+++ b/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 1.0.2401.1614
+ 1.0.2401.1715
http://nexus.steamware.net/repository/SWS/MagMan/stable/0/MagMan.UI.zip
http://nexus.steamware.net/repository/SWS/MagMan/stable/0/ChangeLog.html
false