Gestione modifica campi delivery offerta
This commit is contained in:
@@ -1,94 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>1.1.2603.2410</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="ExtLib\**" />
|
||||
<Content Remove="ExtLib\**" />
|
||||
<EmbeddedResource Remove="ExtLib\**" />
|
||||
<None Remove="ExtLib\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="Controllers\JwdController.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="DemoData\AntaDoppia.jwd" />
|
||||
<None Remove="DemoData\AntaSingola.jwd" />
|
||||
<None Remove="DemoData\FinDueAnteBottomFisso.jwd" />
|
||||
<None Remove="DemoData\FinestraSplitVert.jwd" />
|
||||
<None Remove="DemoData\FinestraSplitVertOriz.jwd" />
|
||||
<None Remove="DemoImg\AntaDoppia.svg" />
|
||||
<None Remove="DemoImg\AntaSingola.svg" />
|
||||
<None Remove="DemoImg\Window01.jpg" />
|
||||
<None Remove="DemoImg\Window01.png" />
|
||||
<None Remove="DemoImg\Window01.svg" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="DemoData\AntaDoppia.jwd">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="DemoData\AntaSingola.jwd">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="DemoData\FinDueAnteBottomFisso.jwd">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="DemoData\FinestraSplitVert.jwd">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="DemoData\FinestraSplitVertOriz.jwd">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="DemoImg\AntaDoppia.svg">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="DemoImg\AntaSingola.svg">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="DemoImg\Window01.jpg">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="DemoImg\Window01.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="DemoImg\Window01.svg">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NLog" />
|
||||
<PackageReference Include="NLog.Targets.OpenTelemetryProtocol" />
|
||||
<PackageReference Include="NLog.Web.AspNetCore" />
|
||||
<PackageReference Include="OpenTelemetry.Exporter.Console" />
|
||||
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" />
|
||||
<PackageReference Include="OpenTelemetry.Extensions.Hosting" />
|
||||
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" />
|
||||
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" />
|
||||
<PackageReference Include="OpenTelemetry.Instrumentation.Http" />
|
||||
<PackageReference Include="OpenTelemetry.Instrumentation.StackExchangeRedis" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EgwCoreLib.Lux.Core\EgwCoreLib.Lux.Core.csproj" />
|
||||
<ProjectReference Include="..\EgwCoreLib.Lux.Data\EgwCoreLib.Lux.Data.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="logs\.placeholder">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath)" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
||||
@@ -7,28 +7,31 @@
|
||||
{
|
||||
|
||||
<div class="col-3">
|
||||
<div class="form-floating mb-3">
|
||||
<div class="form-floating mb-3 @(IsChanged(CurrRecord.DueDateReq, OrigRecord?.DueDateReq) ? "border border-info rounded shadow" : "")">
|
||||
<input type="date" class="form-control" @bind="CurrRecord.DueDateReq" />
|
||||
<label class="small">Data Richiesta</label>
|
||||
</div>
|
||||
@* </div>
|
||||
<div class="col-3"> *@
|
||||
<div class="form-floating mb-3">
|
||||
<div class="form-floating mb-3 @(IsChanged(CurrRecord.DueDateProm, OrigRecord?.DueDateProm) ? "border border-info rounded shadow" : "")">
|
||||
<input type="date" class="form-control" @bind="CurrRecord.DueDateProm" />
|
||||
<label class="small">Data Promessa</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-9">
|
||||
<div class="form-floating mb-3">
|
||||
<div class="form-floating mb-3 @(IsChanged(CurrRecord.ConsNote, OrigRecord?.ConsNote) ? "border border-info rounded shadow" : "")">
|
||||
<textarea style="min-height: 8.5rem;" type="text" class="form-control" @bind="CurrRecord.ConsNote" />
|
||||
<label class="small">Note Consegna</label>
|
||||
</div>
|
||||
</div>
|
||||
@* <div class="col-6">
|
||||
<button class="btn btn-lg btn-success w-100" @onclick="DoSave"><i class="fa-solid fa-floppy-disk"></i> Save</button>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<button class="btn btn-lg btn-warning w-100" @onclick="DoCancel"><i class="fa-solid fa-ban"></i> Cancel</button>
|
||||
</div> *@
|
||||
@if (HasChanged())
|
||||
{
|
||||
<div class="col-6">
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<button class="btn btn-lg btn-success w-100" @onclick="DoSave"><i class="fa-solid fa-floppy-disk"></i> Save</button>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<button class="btn btn-lg btn-warning w-100" @onclick="DoCancel"><i class="fa-solid fa-ban"></i> Cancel</button>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using EgwCoreLib.Lux.Core;
|
||||
using EgwCoreLib.Lux.Data.DbModel.Sales;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
@@ -18,9 +19,28 @@ namespace Lux.UI.Components.Compo
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// Chiamato automaticamente all'inizializzazione del componente.
|
||||
/// </summary>
|
||||
protected override Task OnInitializedAsync()
|
||||
{
|
||||
setOriginal();
|
||||
return base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
setOriginal();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private bool isLoading = false;
|
||||
private OfferModel? OrigRecord = null;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
@@ -37,6 +57,38 @@ namespace Lux.UI.Components.Compo
|
||||
return EC_Updated.InvokeAsync(CurrRecord);
|
||||
}
|
||||
|
||||
private bool HasChanged()
|
||||
{
|
||||
bool answ = false;
|
||||
if (OrigRecord != null && CurrRecord != null)
|
||||
{
|
||||
if (IsChanged(OrigRecord.DueDateReq, CurrRecord.DueDateReq))
|
||||
return true;
|
||||
if (IsChanged(OrigRecord.DueDateProm, CurrRecord.DueDateProm))
|
||||
return true;
|
||||
if (IsChanged(OrigRecord.ConsNote, CurrRecord.ConsNote))
|
||||
return true;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica variazione tramite helper
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="original"></param>
|
||||
/// <param name="edited"></param>
|
||||
/// <returns></returns>
|
||||
private bool IsChanged<T>(T original, T edited) => CloneExtensions.IsChanged(original, edited);
|
||||
|
||||
private void setOriginal()
|
||||
{
|
||||
if (CurrRecord != null && OrigRecord == null)
|
||||
{
|
||||
OrigRecord = CurrRecord.DeepClone();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -260,8 +260,17 @@ namespace Lux.UI.Components.Pages
|
||||
// salvo record
|
||||
await OffService.UpsertAsync(updRec);
|
||||
// cambio step
|
||||
CompileStep nextStep = currStep < CompileStep.FinalCheck ? currStep + 1 : currStep;
|
||||
AdvStep(nextStep);
|
||||
CompileStep nextStep = new CompileStep();
|
||||
if (currStep < CompileStep.Delivery)
|
||||
{
|
||||
nextStep = currStep + 1;
|
||||
AdvStep(nextStep);
|
||||
}
|
||||
else
|
||||
{
|
||||
EditRecord = null;
|
||||
}
|
||||
//CompileStep nextStep = currStep < CompileStep.Delivery ? currStep + 1 : currStep;
|
||||
}
|
||||
|
||||
private void DoSelect(OfferModel curRec)
|
||||
|
||||
Reference in New Issue
Block a user