aggiunti colori stato in orderlist

This commit is contained in:
zaccaria.majid
2023-06-28 08:55:25 +02:00
parent 05284c34e8
commit efd23ecae3
2 changed files with 18 additions and 1 deletions
@@ -144,7 +144,9 @@ else
<td class="text-end">@item.NumType</td>
@if (!isTplPage)
{
<td class="text-end">@getOrderStatusLabel(item.OrderStatus)</td>
<td class="text-end">
<span class="badge" style="background: @getOrderStatusColor(item.OrderStatus)">@getOrderStatusLabel(item.OrderStatus)</span>
</td>
<td class="text-end">
<b>@($"{item.TotCost:C2}")</b>
<div class="small">@($"{item.Discount:C2}")</div>
@@ -200,6 +200,21 @@ namespace WebDoorCreator.UI.Components.Order
return answ;
}
protected string getOrderStatusColor(int orderStat)
{
string answ = "";
if (ListValuesAll != null)
{
var currOrdStat = ListValuesAll.Where(x => int.Parse(x.Value) == orderStat).FirstOrDefault();
if (currOrdStat != null)
{
answ = currOrdStat.DefaultVal;
}
}
return answ;
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{