84 lines
2.6 KiB
Plaintext
84 lines
2.6 KiB
Plaintext
@using SHERPA.BBM.UI.Data
|
|
@using SHERPA.BBM.UI.Components;
|
|
@using CORE.DbModels
|
|
@inject BBM_EFService BBMService
|
|
|
|
<div class="card">
|
|
<div class="card-header bg-info text-light">
|
|
<b>Modifica</b>
|
|
</div>
|
|
<div class="card-body small">
|
|
<EditForm Model="@_currItem">
|
|
<DataAnnotationsValidator />
|
|
<Blazorise.ValidationSummary />
|
|
<div class="row">
|
|
<div class="col-6 col-lg-3">
|
|
<div class="form-group">
|
|
<label for="codNeg">Rag.Sociale:</label>
|
|
<InputText id="RagSoc" @bind-Value="_currItem.RagSoc" class="form-control form-control-sm" />
|
|
</div>
|
|
</div>
|
|
<div class="col-6 col-lg-3">
|
|
<label for="dataIns">Descr:</label>
|
|
<InputText id="Descript" @bind-Value="_currItem.Descript" class="form-control form-control-sm" />
|
|
</div>
|
|
<div class="col-6 col-lg-3">
|
|
<label for="dataIns">P.Iva:</label>
|
|
<InputText id="PI" @bind-Value="_currItem.PI" class="form-control form-control-sm" />
|
|
</div>
|
|
<div class="col-6 col-lg-3">
|
|
<label for="dataIns">C.Fisc:</label>
|
|
<InputText id="CF" @bind-Value="_currItem.CF" class="form-control form-control-sm" />
|
|
</div>
|
|
<div class="col-6 col-lg-3">
|
|
<input type="submit" class="btn btn-success btn-block" value="Save" @onclick="saveUpdate" />
|
|
</div>
|
|
<div class="col-6 col-lg-3">
|
|
<button type="button" class="btn btn-warning btn-block" value="Cancel" @onclick="cancelUpdate">Cancel</button>
|
|
</div>
|
|
</div>
|
|
</EditForm>
|
|
</div>
|
|
</div>
|
|
|
|
@code {
|
|
|
|
protected CORE.DbModels.CustomersModel _currItem = new CustomersModel();
|
|
|
|
[Parameter]
|
|
public CORE.DbModels.CustomersModel currItem
|
|
{
|
|
get
|
|
{
|
|
return _currItem = null;
|
|
}
|
|
set
|
|
{
|
|
_currItem = value;
|
|
}
|
|
}
|
|
|
|
[Parameter]
|
|
public EventCallback<int> DataReset { get; set; }
|
|
[Parameter]
|
|
public EventCallback<int> DataUpdated { get; set; }
|
|
|
|
private async Task saveUpdate()
|
|
{
|
|
if (_currItem != null)
|
|
{
|
|
BBMService.CustomerUpdate(_currItem);
|
|
await DataUpdated.InvokeAsync(1);
|
|
}
|
|
else
|
|
{
|
|
Console.WriteLine("Counter null!");
|
|
}
|
|
}
|
|
|
|
private async Task cancelUpdate()
|
|
{
|
|
await DataReset.InvokeAsync(0);
|
|
}
|
|
|
|
} |