Files
gwms/GWMS.UI/Components/ItemPlanDetail.razor
2021-08-24 10:13:06 +02:00

96 lines
2.8 KiB
Plaintext

@using GWMS.UI.Components
@using GWMS.Data.DatabaseModels
@using System.Security.Claims
@using Microsoft.AspNetCore.Components.Authorization
@using GWMS.UI.Data
@using GWMS.Data.DTO
@using Microsoft.Extensions.Configuration
<div class="my-0 small">
<div class="row text-center small">
@if (_currList == null)
{
<div class="col-12">
<i class="fas fa-circle-notch fa-spin"></i>
</div>
}
else if (_currList.Count == 0)
{
<div class="col-12">
<div class="text-secondary text-center p-1">-</div>
</div>
}
else
{
foreach (var item in _currList)
{
<div class="col-12">
<button class="btn btn-block btn-outline-dark px-1" @onclick="() => Edit(item)">
<div class="d-flex justify-content-between">
<div class="px-1">
<i class="fas fa-gas-pump" aria-hidden="true"></i> @item.Plant.PlantDesc
</div>
<div class="px-1">
<span class="badge badge-pill badge-primary"><b>@item.Note</b></span>
</div>
</div>
<div class="d-flex text-center">
<div class="px-1">
<i class="fas fa-industry" aria-hidden="true"></i> @item.Supplier.SupplierDesc
</div>
</div>
<div class="d-flex text-center">
<div class="px-1">
<i class="fas fa-truck-moving" aria-hidden="true"></i> @item.Transporter.TransporterDesc
</div>
</div>
</button>
</div>
}
}
</div>
</div>
@code {
protected List<WeekPlanModel> _currList { get; set; } = new List<WeekPlanModel>();
[Parameter]
public List<WeekPlanModel> currList
{
get
{
return _currList;
}
set
{
_currList = value;
}
}
protected void Edit(WeekPlanModel selRecord)
{
selRecordChanged.InvokeAsync(selRecord.WeekPlanId);
}
[Parameter]
public EventCallback<int> selRecordChanged { get; set; }
private WeekPlanModel _currRecord = null;
private WeekPlanModel currRecord
{
get
{
return _currRecord;
}
set
{
bool doReport = (_currRecord == null) || !_currRecord.Equals(value);
if (doReport)
{
_currRecord = value;
}
}
}
}