diff --git a/MagMan.Data.Tenant/Services/TenantService.cs b/MagMan.Data.Tenant/Services/TenantService.cs index 709f1af..fc82588 100644 --- a/MagMan.Data.Tenant/Services/TenantService.cs +++ b/MagMan.Data.Tenant/Services/TenantService.cs @@ -23,6 +23,7 @@ namespace MagMan.Data.Tenant.Services { public class TenantService : BaseServ { + #region Public Fields public TenantController dbController = null!; @@ -806,9 +807,23 @@ namespace MagMan.Data.Tenant.Services matDescr = origItem.MatCode; if (origItem.WMm > 0) { - matDescr += $" {origItem.WMm}"; + if (hasDecimal(origItem.WMm)) + { + matDescr += $" {origItem.WMm:N2}"; + } + else + { + matDescr += $" {origItem.WMm:N0}"; + } + } + if (hasDecimal(origItem.HMm)) + { + matDescr += $"x{origItem.HMm:N2}"; + } + else + { + matDescr += $"x{origItem.HMm:N0}"; } - matDescr += $"x{origItem.HMm}"; } if (origItem != null) { @@ -1246,6 +1261,34 @@ namespace MagMan.Data.Tenant.Services return dbResult; } + /// + /// Upsert record Project + refresh cache + /// + /// Key di riferimento + /// ID Record progetto da aggiornare + /// Durata progetto (cumulata) + /// Valore Progresso attuale (tipicamente num barre/pezzi) + /// Valore Progresso max atteso (tipicamente num barre/pezzi) + /// Bool aggiornamento + public async Task ProjectSetProgr(int nKey, int projDbId, double procTime, double valAct, double valMax) + { + bool fatto = false; + string cString = ConnString(nKey); + try + { + fatto = dbController.ProjectSetProgr(cString, projDbId, procTime, valAct, valMax); + if (fatto) + { + await FlushRedisCache(); + } + } + catch (Exception exc) + { + Log.Error($"Error during ProjectSetProgr:{Environment.NewLine}{exc}"); + } + return fatto; + } + /// /// Converte il DTO in ItemModel /// @@ -1303,34 +1346,6 @@ namespace MagMan.Data.Tenant.Services return prjCloudId; } - /// - /// Upsert record Project + refresh cache - /// - /// Key di riferimento - /// ID Record progetto da aggiornare - /// Durata progetto (cumulata) - /// Valore Progresso attuale (tipicamente num barre/pezzi) - /// Valore Progresso max atteso (tipicamente num barre/pezzi) - /// Bool aggiornamento - public async Task ProjectSetProgr(int nKey, int projDbId, double procTime, double valAct, double valMax) - { - bool fatto = false; - string cString = ConnString(nKey); - try - { - fatto = dbController.ProjectSetProgr(cString, projDbId, procTime, valAct, valMax); - if (fatto) - { - await FlushRedisCache(); - } - } - catch (Exception exc) - { - Log.Error($"Error during ProjectSetProgr:{Environment.NewLine}{exc}"); - } - return fatto; - } - /// /// Recupera ultimo record attivo ReqPlan x tipo richiesto /// @@ -1546,7 +1561,9 @@ namespace MagMan.Data.Tenant.Services #region Private Properties private string CodApp { get; set; } = ""; + private Dictionary ConnStringLUT { get; set; } = new Dictionary(); + private string DbServerAddr { get; set; } = ""; #endregion Private Properties @@ -1580,6 +1597,11 @@ namespace MagMan.Data.Tenant.Services return answ; } + private bool hasDecimal(decimal num) + { + return (num - Math.Round(num) != 0); + } + #endregion Private Methods } } \ No newline at end of file diff --git a/MagMan.UI/Components/ItemMan.razor b/MagMan.UI/Components/ItemMan.razor index 7ecc096..4f5a926 100644 --- a/MagMan.UI/Components/ItemMan.razor +++ b/MagMan.UI/Components/ItemMan.razor @@ -112,11 +112,25 @@ @if (MaterialSel.IsWall) { - @($"{item.WMm:N2}") + @if (hasDecimal(item.WMm)) + { + @($"{item.WMm:N2}") + } + else + { + @($"{item.WMm:N0}") + } } - @($"{item.LMm:N2}") + @if (hasDecimal(item.LMm)) + { + @($"{item.LMm:N2}") + } + else + { + @($"{item.LMm:N0}") + } diff --git a/MagMan.UI/Components/ItemMan.razor.cs b/MagMan.UI/Components/ItemMan.razor.cs index e7d2c43..cfd4124 100644 --- a/MagMan.UI/Components/ItemMan.razor.cs +++ b/MagMan.UI/Components/ItemMan.razor.cs @@ -105,17 +105,30 @@ namespace MagMan.UI.Components } return answ; } - protected async Task CreateNew() { string matNote = $"{MaterialSel.MatCode.Replace("_", " ")}"; if (MaterialSel.IsBeam) { - matNote += $" {MaterialSel.WMm:N0}x{MaterialSel.HMm:N0}"; + if (hasDecimal(MaterialSel.WMm) || hasDecimal(MaterialSel.HMm)) + { + matNote += $" {MaterialSel.WMm:N2}x{MaterialSel.HMm:N2}"; + } + else + { + matNote += $" {MaterialSel.WMm:N0}x{MaterialSel.HMm:N0}"; + } } else { - matNote += $" {MaterialSel.HMm:N0}"; + if (hasDecimal(MaterialSel.HMm)) + { + matNote += $" {MaterialSel.HMm:N2}"; + } + else + { + matNote += $" {MaterialSel.HMm:N0}"; + } } CurrItem = new RawItemModel() { @@ -218,14 +231,23 @@ namespace MagMan.UI.Components #region Private Fields private RawItemModel? CurrItem = null; + private string currSearch = ""; + private int filtType = 0; + private string gridKey = "ItemMan"; + private List? ListRecords = null; + private bool onlyActive = true; + private int RawItemId = 0; + private List? SearchRecords = null; + private bool sortAsc = true; + private string sortField = ""; #endregion Private Fields @@ -249,7 +271,9 @@ namespace MagMan.UI.Components } private bool isLoading { get; set; } = false; + private MaterialModel materialSel { get; set; } = new MaterialModel(); + private int numRecord { get; set; } = 10; #endregion Private Properties @@ -262,6 +286,11 @@ namespace MagMan.UI.Components await ReloadData(); } + private bool hasDecimal(decimal num) + { + return (num - Math.Round(num) != 0); + } + private async Task ReloadData() { isLoading = true; diff --git a/MagMan.UI/Components/MaterialMan.razor b/MagMan.UI/Components/MaterialMan.razor index 161963b..fbb7986 100644 --- a/MagMan.UI/Components/MaterialMan.razor +++ b/MagMan.UI/Components/MaterialMan.razor @@ -112,7 +112,14 @@ @if (item.IsBeam) { - @($"{item.WMm:N2}") + @if (hasDecimal(item.WMm)) + { + @($"{item.WMm:N2}") + } + else + { + @($"{item.WMm:N0}") + } } else { @@ -120,7 +127,14 @@ } - @($"{item.HMm:N2}") + @if(hasDecimal(item.HMm)) + { + @($"{item.HMm:N2}") + } + else + { + @($"{item.HMm:N0}") + } @if (MaterialId == 0) { diff --git a/MagMan.UI/Components/MaterialMan.razor.cs b/MagMan.UI/Components/MaterialMan.razor.cs index 67f42e4..0adaec8 100644 --- a/MagMan.UI/Components/MaterialMan.razor.cs +++ b/MagMan.UI/Components/MaterialMan.razor.cs @@ -214,6 +214,11 @@ namespace MagMan.UI.Components await ReloadData(); } + private bool hasDecimal(decimal num) + { + return (num - Math.Round(num) != 0); + } + private async void QueUpdAliasMat_EA_NewMessage(object? sender, EventArgs e) { // verifico se il messaggio sia per la mia KEY e nel caso --> refresh! diff --git a/MagMan.UI/MagMan.UI.csproj b/MagMan.UI/MagMan.UI.csproj index 41c449b..6431e4e 100644 --- a/MagMan.UI/MagMan.UI.csproj +++ b/MagMan.UI/MagMan.UI.csproj @@ -2,7 +2,7 @@ net6.0 - 1.0.2407.0308 + 1.0.2407.0314 enable enable true diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index e28a924..5f6795e 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MagMan - Wood Warehouse Management System -

Versione: 1.0.2407.0308

+

Versione: 1.0.2407.0314


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index d37c98e..a1667eb 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -1.0.2407.0308 +1.0.2407.0314 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index 3331b4d..d372811 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.0.2407.0308 + 1.0.2407.0314 http://nexus.steamware.net/repository/SWS/MagMan/stable/0/MagMan.UI.zip http://nexus.steamware.net/repository/SWS/MagMan/stable/0/ChangeLog.html false