Gestito elenco clienti e prospect in lista contatti

This commit is contained in:
2025-07-10 12:40:30 +02:00
parent 65e48777e6
commit 8c521dc81e
17 changed files with 284 additions and 136 deletions

View File

@@ -1,7 +1,5 @@
@using System.Text.RegularExpressions
@using salesbook.Shared.Core.Dto
@using salesbook.Shared.Core.Dto
@using salesbook.Shared.Components.Layout
@using salesbook.Shared.Core.Entity
@using salesbook.Shared.Core.Interface
@using salesbook.Shared.Components.Layout.Overlay
@inject IManageDataService ManageData
@@ -10,7 +8,7 @@
<MudDialog Class="customDialog-form">
<DialogContent>
<HeaderLayout ShowProfile="false" Cancel="true" OnCancel="() => MudDialog.Cancel()" LabelSave="@LabelSave" OnSave="Save" Title="@(IsNew ? "Nuovo" : $"{UserModel.CodAnag}")"/>
<HeaderLayout ShowProfile="false" Cancel="true" OnCancel="() => MudDialog.Cancel()" LabelSave="@LabelSave" OnSave="Save" Title="@(IsNew ? "Nuovo" : $"{ContactModel.CodContact}")"/>
<div class="content">
<div class="input-card">
@@ -19,7 +17,7 @@
Placeholder="Azienda"
Variant="Variant.Text"
Lines="1"
@bind-Value="UserModel.RagSoc"
@bind-Value="ContactModel.RagSoc"
@bind-Value:after="OnAfterChangeValue"
DebounceInterval="500"
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
@@ -31,7 +29,7 @@
Placeholder="Partita IVA"
Variant="Variant.Text"
Lines="1"
@bind-Value="UserModel.PartIva"
@bind-Value="ContactModel.PartIva"
@bind-Value:after="OnAfterChangeValue"
DebounceInterval="500"
OnDebounceIntervalElapsed="OnAfterChangeValue" />
@@ -44,7 +42,7 @@
Placeholder="Indirizzo"
Variant="Variant.Text"
Lines="1"
@bind-Value="UserModel.Indirizzo"
@bind-Value="ContactModel.Indirizzo"
@bind-Value:after="OnAfterChangeValue"
DebounceInterval="500"
OnDebounceIntervalElapsed="OnAfterChangeValue" />
@@ -58,7 +56,7 @@
Placeholder="CAP"
Variant="Variant.Text"
Lines="1"
@bind-Value="UserModel.Cap"
@bind-Value="ContactModel.Cap"
@bind-Value:after="OnAfterChangeValue"
DebounceInterval="500"
OnDebounceIntervalElapsed="OnAfterChangeValue" />
@@ -72,7 +70,7 @@
Placeholder="Città"
Variant="Variant.Text"
Lines="1"
@bind-Value="UserModel.Citta"
@bind-Value="ContactModel.Citta"
@bind-Value:after="OnAfterChangeValue"
DebounceInterval="500"
OnDebounceIntervalElapsed="OnAfterChangeValue" />
@@ -86,7 +84,7 @@
Placeholder="Provincia"
Variant="Variant.Text"
Lines="1"
@bind-Value="UserModel.Prov"
@bind-Value="ContactModel.Prov"
@bind-Value:after="OnAfterChangeValue"
DebounceInterval="500"
OnDebounceIntervalElapsed="OnAfterChangeValue" />
@@ -100,7 +98,7 @@
Placeholder="Nazione"
Variant="Variant.Text"
Lines="1"
@bind-Value="UserModel.Nazione"
@bind-Value="ContactModel.Nazione"
@bind-Value:after="OnAfterChangeValue"
DebounceInterval="500"
OnDebounceIntervalElapsed="OnAfterChangeValue" />
@@ -152,15 +150,8 @@
[Parameter] public string? CodAnag { get; set; }
[Parameter] public string? UserType { get; set; }
private UserDTO OriginalModel { get; set; } = new();
private UserDTO UserModel { get; set; } = new();
private List<StbActivityResult> ActivityResult { get; set; } = [];
private List<StbActivityType> ActivityType { get; set; } = [];
private List<StbUser> Users { get; set; } = [];
private List<JtbComt> Commesse { get; set; } = [];
private List<AnagClie> Clienti { get; set; } = [];
private List<PtbPros> Pros { get; set; } = [];
private ContactDTO OriginalModel { get; set; } = new();
private ContactDTO ContactModel { get; set; } = new();
private bool IsNew => CodAnag.IsNullOrEmpty();
private bool IsView => !NetworkService.IsNetworkAvailable();
@@ -199,7 +190,7 @@
{
if (!IsNew)
{
LabelSave = !OriginalModel.Equals(UserModel) ? "Aggiorna" : null;
LabelSave = !OriginalModel.Equals(ContactModel) ? "Aggiorna" : null;
}
}