Files
mapo-core/MP.Stats/Components/TaskEdit.razor.cs
T
Samuele Locatelli 57e8ea08ba Fix ordinamento
2024-04-03 11:08:21 +02:00

50 lines
1.2 KiB
C#

using DnsClient.Protocol;
using Microsoft.AspNetCore.Components;
using MP.Data.DatabaseModels;
using MP.Stats.Data;
using System.Threading.Tasks;
namespace MP.Stats.Components
{
public partial class TaskEdit
{
#region Public Properties
[Parameter]
public TaskListModel? CurrRecord { get; set; } = null;
[Parameter]
public EventCallback<bool> EC_update { get; set; }
#endregion Public Properties
#region Protected Properties
[Inject]
protected MpStatsService StatService { get; set; }
#endregion Protected Properties
#region Protected Methods
protected async Task doCancel()
{
await EC_update.InvokeAsync(false);
}
protected async Task doSave()
{
bool fatto = false;
await Task.Delay(1);
if (CurrRecord != null)
{
//var nextDt = StatService.CalcNextExe(CurrRecord);
//CurrRecord.DtNextExec = nextDt;
fatto = await StatService.TaskListUpsert(CurrRecord);
}
await EC_update.InvokeAsync(fatto);
}
#endregion Protected Methods
}
}