Files
mapo-core/MP.SPEC/Pages/Test.razor.cs
T
Samuele Locatelli b25e8ab795 SPEC:
- pulizia commenti
2022-12-09 16:33:49 +01:00

78 lines
2.1 KiB
C#

using Microsoft.AspNetCore.Components;
using MP.Data;
using MP.SPEC.Data;
namespace MP.SPEC.Pages
{
public partial class Test : IDisposable
{
#region Public Methods
public void Dispose()
{
}
#endregion Public Methods
#region Protected Fields
protected DateTime lastRec = DateTime.Now.AddMinutes(-1);
protected string messaggio = "0";
#endregion Protected Fields
#region Protected Properties
protected DisplayAction CurrAction { get; set; } = new DisplayAction();
[Inject]
protected MpDataService MMDataService { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected async void clearMessage()
{
CurrAction.IsActive = false;
CurrAction.Topic = "Chiusura ODL";
CurrAction.Message = "Rilevato possibile fine operazioni, Vuoi chiudere la commessa?";
MMDataService.ActionSetReq(CurrAction);
}
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
var rawAction = await MMDataService.ActionGetReq();
if (rawAction != null)
{
CurrAction = rawAction;
}
else
{
CurrAction = new DisplayAction()
{
Topic = "Chiusura ODL",
Message = "Rilevato possibile fine operazioni, Vuoi chiudere la commessa?",
ShowCancel = true,
ShowClose = true,
ShowConfirm = true,
CancelAction = "DisableAction",
ConfirmAction = "CloseODL",
DtReq = DateTime.Now,
IsActive = true
};
}
}
protected void sendMessage()
{
CurrAction.DtReq = DateTime.Now;
CurrAction.IsActive = true;
MMDataService.ActionSetReq(CurrAction);
}
#endregion Protected Methods
}
}