Implemetato databese locale con EntityFramework
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
@using SteUp.Shared.Components.Layout
|
||||
@using SteUp.Shared.Components.Layout.Overlay
|
||||
@using SteUp.Shared.Core.Dto
|
||||
@using SteUp.Shared.Core.Entities
|
||||
@using SteUp.Shared.Core.Interface.IntegryApi
|
||||
@using SteUp.Shared.Core.Interface.System.Network
|
||||
@inject INetworkService NetworkService
|
||||
@@ -24,7 +25,7 @@
|
||||
else
|
||||
{
|
||||
<MudSelectExtended ReadOnly="IsView" FullWidth="true" T="JtbFasiDto?" Variant="Variant.Text"
|
||||
@bind-Value="SchedaDto.Reparto" AdornmentIcon="@Icons.Material.Filled.Code"
|
||||
@bind-Value="Scheda.Reparto" AdornmentIcon="@Icons.Material.Filled.Code"
|
||||
ToStringFunc="@(x => x?.Descrizione)"
|
||||
@bind-Value:after="OnAfterChangeValue" Class="customIcon-select">
|
||||
@foreach (var fasi in SteupDataService.Reparti)
|
||||
@@ -49,7 +50,7 @@
|
||||
else
|
||||
{
|
||||
<MudSelectExtended ReadOnly="IsView" FullWidth="true" T="string?" Variant="Variant.Text"
|
||||
@bind-Value="SchedaDto.ActivityTypeId" Class="customIcon-select"
|
||||
@bind-Value="Scheda.ActivityTypeId" Class="customIcon-select"
|
||||
AdornmentIcon="@Icons.Material.Filled.Code"
|
||||
@bind-Value:after="OnAfterChangeValue">
|
||||
@foreach (var type in SteupDataService.TipiAttività)
|
||||
@@ -123,7 +124,7 @@
|
||||
<span class="disable-full-width">Scadenza</span>
|
||||
|
||||
<MudSelectExtended FullWidth="true" ReadOnly="@IsView" T="int" Variant="Variant.Text"
|
||||
@bind-Value="@SchedaDto.Scadenza" @bind-Value:after="OnAfterChangeValue"
|
||||
@bind-Value="@Scheda.Scadenza" @bind-Value:after="OnAfterChangeValue"
|
||||
Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code">
|
||||
<MudSelectItemExtended Class="custom-item-select" Text="24H" Value="24" />
|
||||
<MudSelectItemExtended Class="custom-item-select" Text="1 Settimana" Value="168" />
|
||||
@@ -135,13 +136,13 @@
|
||||
<div class="divider"></div>
|
||||
|
||||
<MudTextField ReadOnly="IsView" T="string?" Placeholder="Responsabile" Variant="Variant.Text"
|
||||
@bind-Value="SchedaDto.Responsabile" @bind-Value:after="OnAfterChangeValue"
|
||||
@bind-Value="Scheda.Responsabile" @bind-Value:after="OnAfterChangeValue"
|
||||
DebounceInterval="500" OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<MudTextField ReadOnly="IsView" T="string?" Placeholder="Note" Variant="Variant.Text" Lines="3"
|
||||
@bind-Value="SchedaDto.Note" @bind-Value:after="OnAfterChangeValue"
|
||||
@bind-Value="Scheda.Note" @bind-Value:after="OnAfterChangeValue"
|
||||
DebounceInterval="500" OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||
</div>
|
||||
|
||||
@@ -159,12 +160,12 @@
|
||||
</DialogContent>
|
||||
</MudDialog>
|
||||
|
||||
<SaveOverlay VisibleOverlay="VisibleOverlay" SuccessAnimation="SuccessAnimation"/>
|
||||
<SpinnerOverlay VisibleOverlay="VisibleOverlay" SuccessAnimation="SuccessAnimation"/>
|
||||
|
||||
@code {
|
||||
[CascadingParameter] private IMudDialogInstance MudDialog { get; set; } = null!;
|
||||
|
||||
private SchedaDto SchedaDto { get; set; } = new();
|
||||
private Scheda Scheda { get; set; } = new();
|
||||
|
||||
private bool IsNew { get; set; }
|
||||
private bool IsLoading { get; set; }
|
||||
@@ -211,7 +212,7 @@
|
||||
|
||||
private void SuggestActivityDescription()
|
||||
{
|
||||
if (SchedaDto.ActivityTypeId == null)
|
||||
if (Scheda.ActivityTypeId == null)
|
||||
{
|
||||
Snackbar.Add("Indicare prima il motivo", Severity.Error);
|
||||
return;
|
||||
@@ -222,12 +223,12 @@
|
||||
|
||||
_ = Task.Run(async () =>
|
||||
{
|
||||
var activityDescriptions = await IntegryApiService.SuggestActivityDescription(SchedaDto.ActivityTypeId);
|
||||
var activityDescriptions = await IntegryApiService.SuggestActivityDescription(Scheda.ActivityTypeId);
|
||||
|
||||
var modal = await ModalHelper.OpenSuggestActivityDescription(Dialog, activityDescriptions);
|
||||
|
||||
if (modal is { Canceled: false, Data: not null })
|
||||
SchedaDto.Note = modal.Data!.ToString();
|
||||
Scheda.Note = modal.Data!.ToString();
|
||||
|
||||
VisibleOverlay = false;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
|
||||
Reference in New Issue
Block a user