Merge branch 'release/FixDecimalDisplay01'
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Upsert record Project + refresh cache
|
||||
/// </summary>
|
||||
/// <param name="nKey">Key di riferimento</param>
|
||||
/// <param name="projDbId">ID Record progetto da aggiornare</param>
|
||||
/// <param name="procTime">Durata progetto (cumulata)</param>
|
||||
/// <param name="valAct">Valore Progresso attuale (tipicamente num barre/pezzi)</param>
|
||||
/// <param name="valMax">Valore Progresso max atteso (tipicamente num barre/pezzi)</param>
|
||||
/// <returns>Bool aggiornamento</returns>
|
||||
public async Task<bool> 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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converte il DTO in ItemModel
|
||||
/// </summary>
|
||||
@@ -1303,34 +1346,6 @@ namespace MagMan.Data.Tenant.Services
|
||||
return prjCloudId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Upsert record Project + refresh cache
|
||||
/// </summary>
|
||||
/// <param name="nKey">Key di riferimento</param>
|
||||
/// <param name="projDbId">ID Record progetto da aggiornare</param>
|
||||
/// <param name="procTime">Durata progetto (cumulata)</param>
|
||||
/// <param name="valAct">Valore Progresso attuale (tipicamente num barre/pezzi)</param>
|
||||
/// <param name="valMax">Valore Progresso max atteso (tipicamente num barre/pezzi)</param>
|
||||
/// <returns>Bool aggiornamento</returns>
|
||||
public async Task<bool> 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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera ultimo record attivo ReqPlan x tipo richiesto
|
||||
/// </summary>
|
||||
@@ -1546,7 +1561,9 @@ namespace MagMan.Data.Tenant.Services
|
||||
#region Private Properties
|
||||
|
||||
private string CodApp { get; set; } = "";
|
||||
|
||||
private Dictionary<int, string> ConnStringLUT { get; set; } = new Dictionary<int, string>();
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -112,11 +112,25 @@
|
||||
@if (MaterialSel.IsWall)
|
||||
{
|
||||
<td class="text-end">
|
||||
@($"{item.WMm:N2}")
|
||||
@if (hasDecimal(item.WMm))
|
||||
{
|
||||
@($"{item.WMm:N2}")
|
||||
}
|
||||
else
|
||||
{
|
||||
@($"{item.WMm:N0}")
|
||||
}
|
||||
</td>
|
||||
}
|
||||
<td class="text-end">
|
||||
@($"{item.LMm:N2}")
|
||||
@if (hasDecimal(item.LMm))
|
||||
{
|
||||
@($"{item.LMm:N2}")
|
||||
}
|
||||
else
|
||||
{
|
||||
@($"{item.LMm:N0}")
|
||||
}
|
||||
</td>
|
||||
<AuthorizeView Roles="SuperAdmin, Admin">
|
||||
<Authorized>
|
||||
|
||||
@@ -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<RawItemModel>? ListRecords = null;
|
||||
|
||||
private bool onlyActive = true;
|
||||
|
||||
private int RawItemId = 0;
|
||||
|
||||
private List<RawItemModel>? 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;
|
||||
|
||||
@@ -112,7 +112,14 @@
|
||||
<td class="text-end">
|
||||
@if (item.IsBeam)
|
||||
{
|
||||
@($"{item.WMm:N2}")
|
||||
@if (hasDecimal(item.WMm))
|
||||
{
|
||||
@($"{item.WMm:N2}")
|
||||
}
|
||||
else
|
||||
{
|
||||
@($"{item.WMm:N0}")
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -120,7 +127,14 @@
|
||||
}
|
||||
</td>
|
||||
<td class="text-end">
|
||||
@($"{item.HMm:N2}")
|
||||
@if(hasDecimal(item.HMm))
|
||||
{
|
||||
@($"{item.HMm:N2}")
|
||||
}
|
||||
else
|
||||
{
|
||||
@($"{item.HMm:N0}")
|
||||
}
|
||||
</td>
|
||||
@if (MaterialId == 0)
|
||||
{
|
||||
|
||||
@@ -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!
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Version>1.0.2407.0308</Version>
|
||||
<Version>1.0.2407.0314</Version>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<EnableNETAnalyzers>true</EnableNETAnalyzers>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>MagMan - Wood Warehouse Management System</i>
|
||||
<h4>Versione: 1.0.2407.0308</h4>
|
||||
<h4>Versione: 1.0.2407.0314</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.0.2407.0308
|
||||
1.0.2407.0314
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.0.2407.0308</version>
|
||||
<version>1.0.2407.0314</version>
|
||||
<url>http://nexus.steamware.net/repository/SWS/MagMan/stable/0/MagMan.UI.zip</url>
|
||||
<changelog>http://nexus.steamware.net/repository/SWS/MagMan/stable/0/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user