Implemetato databese locale con EntityFramework
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
@using SteUp.Shared.Core.Dto
|
||||
@using SteUp.Shared.Core.Dto.PageState
|
||||
@using SteUp.Shared.Components.Layout.Overlay
|
||||
@using SteUp.Shared.Core.Dto
|
||||
@using SteUp.Shared.Core.Interface.LocalDb
|
||||
@inject IIspezioniService IspezioniService
|
||||
|
||||
<div class="shop-card ripple-container" @onclick="StartInspection">
|
||||
<div class="shop-body-section">
|
||||
@@ -31,16 +33,26 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<SpinnerOverlay VisibleOverlay="VisibleOverlay"/>
|
||||
|
||||
@code {
|
||||
[Parameter] public PuntoVenditaDto PuntoVendita { get; set; } = null!;
|
||||
|
||||
private void StartInspection()
|
||||
private bool VisibleOverlay { get; set; }
|
||||
|
||||
private async Task StartInspection()
|
||||
{
|
||||
SteupDataService.Inspection = new InspectionPageState
|
||||
{
|
||||
DateInspection = DateTime.Today,
|
||||
PuntoVendita = PuntoVendita
|
||||
};
|
||||
VisibleOverlay = true;
|
||||
StateHasChanged();
|
||||
|
||||
SteupDataService.InspectionPageState.Ispezione = await IspezioniService.GetOrCreateIspezioneAsync(
|
||||
PuntoVendita.CodMdep!,
|
||||
DateOnly.FromDateTime(DateTime.Today),
|
||||
UserSession.User.Username
|
||||
);
|
||||
|
||||
VisibleOverlay = false;
|
||||
StateHasChanged();
|
||||
|
||||
NavigationManager.NavigateTo("/ispezione");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user