Files
lux/Lux.UI/Components/Compo/Item/SellingItemEdit.razor
2026-03-13 16:07:12 +01:00

124 lines
7.2 KiB
Plaintext

<div class="rounded rounded-3 bg-secondary bg-opacity-25 bg-gradient p-2 m-0 shadow">
@if (CurrRecord != null)
{
<div><span class="fs-5"># <b>@(CurrRecord?.SellingItemID)</b></span> | Codice @CurrRecord.ItemCode</div>
<div class="row g-1">
<div class="col-md-3">
<div class="form-floating">
<select @bind="@CurrRecord.Envir" class="form-select">
<option value="NULL">--- Sel. Envir ---</option>
@foreach (var item in ListEnvir())
{
<option value="@item">@item</option>
}
</select>
<label class="small bg-opacity-50">Envir</label>
</div>
</div>
<div class="col-md-1">
<div class="form-floating">
<div class="form-control ">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" checked="@CurrRecord.IsService">
</div>
</div>
<label class="small bg-opacity-50">Serv</label>
</div>
</div>
<div class="col-md-2">
<div class="form-floating">
<input type="text" class="form-control" @bind="@CurrRecord.ExtItemCode" disabled="@CurrRecord.IsProtected">
<label class="small bg-opacity-50">ItemCode</label>
</div>
</div>
<div class="col-md-2">
<div class="form-floating">
<input type="text" class="form-control" @bind="@CurrRecord.SupplCode" disabled="@CurrRecord.IsProtected">
<label class="small bg-opacity-50">Suppl.Code</label>
</div>
</div>
<div class="col-md-2">
<div class="form-floating">
<InputDouble CssClass="form-control form-control-lg text-end" Decimals="2" Step="0.05" @bind-Value="@CurrRecord.Cost"></InputDouble>
<label class="small bg-opacity-50">Costo</label>
</div>
</div>
<div class="col-md-1">
<div class="form-floating">
<InputPercent CssClass="form-control form-control-lg text-end" ForceInvariantParsing="true" Decimals="1" @bind-Value="@MarginDec"></InputPercent>
<label class="small bg-opacity-50">Margine</label>
</div>
</div>
<div class="col-md-1">
<div class="form-floating">
<input type="text" class="form-control text-end" @bind="@CurrRecord.UM">
<label class="small bg-opacity-50">UM</label>
</div>
</div>
<div class="col-md-8">
<div class="form-floating">
<input type="text" class="form-control" @bind="@CurrRecord.Description" disabled="@CurrRecord.IsProtected">
<label class="small bg-opacity-50">Descrizione</label>
</div>
</div>
<div class="col-md-4">
<div class="form-floating">
<select @bind="@CurrRecord.JobID" class="form-select" disabled="@CurrRecord.IsProtected">
@foreach (var jType in ListJobTask)
{
<option value="@jType.JobID">@jType.Description</option>
}
</select>
<label class="small bg-opacity-50">Job Task</label>
</div>
</div>
<div class="col-md-3">
<div class="d-flex justify-content-between">
<div class="px-0 w-100">
<div class="form-floating">
<select @bind="@CurrRecord.SourceType" class="form-select" disabled="@CurrRecord.IsProtected">
@foreach (var sType in Enum.GetValues(typeof(EgwCoreLib.Lux.Core.Enums.ItemSourceType)))
{
<option value="@sType">@sType</option>
}
</select>
<label class="small bg-opacity-50">Source</label>
</div>
</div>
<div class="px-0 w-100">
<div class="form-floating">
<select @bind="@CurrRecord.ImgType" class="form-select" disabled="@CurrRecord.IsProtected">
@foreach (var sType in Enum.GetValues(typeof(EgwCoreLib.Lux.Core.Enums.ImageType)))
{
<option value="@sType">@sType</option>
}
</select>
<label class="small bg-opacity-50">Immagine</label>
</div>
</div>
</div>
</div>
<div class="col-md-3">
@if (CurrRecord.ImgType != Enums.ImageType.Calculated)
{
<div class="form-floating">
<InputFile class="form-control" OnChange="UploadFile" />
<label class="small bg-opacity-50">Carica Immagine</label>
</div>
}
</div>
<div class="col-md-6">
<div class="row g-1 py-1">
<div class="col-md-6">
<button class="btn btn-lg btn-success w-100" @onclick="DoSave">Save</button>
</div>
<div class="col-md-6">
<button class="btn btn-lg btn-warning w-100" @onclick="DoCancel">Cancel</button>
</div>
</div>
</div>
</div>
}
</div>