Gestito aggiornamento elenco contatti in caso di aggiunta o modifica del prospect / cliente
This commit is contained in:
@@ -102,9 +102,15 @@
|
||||
|
||||
@if (!IsView)
|
||||
{
|
||||
<div class="search-address" @onclick="() => OpenSearchAddress = !OpenSearchAddress">
|
||||
<span>Cerca indirizzo</span>
|
||||
<MudIcon Size="Size.Small" Icon="@Icons.Material.Rounded.Search"/>
|
||||
<div class="container-button mb-3">
|
||||
<MudButton Class="button-settings blue-icon"
|
||||
FullWidth="true"
|
||||
StartIcon="@Icons.Material.Rounded.Search"
|
||||
Size="Size.Medium"
|
||||
OnClick="() => OpenSearchAddress = !OpenSearchAddress"
|
||||
Variant="Variant.Outlined">
|
||||
Cerca indirizzo
|
||||
</MudButton>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -242,8 +248,11 @@
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="container-button">
|
||||
}
|
||||
|
||||
<div class="container-button">
|
||||
@if (IsNew)
|
||||
{
|
||||
<MudButton Class="button-settings gray-icon"
|
||||
FullWidth="true"
|
||||
StartIcon="@Icons.Material.Filled.PersonAddAlt1"
|
||||
@@ -252,8 +261,22 @@
|
||||
Variant="Variant.Outlined">
|
||||
Persona di riferimento
|
||||
</MudButton>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@if (NetworkService.IsNetworkAvailable() && !ContactModel.IsContact)
|
||||
{
|
||||
<MudButton Class="button-settings blue-icon"
|
||||
FullWidth="true"
|
||||
StartIcon="@Icons.Material.Rounded.Sync"
|
||||
Size="Size.Medium"
|
||||
OnClick="ConvertProspectToContact"
|
||||
Variant="Variant.Outlined">
|
||||
Converti in cliente
|
||||
</MudButton>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<MudMessageBox MarkupMessage="new MarkupString(VatMessage)" @ref="CheckVat" Class="c-messageBox" Title="Verifica partita iva" CancelText="@(VatAlreadyRegistered ? "" : "Annulla")">
|
||||
@@ -330,14 +353,32 @@
|
||||
PersRif = PersRifList
|
||||
};
|
||||
|
||||
await IntegryApiService.SaveContact(requestDto);
|
||||
var response = await IntegryApiService.SaveContact(requestDto);
|
||||
|
||||
switch (response)
|
||||
{
|
||||
case null:
|
||||
VisibleOverlay = false;
|
||||
StateHasChanged();
|
||||
return;
|
||||
case {AnagClie: null, PtbPros: not null}:
|
||||
await ManageData.InsertOrUpdate(response.PtbPros);
|
||||
break;
|
||||
case { AnagClie: not null, PtbPros: null }:
|
||||
await ManageData.InsertOrUpdate(response.AnagClie);
|
||||
break;
|
||||
default:
|
||||
VisibleOverlay = false;
|
||||
StateHasChanged();
|
||||
return;
|
||||
}
|
||||
|
||||
SuccessAnimation = true;
|
||||
StateHasChanged();
|
||||
|
||||
await Task.Delay(1250);
|
||||
|
||||
MudDialog.Close();
|
||||
MudDialog.Close(response);
|
||||
}
|
||||
|
||||
private async Task LoadData()
|
||||
@@ -492,4 +533,9 @@
|
||||
ContactModel.Prov = Address.Prov;
|
||||
ContactModel.Cap = Address.Cap;
|
||||
}
|
||||
|
||||
private async Task ConvertProspectToContact()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user