Compare commits
6 Commits
v1.0.1(4)
...
b34f6cb213
| Author | SHA1 | Date | |
|---|---|---|---|
| b34f6cb213 | |||
| 7bcb0581cc | |||
| b2064ad71e | |||
| 8c521dc81e | |||
| 65e48777e6 | |||
| bf2e1b65f0 |
@@ -23,6 +23,8 @@ public class LocalDbService
|
||||
_connection.CreateTableAsync<StbActivityResult>();
|
||||
_connection.CreateTableAsync<StbActivityType>();
|
||||
_connection.CreateTableAsync<StbUser>();
|
||||
_connection.CreateTableAsync<VtbTipi>();
|
||||
_connection.CreateTableAsync<Nazioni>();
|
||||
}
|
||||
|
||||
public async Task ResetSettingsDb()
|
||||
@@ -32,10 +34,14 @@ public class LocalDbService
|
||||
await _connection.ExecuteAsync("DROP TABLE IF EXISTS stb_activity_result;");
|
||||
await _connection.ExecuteAsync("DROP TABLE IF EXISTS stb_activity_type;");
|
||||
await _connection.ExecuteAsync("DROP TABLE IF EXISTS stb_user;");
|
||||
await _connection.ExecuteAsync("DROP TABLE IF EXISTS vtb_tipi;");
|
||||
await _connection.ExecuteAsync("DROP TABLE IF EXISTS nazioni;");
|
||||
|
||||
await _connection.CreateTableAsync<StbActivityResult>();
|
||||
await _connection.CreateTableAsync<StbActivityType>();
|
||||
await _connection.CreateTableAsync<StbUser>();
|
||||
await _connection.CreateTableAsync<VtbTipi>();
|
||||
await _connection.CreateTableAsync<Nazioni>();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@@ -12,6 +12,22 @@ public class ManageDataService(LocalDbService localDb, IMapper mapper) : IManage
|
||||
public Task<List<T>> GetTable<T>(Expression<Func<T, bool>>? whereCond = null) where T : new() =>
|
||||
localDb.Get(whereCond);
|
||||
|
||||
public async Task<List<ContactDTO>> GetContact()
|
||||
{
|
||||
var contactList = await localDb.Get<AnagClie>(x => x.FlagStato.Equals("A"));
|
||||
var prospectList = await localDb.Get<PtbPros>();
|
||||
|
||||
// Mappa i contatti
|
||||
var contactMapper = mapper.Map<List<ContactDTO>>(contactList);
|
||||
|
||||
// Mappa i prospects
|
||||
var prospectMapper = mapper.Map<List<ContactDTO>>(prospectList);
|
||||
|
||||
contactMapper.AddRange(prospectMapper);
|
||||
|
||||
return contactMapper;
|
||||
}
|
||||
|
||||
public async Task<List<ActivityDTO>> GetActivity(Expression<Func<StbActivity, bool>>? whereCond = null)
|
||||
{
|
||||
var activities = await localDb.Get(whereCond);
|
||||
|
||||
@@ -82,5 +82,11 @@ public class SyncDbService(IIntegryApiService integryApiService, LocalDbService
|
||||
|
||||
if (!settingsResponse.StbUsers.IsNullOrEmpty())
|
||||
await localDb.InsertAll(settingsResponse.StbUsers!);
|
||||
|
||||
if (!settingsResponse.VtbTipi.IsNullOrEmpty())
|
||||
await localDb.InsertAll(settingsResponse.VtbTipi!);
|
||||
|
||||
if (!settingsResponse.Nazioni.IsNullOrEmpty())
|
||||
await localDb.InsertAll(settingsResponse.Nazioni!);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using AutoMapper;
|
||||
using CommunityToolkit.Maui;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using IntegryApiClient.MAUI;
|
||||
|
||||
@@ -3,7 +3,7 @@ using Android.Runtime;
|
||||
|
||||
namespace salesbook.Maui
|
||||
{
|
||||
[Application]
|
||||
[Application(HardwareAccelerated = true)]
|
||||
public class MainApplication : MauiApplication
|
||||
{
|
||||
public MainApplication(IntPtr handle, JniHandleOwnership ownership)
|
||||
|
||||
@@ -78,8 +78,9 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)'=='net9.0-ios'">
|
||||
<CodesignKey>Apple Development: Created via API (5B7B69P4JY)</CodesignKey>
|
||||
<CodesignProvision>VS: WildCard Development</CodesignProvision>
|
||||
<CodesignKey>Apple Distribution: Integry S.r.l. (UNP26J4R89)</CodesignKey>
|
||||
<CodesignProvision></CodesignProvision>
|
||||
<ProvisioningType>manual</ProvisioningType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' OR $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<MudFab Class="custom-plus-button" Color="Color.Surface" Size="Size.Medium" IconSize="Size.Medium" IconColor="Color.Primary" StartIcon="@Icons.Material.Filled.Add" />
|
||||
</ActivatorContent>
|
||||
<ChildContent>
|
||||
<MudMenuItem Disabled="true">Nuovo contatto</MudMenuItem>
|
||||
<MudMenuItem OnClick="() => CreateUser()">Nuovo contatto</MudMenuItem>
|
||||
<MudMenuItem OnClick="() => CreateActivity()">Nuova attivit<69></MudMenuItem>
|
||||
</ChildContent>
|
||||
</MudMenu>
|
||||
@@ -92,5 +92,10 @@
|
||||
Messenger.Send(new NewActivityMessage(((StbActivity)result.Data).ActivityId));
|
||||
}
|
||||
}
|
||||
|
||||
private async Task CreateUser()
|
||||
{
|
||||
var result = await ModalHelpers.OpenUserForm(Dialog, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
@page "/User/{CodAnag}"
|
||||
@page "/User/{CodContact}/{IsContact:bool}"
|
||||
@attribute [Authorize]
|
||||
@using AutoMapper
|
||||
@using salesbook.Shared.Components.Layout
|
||||
@using salesbook.Shared.Core.Entity
|
||||
@using salesbook.Shared.Core.Interface
|
||||
@using salesbook.Shared.Components.Layout.Spinner
|
||||
@using salesbook.Shared.Core.Dto
|
||||
@using salesbook.Shared.Components.SingleElements
|
||||
@inject IManageDataService ManageData
|
||||
@inject IMapper Mapper
|
||||
@inject IDialogService Dialog
|
||||
|
||||
<HeaderLayout BackTo="Indietro" Back="true" BackOnTop="true" Title="" ShowProfile="false"/>
|
||||
<HeaderLayout BackTo="Indietro" LabelSave="Modifica" OnSave="() => OpenUserForm(Anag)" Back="true" BackOnTop="true" Title="" ShowProfile="false" />
|
||||
|
||||
@if (IsLoading)
|
||||
{
|
||||
@@ -35,50 +40,52 @@ else
|
||||
|
||||
<div class="section-info">
|
||||
<div class="section-personal-info">
|
||||
@if (!string.IsNullOrEmpty(Anag.Telefono))
|
||||
{
|
||||
<div>
|
||||
<span class="info-title">Telefono</span>
|
||||
<span class="info-text">
|
||||
@if (string.IsNullOrEmpty(Anag.Telefono))
|
||||
{
|
||||
@("Nessuna mail configurata")
|
||||
}
|
||||
else
|
||||
{
|
||||
@Anag.Telefono
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (!string.IsNullOrEmpty(Anag.PartIva))
|
||||
{
|
||||
<div>
|
||||
<span class="info-title">P. IVA</span>
|
||||
<span class="info-text">
|
||||
@Anag.PartIva
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="section-personal-info">
|
||||
@if (!string.IsNullOrEmpty(Anag.EMail))
|
||||
{
|
||||
<div>
|
||||
<span class="info-title">E-mail</span>
|
||||
<span class="info-text">
|
||||
@if (string.IsNullOrEmpty(Anag.EMail))
|
||||
{
|
||||
@("Nessuna mail configurata")
|
||||
}
|
||||
else
|
||||
{
|
||||
@Anag.EMail
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<MudTabs Elevation="2" Rounded="true" PanelClass="pt-6" Style="width: 100%" Centered="true">
|
||||
<MudTabs TabPanelClass="custom-tab-panel" Elevation="2" Rounded="true" PanelClass="pt-2" Centered="true">
|
||||
<MudTabPanel Text="Contatti">
|
||||
@if (PersRif is { Count: > 0 })
|
||||
{
|
||||
<div class="container-pers-rif">
|
||||
<div style="margin-top: 1rem;" class="container-pers-rif">
|
||||
<Virtualize Items="PersRif" Context="person">
|
||||
@{
|
||||
var index = PersRif.IndexOf(person);
|
||||
var isLast = index == PersRif.Count - 1;
|
||||
}
|
||||
<ContactCard Contact="person" />
|
||||
<ContactCard Contact="person"/>
|
||||
@if (!isLast)
|
||||
{
|
||||
<div class="divider"></div>
|
||||
@@ -91,25 +98,34 @@ else
|
||||
<MudButton Class="button-settings infoText"
|
||||
FullWidth="true"
|
||||
Size="Size.Medium"
|
||||
OnClick="OpenPersRifForm"
|
||||
Variant="Variant.Outlined">
|
||||
Aggiungi contatto
|
||||
</MudButton>
|
||||
</div>
|
||||
</MudTabPanel>
|
||||
<MudTabPanel Text="Commesse">
|
||||
@if (Commesse.IsNullOrEmpty())
|
||||
{
|
||||
<NoDataAvailable Text="Nessuna commessa presente"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<Virtualize Items="Commesse" Context="commessa">
|
||||
<CommessaCard Commessa="commessa" />
|
||||
<CommessaCard Commessa="commessa"/>
|
||||
</Virtualize>
|
||||
}
|
||||
</MudTabPanel>
|
||||
</MudTabs>
|
||||
</div>
|
||||
}
|
||||
|
||||
@code {
|
||||
[Parameter] public string CodAnag { get; set; }
|
||||
[Parameter] public string CodContact { get; set; }
|
||||
[Parameter] public bool IsContact { get; set; }
|
||||
|
||||
private AnagClie Anag { get; set; } = new();
|
||||
private List<VtbCliePersRif>? PersRif { get; set; }
|
||||
private ContactDTO Anag { get; set; } = new();
|
||||
private List<PersRifDTO>? PersRif { get; set; }
|
||||
private List<JtbComt> Commesse { get; set; }
|
||||
|
||||
private bool IsLoading { get; set; } = true;
|
||||
@@ -121,12 +137,37 @@ else
|
||||
|
||||
private async Task LoadData()
|
||||
{
|
||||
Anag = (await ManageData.GetTable<AnagClie>(x => x.CodAnag.Equals(CodAnag))).Last();
|
||||
PersRif = await ManageData.GetTable<VtbCliePersRif>(x => x.CodAnag.Equals(Anag.CodAnag));
|
||||
Commesse = await ManageData.GetTable<JtbComt>(x => x.CodAnag != null && x.CodAnag.Equals(CodAnag));
|
||||
if (IsContact)
|
||||
{
|
||||
var clie = (await ManageData.GetTable<AnagClie>(x => x.CodAnag.Equals(CodContact))).Last();
|
||||
Anag = Mapper.Map<ContactDTO>(clie);
|
||||
|
||||
var pers = await ManageData.GetTable<VtbCliePersRif>(x => x.CodAnag.Equals(Anag.CodContact));
|
||||
PersRif = Mapper.Map<List<PersRifDTO>>(pers);
|
||||
}
|
||||
else
|
||||
{
|
||||
var pros = (await ManageData.GetTable<PtbPros>(x => x.CodPpro.Equals(CodContact))).Last();
|
||||
Anag = Mapper.Map<ContactDTO>(pros);
|
||||
|
||||
var pers = await ManageData.GetTable<PtbProsRif>(x => x.CodPpro.Equals(Anag.CodContact));
|
||||
PersRif = Mapper.Map<List<PersRifDTO>>(pers);
|
||||
}
|
||||
|
||||
Commesse = await ManageData.GetTable<JtbComt>(x => x.CodAnag != null && x.CodAnag.Equals(CodContact));
|
||||
|
||||
IsLoading = false;
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private async Task OpenPersRifForm()
|
||||
{
|
||||
var result = await ModalHelpers.OpenPersRifForm(Dialog, null);
|
||||
}
|
||||
|
||||
private async Task OpenUserForm(ContactDTO anag)
|
||||
{
|
||||
var result = await ModalHelpers.OpenUserForm(Dialog, anag);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -139,9 +139,21 @@
|
||||
margin-bottom: 1rem;
|
||||
box-shadow: var(--custom-box-shadow);
|
||||
border-radius: 16px;
|
||||
max-height: 32vh;
|
||||
overflow: auto;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
|
||||
.container-pers-rif::-webkit-scrollbar { display: none; }
|
||||
|
||||
.container-pers-rif .divider {
|
||||
margin: 0 0 0 3.5rem;
|
||||
width: unset;
|
||||
}
|
||||
|
||||
.custom-tab-panel {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
flex-direction: column;
|
||||
}
|
||||
@@ -2,28 +2,42 @@
|
||||
@attribute [Authorize]
|
||||
@using salesbook.Shared.Components.Layout
|
||||
@using salesbook.Shared.Core.Dto
|
||||
@using salesbook.Shared.Core.Entity
|
||||
@using salesbook.Shared.Core.Interface
|
||||
@using salesbook.Shared.Components.SingleElements.BottomSheet
|
||||
@using salesbook.Shared.Components.Layout.Spinner
|
||||
@using salesbook.Shared.Components.SingleElements
|
||||
@using salesbook.Shared.Core.Entity
|
||||
@inject IManageDataService ManageData
|
||||
|
||||
<HeaderLayout Title="Contatti" ShowFilter="true" OnFilterToggle="ToggleFilter" />
|
||||
<HeaderLayout Title="Contatti"/>
|
||||
|
||||
<div class="container search-box">
|
||||
<div class="input-card clearButton">
|
||||
<MudTextField T="string?" Placeholder="Cerca..." Variant="Variant.Text" @bind-Value="TextToFilter" OnDebounceIntervalElapsed="() => FilterUsers()" DebounceInterval="500" />
|
||||
<MudTextField T="string?" Placeholder="Cerca..." Variant="Variant.Text" @bind-Value="TextToFilter" OnDebounceIntervalElapsed="() => FilterUsers()" DebounceInterval="500"/>
|
||||
|
||||
@if (!TextToFilter.IsNullOrEmpty())
|
||||
{
|
||||
<MudIconButton Class="closeIcon" Icon="@Icons.Material.Filled.Close" OnClick="() => FilterUsers(true)"/>
|
||||
}
|
||||
|
||||
<MudIconButton Class="rounded-button" OnClick="ToggleFilter" Icon="@Icons.Material.Rounded.FilterList" Variant="Variant.Filled" Color="Color.Primary" Size="Size.Small" />
|
||||
</div>
|
||||
|
||||
<MudChipSet Class="mt-2" T="string" @bind-SelectedValue="TypeUser" @bind-SelectedValue:after="FilterUsers" SelectionMode="SelectionMode.SingleSelection">
|
||||
<MudChip Color="Color.Primary" Variant="Variant.Text" Value="@("all")">Tutti</MudChip>
|
||||
<MudChip Color="Color.Primary" Variant="Variant.Text" Value="@("contact")">Contatti</MudChip>
|
||||
<MudChip Color="Color.Primary" Variant="Variant.Text" Value="@("prospect")">Prospect</MudChip>
|
||||
</MudChipSet>
|
||||
</div>
|
||||
|
||||
<div class="container users">
|
||||
@if (GroupedUserList?.Count > 0)
|
||||
@if (IsLoading)
|
||||
{
|
||||
<Virtualize Items="FilteredGroupedUserList" Context="item">
|
||||
<SpinnerLayout FullScreen="false"/>
|
||||
}
|
||||
else if (GroupedUserList?.Count > 0)
|
||||
{
|
||||
<Virtualize OverscanCount="20" Items="FilteredGroupedUserList" Context="item">
|
||||
@if (item.ShowHeader)
|
||||
{
|
||||
<div class="letter-header">@item.HeaderLetter</div>
|
||||
@@ -31,31 +45,45 @@
|
||||
<UserCard User="item.User"/>
|
||||
</Virtualize>
|
||||
}
|
||||
else
|
||||
{
|
||||
<NoDataAvailable Text="Nessun contatto trovato"/>
|
||||
}
|
||||
</div>
|
||||
|
||||
<FilterUsers @bind-IsSheetVisible="OpenFilter" @bind-Filter="Filter" @bind-Filter:after="ApplyFilter"/>
|
||||
<FilterUsers @bind-IsSheetVisible="OpenFilter" @bind-Filter="Filter" @bind-Filter:after="FilterUsers"/>
|
||||
|
||||
@code {
|
||||
private List<UserDisplayItem> GroupedUserList { get; set; } = [];
|
||||
private List<UserDisplayItem> FilteredGroupedUserList { get; set; } = [];
|
||||
private string? TextToFilter { get; set; }
|
||||
|
||||
private bool IsLoading { get; set; }
|
||||
|
||||
//Filtri
|
||||
private string? TextToFilter { get; set; }
|
||||
private bool OpenFilter { get; set; }
|
||||
private FilterUserDTO Filter { get; set; } = new();
|
||||
private string TypeUser { get; set; } = "all";
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
await LoadData();
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task LoadData()
|
||||
{
|
||||
var users = await ManageData.GetTable<AnagClie>(x => x.FlagStato.Equals("A"));
|
||||
IsLoading = true;
|
||||
StateHasChanged();
|
||||
|
||||
var loggedUser = (await ManageData.GetTable<StbUser>(x => x.UserName.Equals(UserSession.User.Username))).Last();
|
||||
|
||||
if (loggedUser.UserCode != null)
|
||||
Filter.Agenti = [loggedUser.UserCode];
|
||||
|
||||
var users = await ManageData.GetContact();
|
||||
|
||||
var sortedUsers = users
|
||||
.Where(u => !string.IsNullOrWhiteSpace(u.RagSoc))
|
||||
@@ -88,11 +116,14 @@
|
||||
}
|
||||
|
||||
FilterUsers();
|
||||
|
||||
IsLoading = false;
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private class UserDisplayItem
|
||||
{
|
||||
public required AnagClie User { get; set; }
|
||||
public required ContactDTO User { get; set; }
|
||||
public bool ShowHeader { get; set; }
|
||||
public string? HeaderLetter { get; set; }
|
||||
}
|
||||
@@ -104,23 +135,49 @@
|
||||
if (clearFilter || string.IsNullOrWhiteSpace(TextToFilter))
|
||||
{
|
||||
TextToFilter = null;
|
||||
FilteredGroupedUserList = GroupedUserList;
|
||||
return;
|
||||
}
|
||||
|
||||
var filter = TextToFilter.Trim();
|
||||
var result = new List<UserDisplayItem>();
|
||||
|
||||
foreach (var item in GroupedUserList)
|
||||
{
|
||||
var user = item.User;
|
||||
if (
|
||||
|
||||
switch (TypeUser)
|
||||
{
|
||||
case "contact" when !user.IsContact:
|
||||
case "prospect" when user.IsContact:
|
||||
continue;
|
||||
}
|
||||
|
||||
var matchesFilter =
|
||||
(Filter.Prov.IsNullOrEmpty() || user.Prov.Equals(Filter.Prov, StringComparison.OrdinalIgnoreCase)) &&
|
||||
(Filter.Citta.IsNullOrEmpty() || user.Citta.Contains(Filter.Citta!, StringComparison.OrdinalIgnoreCase)) &&
|
||||
(Filter.Nazione.IsNullOrEmpty() || user.Nazione.Contains(Filter.Nazione!, StringComparison.OrdinalIgnoreCase)) &&
|
||||
(Filter.Indirizzo.IsNullOrEmpty() || user.Indirizzo.Contains(Filter.Indirizzo!, StringComparison.OrdinalIgnoreCase)) &&
|
||||
(!Filter.ConAgente || user.CodVage is not null) &&
|
||||
(!Filter.SenzaAgente || user.CodVage is null) &&
|
||||
(Filter.Agenti.IsNullOrEmpty() || (user.CodVage != null && Filter.Agenti!.Contains(user.CodVage)));
|
||||
|
||||
if (!matchesFilter) continue;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(TextToFilter))
|
||||
{
|
||||
var filter = TextToFilter.Trim();
|
||||
|
||||
var matchesText =
|
||||
(!string.IsNullOrEmpty(user.RagSoc) && user.RagSoc.Contains(filter, StringComparison.OrdinalIgnoreCase)) ||
|
||||
(!string.IsNullOrEmpty(user.Indirizzo) && user.Indirizzo.Contains(filter, StringComparison.OrdinalIgnoreCase)) ||
|
||||
(!string.IsNullOrEmpty(user.Telefono) && user.Telefono.Contains(filter, StringComparison.OrdinalIgnoreCase)) ||
|
||||
(!string.IsNullOrEmpty(user.EMail) && user.EMail.Contains(filter, StringComparison.OrdinalIgnoreCase)) ||
|
||||
(!string.IsNullOrEmpty(user.PartIva) && user.PartIva.Contains(filter, StringComparison.OrdinalIgnoreCase))
|
||||
)
|
||||
(!string.IsNullOrEmpty(user.PartIva) && user.PartIva.Contains(filter, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
if (matchesText)
|
||||
{
|
||||
result.Add(item);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result.Add(item);
|
||||
}
|
||||
@@ -135,9 +192,4 @@
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private void ApplyFilter()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -28,6 +28,6 @@
|
||||
padding-bottom: .5rem;
|
||||
}
|
||||
|
||||
.search-box .input-card {
|
||||
margin: 0 !important;
|
||||
}
|
||||
.search-box .input-card { margin: 0 !important; }
|
||||
|
||||
.search-box .input-card ::deep .rounded-button { border-radius: 50%; }
|
||||
@@ -1,6 +1,6 @@
|
||||
@using salesbook.Shared.Core.Dto
|
||||
@using salesbook.Shared.Components.Pages
|
||||
@using salesbook.Shared.Core.Dto
|
||||
@using salesbook.Shared.Core.Entity
|
||||
@using salesbook.Shared.Core.Helpers.Enum
|
||||
@using salesbook.Shared.Core.Interface
|
||||
@inject IManageDataService manageData
|
||||
|
||||
@@ -17,76 +17,74 @@
|
||||
|
||||
<div class="input-card">
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">Assegnata a</span>
|
||||
|
||||
<MudSelectExtended SearchBox="true"
|
||||
ItemCollection="Users.Select(x => x.UserName).ToList()"
|
||||
SelectAllPosition="SelectAllPosition.NextToSearchBox"
|
||||
SelectAll="true"
|
||||
NoWrap="true"
|
||||
MultiSelection="true"
|
||||
MultiSelectionTextFunc="@(new Func<List<string>, string>(GetMultiSelectionUser))"
|
||||
FullWidth="true" T="string"
|
||||
Variant="Variant.Text"
|
||||
Virtualize="true"
|
||||
@bind-SelectedValues="FilterActivity.User"
|
||||
Class="customIcon-select"
|
||||
AdornmentIcon="@Icons.Material.Filled.Code"/>
|
||||
<span class="disable-full-width">Con agente</span>
|
||||
|
||||
<MudCheckBox @bind-Value="Filter.ConAgente" Color="Color.Primary" @bind-Value:after="OnAfterChangeAgente"/>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">Tipo</span>
|
||||
<span class="disable-full-width">Senza agente</span>
|
||||
|
||||
<MudSelectExtended FullWidth="true"
|
||||
T="string?"
|
||||
Variant="Variant.Text"
|
||||
@bind-Value="FilterActivity.Type"
|
||||
Class="customIcon-select"
|
||||
AdornmentIcon="@Icons.Material.Filled.Code">
|
||||
@foreach (var type in ActivityType)
|
||||
{
|
||||
<MudSelectItemExtended Class="custom-item-select" Value="@type.ActivityTypeId">@type.ActivityTypeId</MudSelectItemExtended>
|
||||
}
|
||||
</MudSelectExtended>
|
||||
<MudCheckBox @bind-Value="Filter.SenzaAgente" Color="Color.Primary" @bind-Value:after="OnAfterChangeAgente"/>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">Esito</span>
|
||||
<span class="disable-full-width">Agente</span>
|
||||
|
||||
<MudSelectExtended FullWidth="true"
|
||||
T="string?"
|
||||
Variant="Variant.Text"
|
||||
@bind-Value="FilterActivity.Result"
|
||||
Class="customIcon-select"
|
||||
AdornmentIcon="@Icons.Material.Filled.Code">
|
||||
@foreach (var result in ActivityResult)
|
||||
<MudSelectExtended FullWidth="true" T="string?" Variant="Variant.Text" NoWrap="true"
|
||||
@bind-SelectedValues="Filter.Agenti" @bind-SelectedValues:after="OnAfterChangeAgenti"
|
||||
MultiSelection="true" MultiSelectionTextFunc="@(new Func<List<string>, string>(GetMultiSelectionAgente))"
|
||||
SelectAllPosition="SelectAllPosition.NextToSearchBox" SelectAll="true"
|
||||
Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code">
|
||||
@foreach (var user in Users)
|
||||
{
|
||||
<MudSelectItemExtended Class="custom-item-select" Value="@result.ActivityResultId">@result.ActivityResultId</MudSelectItemExtended>
|
||||
<MudSelectItemExtended Class="custom-item-select" Value="@user.UserCode">@($"{user.UserCode} - {user.FullName}")</MudSelectItemExtended>
|
||||
}
|
||||
</MudSelectExtended>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-card">
|
||||
<div class="form-container">
|
||||
<MudTextField T="string?"
|
||||
Placeholder="Indirizzo"
|
||||
Variant="Variant.Text"
|
||||
@bind-Value="Filter.Indirizzo"
|
||||
DebounceInterval="500"/>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">Categoria</span>
|
||||
|
||||
<MudSelectExtended FullWidth="true"
|
||||
T="ActivityCategoryEnum?"
|
||||
<MudTextField T="string?"
|
||||
Placeholder="Città"
|
||||
Variant="Variant.Text"
|
||||
@bind-Value="FilterActivity.Category"
|
||||
Class="customIcon-select"
|
||||
AdornmentIcon="@Icons.Material.Filled.Code">
|
||||
@foreach (var category in CategoryList)
|
||||
{
|
||||
<MudSelectItemExtended T="ActivityCategoryEnum?" Class="custom-item-select" Value="@category">@category.ConvertToHumanReadable()</MudSelectItemExtended>
|
||||
}
|
||||
</MudSelectExtended>
|
||||
@bind-Value="Filter.Citta"
|
||||
DebounceInterval="500"/>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="form-container">
|
||||
<MudTextField T="string?"
|
||||
Placeholder="Provincia"
|
||||
Variant="Variant.Text"
|
||||
@bind-Value="Filter.Prov"
|
||||
DebounceInterval="500"/>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="form-container">
|
||||
<MudTextField T="string?"
|
||||
Placeholder="Nazione"
|
||||
Variant="Variant.Text"
|
||||
@bind-Value="Filter.Nazione"
|
||||
DebounceInterval="500"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -104,12 +102,7 @@
|
||||
[Parameter] public FilterUserDTO Filter { get; set; }
|
||||
[Parameter] public EventCallback<FilterUserDTO> FilterChanged { get; set; }
|
||||
|
||||
private FilterActivityDTO FilterActivity { get; set; } = new();
|
||||
|
||||
private List<StbActivityResult> ActivityResult { get; set; } = [];
|
||||
private List<StbActivityType> ActivityType { get; set; } = [];
|
||||
private List<StbUser> Users { get; set; } = [];
|
||||
private List<ActivityCategoryEnum> CategoryList { get; set; } = [];
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
@@ -117,19 +110,14 @@
|
||||
await LoadData();
|
||||
}
|
||||
|
||||
private string GetMultiSelectionUser(List<string> selectedValues)
|
||||
{
|
||||
return $"{selectedValues.Count} Utent{(selectedValues.Count != 1 ? "i selezionati" : "e selezionato")}";
|
||||
}
|
||||
|
||||
private async Task LoadData()
|
||||
{
|
||||
Users = await manageData.GetTable<StbUser>();
|
||||
ActivityResult = await manageData.GetTable<StbActivityResult>();
|
||||
ActivityType = await manageData.GetTable<StbActivityType>(x => x.FlagTipologia.Equals("A"));
|
||||
CategoryList = ActivityCategoryHelper.AllActivityCategory;
|
||||
Users = await manageData.GetTable<StbUser>(x => x.KeyGroup == 5);
|
||||
}
|
||||
|
||||
StateHasChanged();
|
||||
private string GetMultiSelectionAgente(List<string> selectedValues)
|
||||
{
|
||||
return $"{selectedValues.Count} Agent{(selectedValues.Count != 1 ? "i selezionati" : "e selezionato")}";
|
||||
}
|
||||
|
||||
private void CloseBottomSheet()
|
||||
@@ -144,4 +132,24 @@
|
||||
CloseBottomSheet();
|
||||
}
|
||||
|
||||
private void OnAfterChangeAgenti()
|
||||
{
|
||||
if (Filter.Agenti == null || !Filter.Agenti.Any()) return;
|
||||
|
||||
Filter.ConAgente = false;
|
||||
Filter.SenzaAgente = false;
|
||||
}
|
||||
|
||||
private void OnAfterChangeAgente()
|
||||
{
|
||||
if (Filter.SenzaAgente)
|
||||
{
|
||||
Filter.ConAgente = false;
|
||||
}
|
||||
else if (Filter.ConAgente)
|
||||
{
|
||||
Filter.SenzaAgente = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
@using salesbook.Shared.Core.Entity
|
||||
|
||||
<div class="activity-card">
|
||||
<div style="margin-top: 1rem;" class="activity-card">
|
||||
<div class="activity-left-section">
|
||||
<div class="activity-body-section">
|
||||
<div class="title-section">
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
@using salesbook.Shared.Core.Entity
|
||||
@using salesbook.Shared.Core.Dto
|
||||
@inject IDialogService Dialog
|
||||
|
||||
<div class="contact-card">
|
||||
<div class="contact-card" @onclick="OpenPersRifForm">
|
||||
<div class="contact-left-section">
|
||||
<MudIcon Color="Color.Default" Icon="@Icons.Material.Filled.PersonOutline" Size="Size.Large" />
|
||||
<MudIcon Color="Color.Default" Icon="@Icons.Material.Filled.PersonOutline" Size="Size.Large"/>
|
||||
|
||||
<div class="contact-body-section">
|
||||
<div class="title-section">
|
||||
@@ -18,15 +19,25 @@
|
||||
<div class="contact-right-section">
|
||||
@if (!Contact.NumCellulare.IsNullOrEmpty())
|
||||
{
|
||||
<MudIcon Color="Color.Success" Size="Size.Large" Icon="@Icons.Material.Outlined.Phone" />
|
||||
<a href="@($"tel:{Contact.NumCellulare}")">
|
||||
<MudIcon Color="Color.Success" Size="Size.Large" Icon="@Icons.Material.Outlined.Phone"/>
|
||||
</a>
|
||||
}
|
||||
|
||||
@if (!Contact.EMail.IsNullOrEmpty()){
|
||||
<MudIcon Color="Color.Info" Size="Size.Large" Icon="@Icons.Material.Filled.MailOutline" />
|
||||
@if (!Contact.EMail.IsNullOrEmpty())
|
||||
{
|
||||
<a href="@($"mailto:{Contact.EMail}")">
|
||||
<MudIcon Color="Color.Info" Size="Size.Large" Icon="@Icons.Material.Filled.MailOutline"/>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter] public VtbCliePersRif Contact { get; set; } = new();
|
||||
[Parameter] public PersRifDTO Contact { get; set; } = new();
|
||||
|
||||
private async Task OpenPersRifForm()
|
||||
{
|
||||
var result = await ModalHelpers.OpenPersRifForm(Dialog, Contact);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
@using salesbook.Shared.Core.Dto
|
||||
@using salesbook.Shared.Core.Entity
|
||||
@using salesbook.Shared.Core.Interface
|
||||
@inject IManageDataService ManageData
|
||||
@@ -6,7 +7,7 @@
|
||||
<div class="user-card-left-section">
|
||||
<div class="user-card-body-section">
|
||||
<div class="title-section">
|
||||
<MudIcon @onclick="OpenUser" Color="Color.Primary" Icon="@Icons.Material.Filled.Person" Size="Size.Large" />
|
||||
<MudIcon @onclick="OpenUser" Color="Color.Primary" Icon="@(User.IsContact? Icons.Material.Filled.Person : Icons.Material.Filled.PersonOutline)" Size="Size.Large" />
|
||||
|
||||
<div class="user-card-right-section">
|
||||
<div class="user-card-title">
|
||||
@@ -47,14 +48,14 @@
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter] public AnagClie User { get; set; } = new();
|
||||
[Parameter] public ContactDTO User { get; set; } = new();
|
||||
|
||||
private List<JtbComt>? Commesse { get; set; }
|
||||
private bool IsLoading { get; set; } = true;
|
||||
private bool ShowSectionCommesse { get; set; }
|
||||
|
||||
private void OpenUser() =>
|
||||
NavigationManager.NavigateTo($"/User/{User.CodAnag}");
|
||||
NavigationManager.NavigateTo($"/User/{User.CodContact}/{User.IsContact}");
|
||||
|
||||
private async Task ShowCommesse()
|
||||
{
|
||||
@@ -62,7 +63,7 @@
|
||||
|
||||
if (ShowSectionCommesse)
|
||||
{
|
||||
Commesse = await ManageData.GetTable<JtbComt>(x => x.CodAnag.Equals(User.CodAnag));
|
||||
Commesse = await ManageData.GetTable<JtbComt>(x => x.CodAnag.Equals(User.CodContact));
|
||||
IsLoading = false;
|
||||
StateHasChanged();
|
||||
return;
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
</MessageContent>
|
||||
<YesButton>
|
||||
<MudButton Size="Size.Small" Variant="Variant.Filled" Color="Color.Error"
|
||||
StartIcon="@Icons.Material.Filled.Check">
|
||||
StartIcon="@Icons.Material.Rounded.Check">
|
||||
Cancella
|
||||
</MudButton>
|
||||
</YesButton>
|
||||
@@ -161,7 +161,7 @@
|
||||
</MessageContent>
|
||||
<YesButton>
|
||||
<MudButton Size="Size.Small" Variant="Variant.Filled" Color="Color.Primary"
|
||||
StartIcon="@Icons.Material.Filled.DeleteForever">
|
||||
StartIcon="@Icons.Material.Rounded.DeleteForever">
|
||||
Crea
|
||||
</MudButton>
|
||||
</YesButton>
|
||||
@@ -339,10 +339,10 @@
|
||||
{
|
||||
OnAfterChangeValue();
|
||||
|
||||
// var result = await ConfirmMemo.ShowAsync();
|
||||
var result = await ConfirmMemo.ShowAsync();
|
||||
|
||||
// if (result is true)
|
||||
// OpenAddMemo = !OpenAddMemo;
|
||||
if (result is true)
|
||||
OpenAddMemo = !OpenAddMemo;
|
||||
}
|
||||
|
||||
private void OpenSelectEsito()
|
||||
|
||||
@@ -0,0 +1,470 @@
|
||||
@using salesbook.Shared.Core.Dto
|
||||
@using salesbook.Shared.Components.Layout
|
||||
@using salesbook.Shared.Core.Interface
|
||||
@using salesbook.Shared.Components.Layout.Overlay
|
||||
@using salesbook.Shared.Core.Entity
|
||||
@inject IManageDataService ManageData
|
||||
@inject INetworkService NetworkService
|
||||
@inject IIntegryApiService IntegryApiService
|
||||
@inject IDialogService Dialog
|
||||
|
||||
<MudDialog Class="customDialog-form">
|
||||
<DialogContent>
|
||||
<HeaderLayout ShowProfile="false" Cancel="true" OnCancel="() => MudDialog.Cancel()" LabelSave="@LabelSave" OnSave="Save" Title="@(IsNew ? "Nuovo" : $"{ContactModel.CodContact}")"/>
|
||||
|
||||
<div class="content">
|
||||
<div class="input-card">
|
||||
<MudTextField ReadOnly="IsView"
|
||||
T="string?"
|
||||
Placeholder="Azienda"
|
||||
Variant="Variant.Text"
|
||||
Lines="1"
|
||||
@bind-Value="ContactModel.RagSoc"
|
||||
@bind-Value:after="OnAfterChangeValue"
|
||||
DebounceInterval="500"
|
||||
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||
</div>
|
||||
|
||||
<div class="input-card">
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">P. IVA</span>
|
||||
|
||||
<MudTextField ReadOnly="IsView"
|
||||
T="string?"
|
||||
Variant="Variant.Text"
|
||||
FullWidth="true"
|
||||
Class="customIcon-select"
|
||||
Lines="1"
|
||||
@bind-Value="ContactModel.PartIva"
|
||||
@bind-Value:after="OnAfterChangePIva"/>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">Cod. Fiscale</span>
|
||||
|
||||
<MudTextField ReadOnly="IsView"
|
||||
T="string?"
|
||||
Variant="Variant.Text"
|
||||
FullWidth="true"
|
||||
Class="customIcon-select"
|
||||
Lines="1"
|
||||
@bind-Value="ContactModel.CodFisc"
|
||||
@bind-Value:after="OnAfterChangeValue"
|
||||
DebounceInterval="500"
|
||||
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-card">
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">Tipo cliente</span>
|
||||
|
||||
@if (VtbTipi.IsNullOrEmpty())
|
||||
{
|
||||
<span class="warning-text">Nessun tipo cliente trovato</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudSelectExtended FullWidth="true" ReadOnly="@(IsView || VtbTipi.IsNullOrEmpty())" T="string?" Variant="Variant.Text" @bind-Value="ContactModel.CodVtip" @bind-Value:after="OnAfterChangeValue" Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code">
|
||||
@foreach (var tipo in VtbTipi)
|
||||
{
|
||||
<MudSelectItemExtended Class="custom-item-select" Value="@tipo.CodVtip">@($"{tipo.CodVtip} - {tipo.Descrizione}")</MudSelectItemExtended>
|
||||
}
|
||||
</MudSelectExtended>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-card">
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">Indirizzo</span>
|
||||
|
||||
<MudTextField ReadOnly="IsView"
|
||||
T="string?"
|
||||
Variant="Variant.Text"
|
||||
Lines="1"
|
||||
FullWidth="true"
|
||||
Class="customIcon-select"
|
||||
@bind-Value="ContactModel.Indirizzo"
|
||||
@bind-Value:after="OnAfterChangeValue"
|
||||
DebounceInterval="500"
|
||||
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">CAP</span>
|
||||
|
||||
<MudTextField ReadOnly="IsView"
|
||||
T="string?"
|
||||
Variant="Variant.Text"
|
||||
FullWidth="true"
|
||||
Class="customIcon-select"
|
||||
Lines="1"
|
||||
@bind-Value="ContactModel.Cap"
|
||||
@bind-Value:after="OnAfterChangeValue"
|
||||
DebounceInterval="500"
|
||||
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">Città</span>
|
||||
|
||||
<MudTextField ReadOnly="IsView"
|
||||
T="string?"
|
||||
Variant="Variant.Text"
|
||||
FullWidth="true"
|
||||
Class="customIcon-select"
|
||||
Lines="1"
|
||||
@bind-Value="ContactModel.Citta"
|
||||
@bind-Value:after="OnAfterChangeValue"
|
||||
DebounceInterval="500"
|
||||
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">Provincia</span>
|
||||
|
||||
<MudTextField ReadOnly="IsView"
|
||||
T="string?"
|
||||
Variant="Variant.Text"
|
||||
FullWidth="true"
|
||||
Class="customIcon-select"
|
||||
Lines="1"
|
||||
@bind-Value="ContactModel.Prov"
|
||||
@bind-Value:after="OnAfterChangeValue"
|
||||
DebounceInterval="500"
|
||||
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">Nazione</span>
|
||||
|
||||
@if (Nazioni.IsNullOrEmpty())
|
||||
{
|
||||
<span class="warning-text">Nessuna nazione trovata</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudSelectExtended FullWidth="true" ReadOnly="@(IsView || Nazioni.IsNullOrEmpty())" T="string?"
|
||||
Variant="Variant.Text" @bind-Value="ContactModel.Nazione" @bind-Value:after="OnAfterChangeValue"
|
||||
Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code">
|
||||
@foreach (var nazione in Nazioni)
|
||||
{
|
||||
<MudSelectItemExtended Class="custom-item-select" Value="@nazione.CodNazioneAlpha2">@($"{nazione.Descrizione}")</MudSelectItemExtended>
|
||||
}
|
||||
</MudSelectExtended>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-card">
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">PEC</span>
|
||||
|
||||
<MudTextField ReadOnly="IsView"
|
||||
T="string?"
|
||||
Variant="Variant.Text"
|
||||
FullWidth="true"
|
||||
Class="customIcon-select"
|
||||
Lines="1"
|
||||
@bind-Value="ContactModel.EMailPec"
|
||||
@bind-Value:after="OnAfterChangeValue"
|
||||
DebounceInterval="500"
|
||||
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">E-Mail</span>
|
||||
|
||||
<MudTextField ReadOnly="IsView"
|
||||
T="string?"
|
||||
Variant="Variant.Text"
|
||||
FullWidth="true"
|
||||
Class="customIcon-select"
|
||||
Lines="1"
|
||||
@bind-Value="ContactModel.EMail"
|
||||
@bind-Value:after="OnAfterChangeValue"
|
||||
DebounceInterval="500"
|
||||
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">Telefono</span>
|
||||
|
||||
<MudTextField ReadOnly="IsView"
|
||||
T="string?"
|
||||
Variant="Variant.Text"
|
||||
FullWidth="true"
|
||||
Class="customIcon-select"
|
||||
Lines="1"
|
||||
@bind-Value="ContactModel.Telefono"
|
||||
@bind-Value:after="OnAfterChangeValue"
|
||||
DebounceInterval="500"
|
||||
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (IsNew)
|
||||
{
|
||||
<div class="container-chip-persrif">
|
||||
@if (!PersRifList.IsNullOrEmpty())
|
||||
{
|
||||
foreach (var item in PersRifList!.Select((p, index) => new { p, index }))
|
||||
{
|
||||
<MudChip T="string" Color="Color.Default" OnClick="() => OpenPersRifForm(item.index, item.p)" OnClose="() => OnRemovePersRif(item.index)">
|
||||
@item.p.PersonaRif
|
||||
</MudChip>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="container-button">
|
||||
<MudButton Class="button-settings gray-icon"
|
||||
FullWidth="true"
|
||||
StartIcon="@Icons.Material.Filled.PersonAddAlt1"
|
||||
Size="Size.Medium"
|
||||
OnClick="NewPersRif"
|
||||
Variant="Variant.Outlined">
|
||||
Persona di riferimento
|
||||
</MudButton>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<MudMessageBox MarkupMessage="new MarkupString(VatMessage)" @ref="CheckVat" Class="c-messageBox" Title="Verifica partita iva" CancelText="@(VatAlreadyRegistered ? "" : "Annulla")">
|
||||
<YesButton>
|
||||
@if (VatAlreadyRegistered)
|
||||
{
|
||||
<MudButton Size="Size.Small" Variant="Variant.Filled" Color="Color.Error"
|
||||
StartIcon="@Icons.Material.Rounded.Close">
|
||||
Chiudi
|
||||
</MudButton>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudButton Size="Size.Small" Variant="Variant.Filled" Color="Color.Primary"
|
||||
StartIcon="@Icons.Material.Rounded.Check">
|
||||
Aggiungi
|
||||
</MudButton>
|
||||
}
|
||||
</YesButton>
|
||||
</MudMessageBox>
|
||||
</DialogContent>
|
||||
</MudDialog>
|
||||
|
||||
<SaveOverlay VisibleOverlay="VisibleOverlay" SuccessAnimation="SuccessAnimation"/>
|
||||
|
||||
@code {
|
||||
[CascadingParameter] private IMudDialogInstance MudDialog { get; set; }
|
||||
|
||||
[Parameter] public ContactDTO? OriginalModel { get; set; }
|
||||
private ContactDTO ContactModel { get; set; } = new();
|
||||
|
||||
private List<VtbTipi>? VtbTipi { get; set; }
|
||||
private List<PersRifDTO>? PersRifList { get; set; }
|
||||
private List<Nazioni>? Nazioni { get; set; }
|
||||
|
||||
private bool IsNew => OriginalModel is null;
|
||||
private bool IsView => !NetworkService.IsNetworkAvailable();
|
||||
|
||||
private string? LabelSave { get; set; }
|
||||
|
||||
//Overlay for save
|
||||
private bool VisibleOverlay { get; set; }
|
||||
private bool SuccessAnimation { get; set; }
|
||||
|
||||
//MessageBox
|
||||
private MudMessageBox CheckVat { get; set; }
|
||||
private string VatMessage { get; set; } = "";
|
||||
private bool VatAlreadyRegistered { get; set; }
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
Snackbar.Configuration.PositionClass = Defaults.Classes.Position.TopCenter;
|
||||
|
||||
await LoadData();
|
||||
|
||||
LabelSave = IsNew ? "Aggiungi" : null;
|
||||
}
|
||||
|
||||
private async Task Save()
|
||||
{
|
||||
VisibleOverlay = true;
|
||||
StateHasChanged();
|
||||
|
||||
var requestDto = new CRMCreateContactRequestDTO
|
||||
{
|
||||
TipoAnag = ContactModel.IsContact ? "C" : "P",
|
||||
Cliente = ContactModel,
|
||||
PersRif = PersRifList
|
||||
};
|
||||
|
||||
await IntegryApiService.SaveContact(requestDto);
|
||||
|
||||
SuccessAnimation = true;
|
||||
StateHasChanged();
|
||||
|
||||
await Task.Delay(1250);
|
||||
|
||||
MudDialog.Close();
|
||||
}
|
||||
|
||||
private async Task LoadData()
|
||||
{
|
||||
if (IsNew)
|
||||
{
|
||||
ContactModel.IsContact = false;
|
||||
ContactModel.Nazione = "IT";
|
||||
}
|
||||
else
|
||||
{
|
||||
ContactModel = OriginalModel!.Clone();
|
||||
}
|
||||
|
||||
Nazioni = await ManageData.GetTable<Nazioni>();
|
||||
VtbTipi = await ManageData.GetTable<VtbTipi>();
|
||||
}
|
||||
|
||||
private void OnAfterChangeValue()
|
||||
{
|
||||
if (!IsNew)
|
||||
{
|
||||
LabelSave = !OriginalModel.Equals(ContactModel) ? "Aggiorna" : null;
|
||||
}
|
||||
}
|
||||
|
||||
private Task NewPersRif() => OpenPersRifForm(null, null);
|
||||
|
||||
private async Task OpenPersRifForm(int? index, PersRifDTO? persRif)
|
||||
{
|
||||
var result = await ModalHelpers.OpenPersRifForm(Dialog, persRif);
|
||||
|
||||
if (result is { Canceled: false, Data: not null } && result.Data.GetType() == typeof(PersRifDTO))
|
||||
{
|
||||
if (index != null)
|
||||
OnRemovePersRif(index.Value);
|
||||
|
||||
PersRifList ??= [];
|
||||
|
||||
PersRifList.Add((PersRifDTO)result.Data);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnRemovePersRif(int index)
|
||||
{
|
||||
if (PersRifList is null || index < 0 || index >= PersRifList.Count)
|
||||
return;
|
||||
|
||||
PersRifList.RemoveAt(index);
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private async Task OnAfterChangePIva()
|
||||
{
|
||||
CheckVatResponseDTO? response = null;
|
||||
var error = false;
|
||||
|
||||
VisibleOverlay = true;
|
||||
StateHasChanged();
|
||||
|
||||
var nazione = Nazioni?.Find(x =>
|
||||
x.CodNazioneAlpha2.Equals(ContactModel.Nazione) ||
|
||||
x.CodNazioneIso.Equals(ContactModel.Nazione) ||
|
||||
x.Nazione.Equals(ContactModel.Nazione)
|
||||
);
|
||||
|
||||
if (nazione == null)
|
||||
return;
|
||||
|
||||
var pIva = ContactModel.PartIva.Trim();
|
||||
|
||||
var clie = (await ManageData.GetTable<AnagClie>(x => x.PartIva.Equals(pIva))).LastOrDefault();
|
||||
|
||||
if (clie == null)
|
||||
{
|
||||
var pros = (await ManageData.GetTable<PtbPros>(x => x.PartIva.Equals(pIva))).LastOrDefault();
|
||||
|
||||
if (pros == null)
|
||||
{
|
||||
if (nazione.ChkPartIva)
|
||||
{
|
||||
if (!IsView)
|
||||
{
|
||||
try
|
||||
{
|
||||
response = await IntegryApiService.CheckVat(new CheckVatRequestDTO
|
||||
{
|
||||
CountryCode = nazione.CodNazioneAlpha2,
|
||||
VatNumber = pIva
|
||||
});
|
||||
|
||||
VatMessage = $"La p.Iva (<b>{pIva}</b>) corrisponde a:<br><br><b>{response.RagSoc}</b><br><b>{response.CompleteAddress}</b><br><br>Si desidera aggiungere questi dati nel form?";
|
||||
VatAlreadyRegistered = false;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Snackbar.Clear();
|
||||
Snackbar.Add(e.Message, Severity.Error);
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Snackbar.Clear();
|
||||
Snackbar.Add("La ricerca della partita iva non è al momento disponibile", Severity.Warning);
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Snackbar.Clear();
|
||||
Snackbar.Add("La ricerca della partita iva non è abilitata per questa nazione", Severity.Warning);
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
VatMessage = $"Prospect (<b>{pros.CodPpro}</b>) già censito con la p.iva: <b>{pIva} - {pros.RagSoc}</b>";
|
||||
VatAlreadyRegistered = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
VatMessage = $"Cliente (<b>{clie.CodAnag}</b>) già censito con la p.iva: <b>{pIva} - {clie.RagSoc}</b>";
|
||||
VatAlreadyRegistered = true;
|
||||
}
|
||||
|
||||
VisibleOverlay = false;
|
||||
StateHasChanged();
|
||||
|
||||
if (!error)
|
||||
{
|
||||
var result = await CheckVat.ShowAsync();
|
||||
|
||||
if (result is true && response != null)
|
||||
{
|
||||
ContactModel.RagSoc = response.RagSoc;
|
||||
ContactModel.Indirizzo = response.Indirizzo;
|
||||
ContactModel.Cap = response.Cap;
|
||||
ContactModel.Citta = response.Citta;
|
||||
ContactModel.Prov = response.Prov;
|
||||
}
|
||||
}
|
||||
|
||||
OnAfterChangeValue();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
.container-button {
|
||||
background: var(--mud-palette-background-gray) !important;
|
||||
box-shadow: unset;
|
||||
}
|
||||
|
||||
.container-chip-persrif {
|
||||
width: 100%;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
@using salesbook.Shared.Core.Dto
|
||||
@using salesbook.Shared.Components.Layout
|
||||
@using salesbook.Shared.Core.Interface
|
||||
@using salesbook.Shared.Components.Layout.Overlay
|
||||
@inject IManageDataService ManageData
|
||||
@inject INetworkService NetworkService
|
||||
@inject IIntegryApiService IntegryApiService
|
||||
|
||||
<MudDialog Class="customDialog-form">
|
||||
<DialogContent>
|
||||
<HeaderLayout ShowProfile="false" Cancel="true" OnCancel="() => MudDialog.Cancel()" LabelSave="@LabelSave" OnSave="Save" Title="@(IsNew ? "Nuovo" : "")" />
|
||||
|
||||
<div class="content">
|
||||
<div class="input-card">
|
||||
<MudTextField ReadOnly="IsView"
|
||||
T="string?"
|
||||
Placeholder="Cognome e Nome"
|
||||
Variant="Variant.Text"
|
||||
Lines="1"
|
||||
@bind-Value="PersRifModel.PersonaRif"
|
||||
@bind-Value:after="OnAfterChangeValue"
|
||||
DebounceInterval="500"
|
||||
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||
</div>
|
||||
|
||||
<div class="input-card">
|
||||
<MudTextField ReadOnly="IsView"
|
||||
T="string?"
|
||||
Placeholder="Mansione"
|
||||
Variant="Variant.Text"
|
||||
Lines="1"
|
||||
@bind-Value="PersRifModel.Mansione"
|
||||
@bind-Value:after="OnAfterChangeValue"
|
||||
DebounceInterval="500"
|
||||
OnDebounceIntervalElapsed="OnAfterChangeValue" />
|
||||
</div>
|
||||
|
||||
<div class="input-card">
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">Email</span>
|
||||
|
||||
<MudTextField ReadOnly="IsView"
|
||||
T="string?"
|
||||
Variant="Variant.Text"
|
||||
FullWidth="true"
|
||||
Class="customIcon-select"
|
||||
Lines="1"
|
||||
@bind-Value="PersRifModel.EMail"
|
||||
@bind-Value:after="OnAfterChangeValue"
|
||||
DebounceInterval="500"
|
||||
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">Fax</span>
|
||||
|
||||
<MudTextField ReadOnly="IsView"
|
||||
T="string?"
|
||||
Variant="Variant.Text"
|
||||
FullWidth="true"
|
||||
Class="customIcon-select"
|
||||
Lines="1"
|
||||
@bind-Value="PersRifModel.Fax"
|
||||
@bind-Value:after="OnAfterChangeValue"
|
||||
DebounceInterval="500"
|
||||
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">Cellulare</span>
|
||||
|
||||
<MudTextField ReadOnly="IsView"
|
||||
T="string?"
|
||||
Variant="Variant.Text"
|
||||
FullWidth="true"
|
||||
Class="customIcon-select"
|
||||
Lines="1"
|
||||
@bind-Value="PersRifModel.NumCellulare"
|
||||
@bind-Value:after="OnAfterChangeValue"
|
||||
DebounceInterval="500"
|
||||
OnDebounceIntervalElapsed="OnAfterChangeValue"/>
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">Telefono</span>
|
||||
|
||||
<MudTextField ReadOnly="IsView"
|
||||
T="string?"
|
||||
Variant="Variant.Text"
|
||||
FullWidth="true"
|
||||
Class="customIcon-select"
|
||||
Lines="1"
|
||||
@bind-Value="PersRifModel.Telefono"
|
||||
@bind-Value:after="OnAfterChangeValue"
|
||||
DebounceInterval="500"
|
||||
OnDebounceIntervalElapsed="OnAfterChangeValue" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</DialogContent>
|
||||
</MudDialog>
|
||||
|
||||
<SaveOverlay VisibleOverlay="VisibleOverlay" SuccessAnimation="SuccessAnimation"/>
|
||||
|
||||
@code {
|
||||
[CascadingParameter] private IMudDialogInstance MudDialog { get; set; }
|
||||
|
||||
[Parameter] public PersRifDTO? OriginalModel { get; set; }
|
||||
private PersRifDTO PersRifModel { get; set; } = new();
|
||||
|
||||
private bool IsNew => OriginalModel is null;
|
||||
private bool IsView => !NetworkService.IsNetworkAvailable();
|
||||
|
||||
private string? LabelSave { get; set; }
|
||||
|
||||
//Overlay for save
|
||||
private bool VisibleOverlay { get; set; }
|
||||
private bool SuccessAnimation { get; set; }
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
Snackbar.Configuration.PositionClass = Defaults.Classes.Position.TopCenter;
|
||||
|
||||
_ = LoadData();
|
||||
|
||||
LabelSave = IsNew ? "Aggiungi" : null;
|
||||
}
|
||||
|
||||
private async Task Save()
|
||||
{
|
||||
VisibleOverlay = true;
|
||||
StateHasChanged();
|
||||
|
||||
SuccessAnimation = true;
|
||||
StateHasChanged();
|
||||
|
||||
await Task.Delay(1250);
|
||||
|
||||
MudDialog.Close(PersRifModel);
|
||||
}
|
||||
|
||||
private async Task LoadData()
|
||||
{
|
||||
if (!IsNew)
|
||||
PersRifModel = OriginalModel!.Clone();
|
||||
}
|
||||
|
||||
private void OnAfterChangeValue()
|
||||
{
|
||||
if (!IsNew)
|
||||
{
|
||||
LabelSave = !OriginalModel.Equals(PersRifModel) ? "Aggiorna" : null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
.container-button {
|
||||
background: var(--mud-palette-background-gray) !important;
|
||||
box-shadow: unset;
|
||||
}
|
||||
18
salesbook.Shared/Core/Dto/CRMCreateContactRequestDTO.cs
Normal file
18
salesbook.Shared/Core/Dto/CRMCreateContactRequestDTO.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace salesbook.Shared.Core.Dto;
|
||||
|
||||
public class CRMCreateContactRequestDTO
|
||||
{
|
||||
[JsonPropertyName("codVdes")]
|
||||
public string? CodVdes { get; set; }
|
||||
|
||||
[JsonPropertyName("tipoAnag")]
|
||||
public string TipoAnag { get; set; }
|
||||
|
||||
[JsonPropertyName("cliente")]
|
||||
public ContactDTO Cliente { get; set; }
|
||||
|
||||
[JsonPropertyName("persRif")]
|
||||
public List<PersRifDTO>? PersRif { get; set; }
|
||||
}
|
||||
12
salesbook.Shared/Core/Dto/CheckVatRequestDTO.cs
Normal file
12
salesbook.Shared/Core/Dto/CheckVatRequestDTO.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace salesbook.Shared.Core.Dto;
|
||||
|
||||
public class CheckVatRequestDTO
|
||||
{
|
||||
[JsonPropertyName("countryCode")]
|
||||
public string CountryCode { get; set; }
|
||||
|
||||
[JsonPropertyName("vatNumber")]
|
||||
public string VatNumber { get; set; }
|
||||
}
|
||||
39
salesbook.Shared/Core/Dto/CheckVatResponseDTO.cs
Normal file
39
salesbook.Shared/Core/Dto/CheckVatResponseDTO.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace salesbook.Shared.Core.Dto;
|
||||
|
||||
public class CheckVatResponseDTO
|
||||
{
|
||||
[JsonPropertyName("countryCode")]
|
||||
public string? CountryCode { get; set; }
|
||||
|
||||
[JsonPropertyName("vatNumber ")]
|
||||
public string? VatNumber { get; set; }
|
||||
|
||||
[JsonPropertyName("requestDate")]
|
||||
public string? RequestDate { get; set; }
|
||||
|
||||
[JsonPropertyName("valid")]
|
||||
public bool Valid { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
[JsonPropertyName("address")]
|
||||
public string? CompleteAddress { get; set; }
|
||||
|
||||
[JsonPropertyName("ragSoc")]
|
||||
public string? RagSoc { get; set; }
|
||||
|
||||
[JsonPropertyName("indirizzo")]
|
||||
public string? Indirizzo { get; set; }
|
||||
|
||||
[JsonPropertyName("cap")]
|
||||
public string? Cap { get; set; }
|
||||
|
||||
[JsonPropertyName("citta")]
|
||||
public string? Citta { get; set; }
|
||||
|
||||
[JsonPropertyName("prov")]
|
||||
public string? Prov { get; set; }
|
||||
}
|
||||
65
salesbook.Shared/Core/Dto/ContactDTO.cs
Normal file
65
salesbook.Shared/Core/Dto/ContactDTO.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace salesbook.Shared.Core.Dto;
|
||||
|
||||
public class ContactDTO
|
||||
{
|
||||
[JsonPropertyName("codContact")]
|
||||
public string CodContact { get; set; }
|
||||
|
||||
[JsonPropertyName("isContact")]
|
||||
public bool IsContact { get; set; }
|
||||
|
||||
[JsonPropertyName("codVtip")]
|
||||
public string? CodVtip { get; set; }
|
||||
|
||||
[JsonPropertyName("codVage")]
|
||||
public string? CodVage { get; set; }
|
||||
|
||||
[JsonPropertyName("ragSoc")]
|
||||
public string? RagSoc { get; set; }
|
||||
|
||||
[JsonPropertyName("indirizzo")]
|
||||
public string? Indirizzo { get; set; }
|
||||
|
||||
[JsonPropertyName("cap")]
|
||||
public string? Cap { get; set; }
|
||||
|
||||
[JsonPropertyName("citta")]
|
||||
public string? Citta { get; set; }
|
||||
|
||||
[JsonPropertyName("prov")]
|
||||
public string? Prov { get; set; }
|
||||
|
||||
[JsonPropertyName("nazione")]
|
||||
public string? Nazione { get; set; }
|
||||
|
||||
[JsonPropertyName("telefono")]
|
||||
public string? Telefono { get; set; }
|
||||
|
||||
[JsonPropertyName("fax")]
|
||||
public string Fax { get; set; }
|
||||
|
||||
[JsonPropertyName("partIva")]
|
||||
public string PartIva { get; set; }
|
||||
|
||||
[JsonPropertyName("codFisc")]
|
||||
public string CodFisc { get; set; }
|
||||
|
||||
[JsonPropertyName("note")]
|
||||
public string Note { get; set; }
|
||||
|
||||
[JsonPropertyName("personaRif")]
|
||||
public string PersonaRif { get; set; }
|
||||
|
||||
[JsonPropertyName("eMail")]
|
||||
public string? EMail { get; set; }
|
||||
|
||||
[JsonPropertyName("eMailPec")]
|
||||
public string EMailPec { get; set; }
|
||||
|
||||
public ContactDTO Clone()
|
||||
{
|
||||
return (ContactDTO)MemberwiseClone();
|
||||
}
|
||||
}
|
||||
@@ -2,4 +2,12 @@
|
||||
|
||||
public class FilterUserDTO
|
||||
{
|
||||
public bool ConAgente { get; set; }
|
||||
public bool SenzaAgente { get; set; }
|
||||
public IEnumerable<string>? Agenti { get; set; }
|
||||
|
||||
public string? Indirizzo { get; set; }
|
||||
public string? Citta { get; set; }
|
||||
public string? Nazione { get; set; }
|
||||
public string? Prov { get; set; }
|
||||
}
|
||||
|
||||
38
salesbook.Shared/Core/Dto/PersRifDTO.cs
Normal file
38
salesbook.Shared/Core/Dto/PersRifDTO.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace salesbook.Shared.Core.Dto;
|
||||
|
||||
public class PersRifDTO
|
||||
{
|
||||
[JsonPropertyName("codPersRif")]
|
||||
public string CodPersRif { get; set; }
|
||||
|
||||
[JsonPropertyName("idPersRif")]
|
||||
public int IdPersRif { get; set; }
|
||||
|
||||
[JsonPropertyName("personaRif")]
|
||||
public string PersonaRif { get; set; }
|
||||
|
||||
[JsonPropertyName("eMail")]
|
||||
public string EMail { get; set; }
|
||||
|
||||
[JsonPropertyName("fax")]
|
||||
public string Fax { get; set; }
|
||||
|
||||
[JsonPropertyName("mansione")]
|
||||
public string? Mansione { get; set; }
|
||||
|
||||
[JsonPropertyName("numCellulare")]
|
||||
public string NumCellulare { get; set; }
|
||||
|
||||
[JsonPropertyName("telefono")]
|
||||
public string Telefono { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public int TempId { get; set; }
|
||||
|
||||
public PersRifDTO Clone()
|
||||
{
|
||||
return (PersRifDTO)MemberwiseClone();
|
||||
}
|
||||
}
|
||||
@@ -13,4 +13,10 @@ public class SettingsResponseDTO
|
||||
|
||||
[JsonPropertyName("stbUsers")]
|
||||
public List<StbUser>? StbUsers { get; set; }
|
||||
|
||||
[JsonPropertyName("vtbTipi")]
|
||||
public List<VtbTipi>? VtbTipi { get; set; }
|
||||
|
||||
[JsonPropertyName("nazioni")]
|
||||
public List<Nazioni>? Nazioni { get; set; }
|
||||
}
|
||||
23
salesbook.Shared/Core/Entity/Nazioni.cs
Normal file
23
salesbook.Shared/Core/Entity/Nazioni.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using SQLite;
|
||||
|
||||
namespace salesbook.Shared.Core.Entity;
|
||||
|
||||
[Table("nazioni")]
|
||||
public class Nazioni
|
||||
{
|
||||
[PrimaryKey, Column("nazione"), JsonPropertyName("nazione")]
|
||||
public string Nazione { get; set; }
|
||||
|
||||
[Column("cod_nazione_iso"), JsonPropertyName("codNazioneIso")]
|
||||
public string CodNazioneIso { get; set; }
|
||||
|
||||
[Column("cod_nazi_alpha_2"), JsonPropertyName("codNazioneAlpha2")]
|
||||
public string CodNazioneAlpha2 { get; set; }
|
||||
|
||||
[Column("descrizione"), JsonPropertyName("descrizione")]
|
||||
public string Descrizione { get; set; }
|
||||
|
||||
[Column("chk_part_iva"), JsonPropertyName("chkPartIva")]
|
||||
public bool ChkPartIva { get; set; }
|
||||
}
|
||||
@@ -11,4 +11,10 @@ public class StbUser
|
||||
|
||||
[Column("full_name"), JsonPropertyName("fullName")]
|
||||
public string FullName { get; set; }
|
||||
|
||||
[Column("key_group"), JsonPropertyName("keyGroup")]
|
||||
public int KeyGroup { get; set; }
|
||||
|
||||
[Column("user_code"), JsonPropertyName("userCode")]
|
||||
public string? UserCode { get; set; }
|
||||
}
|
||||
14
salesbook.Shared/Core/Entity/VtbTipi.cs
Normal file
14
salesbook.Shared/Core/Entity/VtbTipi.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using SQLite;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace salesbook.Shared.Core.Entity;
|
||||
|
||||
[Table("vtb_tipi")]
|
||||
public class VtbTipi
|
||||
{
|
||||
[PrimaryKey, Column("cod_vtip"), JsonPropertyName("codVtip")]
|
||||
public string CodVtip { get; set; }
|
||||
|
||||
[Column("descrizione"), JsonPropertyName("descrizione")]
|
||||
public string Descrizione { get; set; }
|
||||
}
|
||||
@@ -9,5 +9,23 @@ public class MappingProfile : Profile
|
||||
public MappingProfile()
|
||||
{
|
||||
CreateMap<StbActivity, ActivityDTO>();
|
||||
|
||||
// Mapping da AnagClie a ContactDTO
|
||||
CreateMap<AnagClie, ContactDTO>()
|
||||
.ForMember(dest => dest.CodContact, opt => opt.MapFrom(src => src.CodAnag))
|
||||
.ForMember(dest => dest.IsContact, opt => opt.MapFrom(src => true));
|
||||
|
||||
// Mapping da PtbPros a ContactDTO
|
||||
CreateMap<PtbPros, ContactDTO>()
|
||||
.ForMember(dest => dest.CodContact, opt => opt.MapFrom(src => src.CodPpro))
|
||||
.ForMember(dest => dest.IsContact, opt => opt.MapFrom(src => false));
|
||||
|
||||
//Mapping da VtbCliePersRif a PersRifDTO
|
||||
CreateMap<VtbCliePersRif, PersRifDTO>()
|
||||
.ForMember(x => x.CodPersRif, y => y.MapFrom(z => z.CodAnag));
|
||||
|
||||
//Mapping da PtbProsRif a PersRifDTO
|
||||
CreateMap<PtbProsRif, PersRifDTO>()
|
||||
.ForMember(x => x.CodPersRif, y => y.MapFrom(z => z.CodPpro));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,4 +25,42 @@ public class ModalHelpers
|
||||
|
||||
return await modal.Result;
|
||||
}
|
||||
|
||||
public static async Task<DialogResult?> OpenUserForm(IDialogService dialog, ContactDTO? anag)
|
||||
{
|
||||
var modal = await dialog.ShowAsync<ContactForm>(
|
||||
"User form",
|
||||
new DialogParameters<ContactForm>
|
||||
{
|
||||
{ x => x.OriginalModel, anag }
|
||||
},
|
||||
new DialogOptions
|
||||
{
|
||||
FullScreen = true,
|
||||
CloseButton = false,
|
||||
NoHeader = true
|
||||
}
|
||||
);
|
||||
|
||||
return await modal.Result;
|
||||
}
|
||||
|
||||
public static async Task<DialogResult?> OpenPersRifForm(IDialogService dialog, PersRifDTO? persRif)
|
||||
{
|
||||
var modal = await dialog.ShowAsync<PersRifForm>(
|
||||
"Pers rif form",
|
||||
new DialogParameters<PersRifForm>
|
||||
{
|
||||
{ x => x.OriginalModel, persRif }
|
||||
},
|
||||
new DialogOptions
|
||||
{
|
||||
FullScreen = true,
|
||||
CloseButton = false,
|
||||
NoHeader = true
|
||||
}
|
||||
);
|
||||
|
||||
return await modal.Result;
|
||||
}
|
||||
}
|
||||
@@ -14,4 +14,6 @@ public interface IIntegryApiService
|
||||
Task DeleteActivity(string activityId);
|
||||
|
||||
Task<List<StbActivity>?> SaveActivity(ActivityDTO activity);
|
||||
Task SaveContact(CRMCreateContactRequestDTO request);
|
||||
Task<CheckVatResponseDTO> CheckVat(CheckVatRequestDTO request);
|
||||
}
|
||||
@@ -7,7 +7,9 @@ namespace salesbook.Shared.Core.Interface;
|
||||
public interface IManageDataService
|
||||
{
|
||||
Task<List<T>> GetTable<T>(Expression<Func<T, bool>>? whereCond = null) where T : new();
|
||||
|
||||
Task<List<ActivityDTO>> GetActivity(Expression<Func<StbActivity, bool>>? whereCond = null);
|
||||
Task<List<ContactDTO>> GetContact();
|
||||
|
||||
Task InsertOrUpdate<T>(T objectToSave);
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using IntegryApiClient.Core.Domain.Abstraction.Contracts.Account;
|
||||
using System.Xml;
|
||||
using IntegryApiClient.Core.Domain.Abstraction.Contracts.Account;
|
||||
using IntegryApiClient.Core.Domain.RestClient.Contacts;
|
||||
using salesbook.Shared.Core.Dto;
|
||||
using salesbook.Shared.Core.Entity;
|
||||
@@ -67,4 +68,10 @@ public class IntegryApiService(IIntegryApiRestClient integryApiRestClient, IUser
|
||||
|
||||
public Task<List<StbActivity>?> SaveActivity(ActivityDTO activity) =>
|
||||
integryApiRestClient.AuthorizedPost<List<StbActivity>?>("crm/saveActivity", activity);
|
||||
|
||||
public Task SaveContact(CRMCreateContactRequestDTO request) =>
|
||||
integryApiRestClient.AuthorizedPost<object>("crm/createContact", request);
|
||||
|
||||
public Task<CheckVatResponseDTO> CheckVat(CheckVatRequestDTO request) =>
|
||||
integryApiRestClient.Post<CheckVatResponseDTO>("checkPartitaIva", request)!;
|
||||
}
|
||||
@@ -6,6 +6,16 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<IsAotCompatible>True</IsAotCompatible>
|
||||
<RunAOTCompilation>true</RunAOTCompilation>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<IsAotCompatible>True</IsAotCompatible>
|
||||
<RunAOTCompilation>true</RunAOTCompilation>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<SupportedPlatform Include="browser" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -41,20 +41,23 @@
|
||||
}
|
||||
|
||||
.form-container > span {
|
||||
font-weight: 600;
|
||||
font-weight: 700;
|
||||
width: 50%;
|
||||
margin-right: .3rem;
|
||||
}
|
||||
|
||||
.form-container > .warning-text {
|
||||
font-weight: 500;
|
||||
font-weight: 700;
|
||||
color: var(--mud-palette-gray-darker);
|
||||
width: unset;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
.form-container > .disable-full-width { width: unset !important; }
|
||||
.form-container > .disable-full-width {
|
||||
width: unset !important;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.dateTime-picker {
|
||||
display: flex;
|
||||
|
||||
@@ -17,6 +17,11 @@ public class ManageDataService : IManageDataService
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<List<ContactDTO>> GetContact()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task InsertOrUpdate<T>(T objectToSave)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
||||
Reference in New Issue
Block a user