Ancora fix fasi
This commit is contained in:
@@ -17,7 +17,14 @@
|
||||
|
||||
<div class="card shadow">
|
||||
<div class="card-header">
|
||||
<h3>Gestione Etichette</h3>
|
||||
<div class="d-flex">
|
||||
<div cvlass="px-0">
|
||||
<h3>Gestione Etichette</h3>
|
||||
</div>
|
||||
<div cvlass="px-2">
|
||||
<button class="btn btn-success" @onclick=CreateNew tooltip="Add New"><i class="fa-solid fa-plus"></i> Add New</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body p-1 small">
|
||||
@if (ListRecords == null || isLoading)
|
||||
@@ -81,7 +88,7 @@
|
||||
@item.NumFasi
|
||||
</td>
|
||||
<td>
|
||||
@if (item.Enabled)
|
||||
@if (item.Enabled && item.NumFasi == 0)
|
||||
{
|
||||
<button class="btn btn-danger btn-sm" @onclick="() => DoDelete(item)"><i class="fa-solid fa-trash"></i></button>
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace GPW.CORE.ADM.Components.Compo
|
||||
return;
|
||||
|
||||
isLoading = true;
|
||||
//bool fatto = await GDataServ.AnagClientiDelete(selItem);
|
||||
bool fatto = await GDataServ.AnagTagFasiDelete(selItem);
|
||||
await ReloadData();
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
@@ -148,7 +148,6 @@ namespace GPW.CORE.ADM.Components.Compo
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
isLoading = true;
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
@page "/Gruppi"
|
||||
|
||||
<WIP></WIP>
|
||||
|
||||
@code {
|
||||
|
||||
}
|
||||
@@ -990,6 +990,37 @@ namespace GPW.CORE.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public bool AnagTagFasiDelete(TagFasiDTO upsRec)
|
||||
{
|
||||
// init
|
||||
bool answ = false;
|
||||
// cerco su DB recuperando set di dati....
|
||||
using (GPWContext localDbCtx = new GPWContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
// recupero cliente in primis...
|
||||
var dbRec = localDbCtx
|
||||
.DbSetAnagTagFasi
|
||||
.Where(x => x.CodTagFase == upsRec.CodTagFase)
|
||||
.FirstOrDefault();
|
||||
if (dbRec != null)
|
||||
{
|
||||
localDbCtx
|
||||
.DbSetAnagTagFasi
|
||||
.Remove(dbRec);
|
||||
localDbCtx.SaveChanges();
|
||||
answ = true;
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Errore in AnagTagFasiDelete:{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
public bool AnagTagFasiUpsert(TagFasiDTO upsRec)
|
||||
{
|
||||
// init
|
||||
|
||||
@@ -969,7 +969,28 @@ namespace GPW.CORE.Data.Services
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Aggiornamento record Fasi
|
||||
/// Eliminazione record TagFasi
|
||||
/// </summary>
|
||||
/// <param name="currItem"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> AnagTagFasiDelete(TagFasiDTO currItem)
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
answ = dbController.AnagTagFasiDelete(currItem);
|
||||
// invalido la cache...
|
||||
await ExecFlushRedisPattern($"{redisBaseAddr}:*");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione in AnagTagFasiDelete{Environment.NewLine}{exc}");
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Aggiornamento record TagFasi
|
||||
/// </summary>
|
||||
/// <param name="currItem"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
Reference in New Issue
Block a user