Compare commits
13 Commits
feature/Na
...
b34f6cb213
| Author | SHA1 | Date | |
|---|---|---|---|
| b34f6cb213 | |||
| 7bcb0581cc | |||
| b2064ad71e | |||
| 8c521dc81e | |||
| 65e48777e6 | |||
| bf2e1b65f0 | |||
| 691c132fb6 | |||
| 5d292a12ef | |||
| 60f7d14a72 | |||
| 5fe41f9445 | |||
| e614c83a5b | |||
| c2da42a51b | |||
| ca6be0c0a8 |
@@ -4,12 +4,17 @@ namespace salesbook.Maui
|
|||||||
{
|
{
|
||||||
public partial class App : Application
|
public partial class App : Application
|
||||||
{
|
{
|
||||||
|
private readonly IMessenger _messenger;
|
||||||
|
|
||||||
public App(IMessenger messenger)
|
public App(IMessenger messenger)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
_messenger = messenger;
|
||||||
|
}
|
||||||
|
|
||||||
MainPage = new NavigationPage(new MainPage(messenger));
|
protected override Window CreateWindow(IActivationState? activationState)
|
||||||
|
{
|
||||||
|
return new Window(new MainPage(_messenger));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ public class LocalDbService
|
|||||||
_connection.CreateTableAsync<StbActivityResult>();
|
_connection.CreateTableAsync<StbActivityResult>();
|
||||||
_connection.CreateTableAsync<StbActivityType>();
|
_connection.CreateTableAsync<StbActivityType>();
|
||||||
_connection.CreateTableAsync<StbUser>();
|
_connection.CreateTableAsync<StbUser>();
|
||||||
|
_connection.CreateTableAsync<VtbTipi>();
|
||||||
|
_connection.CreateTableAsync<Nazioni>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task ResetSettingsDb()
|
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_result;");
|
||||||
await _connection.ExecuteAsync("DROP TABLE IF EXISTS stb_activity_type;");
|
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 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<StbActivityResult>();
|
||||||
await _connection.CreateTableAsync<StbActivityType>();
|
await _connection.CreateTableAsync<StbActivityType>();
|
||||||
await _connection.CreateTableAsync<StbUser>();
|
await _connection.CreateTableAsync<StbUser>();
|
||||||
|
await _connection.CreateTableAsync<VtbTipi>();
|
||||||
|
await _connection.CreateTableAsync<Nazioni>();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
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() =>
|
public Task<List<T>> GetTable<T>(Expression<Func<T, bool>>? whereCond = null) where T : new() =>
|
||||||
localDb.Get(whereCond);
|
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)
|
public async Task<List<ActivityDTO>> GetActivity(Expression<Func<StbActivity, bool>>? whereCond = null)
|
||||||
{
|
{
|
||||||
var activities = await localDb.Get(whereCond);
|
var activities = await localDb.Get(whereCond);
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
using salesbook.Shared.Core.Interface;
|
|
||||||
|
|
||||||
namespace salesbook.Maui.Core.Services;
|
|
||||||
|
|
||||||
public class NavigationService(IServiceProvider serviceProvider) : INavigationService
|
|
||||||
{
|
|
||||||
public async Task NavigateToDetailsAsync()
|
|
||||||
{
|
|
||||||
var detailsPage = serviceProvider.GetService<PersonalInfo>();
|
|
||||||
if (Application.Current.MainPage is NavigationPage nav && detailsPage != null)
|
|
||||||
{
|
|
||||||
await nav.Navigation.PushAsync(detailsPage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
using salesbook.Shared.Core.Interface;
|
|
||||||
|
|
||||||
namespace salesbook.Maui.Core.Services;
|
|
||||||
|
|
||||||
public class PageTitleService(IDispatcher dispatcher) : IPageTitleService
|
|
||||||
{
|
|
||||||
public void SetTitle(string title)
|
|
||||||
{
|
|
||||||
dispatcher.Dispatch(() =>
|
|
||||||
{
|
|
||||||
if (Application.Current?.MainPage is NavigationPage nav &&
|
|
||||||
nav.CurrentPage is ContentPage cp)
|
|
||||||
{
|
|
||||||
cp.Title = title;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -82,5 +82,11 @@ public class SyncDbService(IIntegryApiService integryApiService, LocalDbService
|
|||||||
|
|
||||||
if (!settingsResponse.StbUsers.IsNullOrEmpty())
|
if (!settingsResponse.StbUsers.IsNullOrEmpty())
|
||||||
await localDb.InsertAll(settingsResponse.StbUsers!);
|
await localDb.InsertAll(settingsResponse.StbUsers!);
|
||||||
|
|
||||||
|
if (!settingsResponse.VtbTipi.IsNullOrEmpty())
|
||||||
|
await localDb.InsertAll(settingsResponse.VtbTipi!);
|
||||||
|
|
||||||
|
if (!settingsResponse.Nazioni.IsNullOrEmpty())
|
||||||
|
await localDb.InsertAll(settingsResponse.Nazioni!);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
xmlns:local="clr-namespace:salesbook.Maui"
|
||||||
xmlns:shared="clr-namespace:salesbook.Shared;assembly=salesbook.Shared"
|
xmlns:shared="clr-namespace:salesbook.Shared;assembly=salesbook.Shared"
|
||||||
x:Class="salesbook.Maui.MainPage"
|
x:Class="salesbook.Maui.MainPage"
|
||||||
BackgroundColor="{DynamicResource PageBackgroundColor}">
|
BackgroundColor="{DynamicResource PageBackgroundColor}">
|
||||||
|
|
||||||
<BlazorWebView HostPage="wwwroot/index.html">
|
<BlazorWebView x:Name="blazorWebView" HostPage="wwwroot/index.html">
|
||||||
<BlazorWebView.RootComponents>
|
<BlazorWebView.RootComponents>
|
||||||
<RootComponent Selector="#app" ComponentType="{x:Type shared:Components.Routes}" />
|
<RootComponent Selector="#app" ComponentType="{x:Type shared:Components.Routes}" />
|
||||||
</BlazorWebView.RootComponents>
|
</BlazorWebView.RootComponents>
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ namespace salesbook.Maui
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_messenger = messenger;
|
_messenger = messenger;
|
||||||
|
|
||||||
Title = "Home";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnBackButtonPressed()
|
protected override bool OnBackButtonPressed()
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using AutoMapper;
|
||||||
using CommunityToolkit.Maui;
|
using CommunityToolkit.Maui;
|
||||||
using CommunityToolkit.Mvvm.Messaging;
|
using CommunityToolkit.Mvvm.Messaging;
|
||||||
using IntegryApiClient.MAUI;
|
using IntegryApiClient.MAUI;
|
||||||
@@ -13,7 +14,6 @@ using salesbook.Shared.Core.Messages.Activity.Copy;
|
|||||||
using salesbook.Shared.Core.Messages.Activity.New;
|
using salesbook.Shared.Core.Messages.Activity.New;
|
||||||
using salesbook.Shared.Core.Messages.Back;
|
using salesbook.Shared.Core.Messages.Back;
|
||||||
using salesbook.Shared.Core.Services;
|
using salesbook.Shared.Core.Services;
|
||||||
using System.Globalization;
|
|
||||||
|
|
||||||
namespace salesbook.Maui
|
namespace salesbook.Maui
|
||||||
{
|
{
|
||||||
@@ -25,15 +25,20 @@ namespace salesbook.Maui
|
|||||||
{
|
{
|
||||||
InteractiveRenderSettings.ConfigureBlazorHybridRenderModes();
|
InteractiveRenderSettings.ConfigureBlazorHybridRenderModes();
|
||||||
|
|
||||||
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("it-IT");
|
|
||||||
CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("it-IT");
|
|
||||||
|
|
||||||
var builder = MauiApp.CreateBuilder();
|
var builder = MauiApp.CreateBuilder();
|
||||||
builder
|
builder
|
||||||
.UseMauiApp<App>()
|
.UseMauiApp<App>()
|
||||||
|
.UseIntegry(appToken: AppToken, useLoginAzienda: true)
|
||||||
.UseMauiCommunityToolkit()
|
.UseMauiCommunityToolkit()
|
||||||
.ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); })
|
.UseSentry(options =>
|
||||||
.UseLoginAzienda(AppToken);
|
{
|
||||||
|
options.Dsn = "https://453b6b38f94fd67e40e0d5306d6caff8@o4508499810254848.ingest.de.sentry.io/4509605099667536";
|
||||||
|
#if DEBUG
|
||||||
|
options.Debug = true;
|
||||||
|
#endif
|
||||||
|
options.TracesSampleRate = 1.0;
|
||||||
|
})
|
||||||
|
.ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); });
|
||||||
|
|
||||||
builder.Services.AddMauiBlazorWebView();
|
builder.Services.AddMauiBlazorWebView();
|
||||||
builder.Services.AddMudServices();
|
builder.Services.AddMudServices();
|
||||||
@@ -65,10 +70,6 @@ namespace salesbook.Maui
|
|||||||
builder.Services.AddSingleton<IFormFactor, FormFactor>();
|
builder.Services.AddSingleton<IFormFactor, FormFactor>();
|
||||||
builder.Services.AddSingleton<LocalDbService>();
|
builder.Services.AddSingleton<LocalDbService>();
|
||||||
|
|
||||||
builder.Services.AddSingleton<INavigationService, NavigationService>();
|
|
||||||
builder.Services.AddSingleton<IPageTitleService, PageTitleService>();
|
|
||||||
builder.Services.AddTransient<PersonalInfo>();
|
|
||||||
|
|
||||||
return builder.Build();
|
return builder.Build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
|
||||||
xmlns:components="clr-namespace:salesbook.Shared.Components;assembly=salesbook.Shared"
|
|
||||||
x:Class="salesbook.Maui.PersonalInfo"
|
|
||||||
BackgroundColor="{DynamicResource PageBackgroundColor}">
|
|
||||||
|
|
||||||
<BlazorWebView HostPage="wwwroot/index.html" StartPath="/PersonalInfo">
|
|
||||||
<BlazorWebView.RootComponents>
|
|
||||||
<RootComponent Selector="#app" ComponentType="{x:Type components:Routes}" />
|
|
||||||
</BlazorWebView.RootComponents>
|
|
||||||
</BlazorWebView>
|
|
||||||
|
|
||||||
</ContentPage>
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
namespace salesbook.Maui;
|
|
||||||
|
|
||||||
public partial class PersonalInfo : ContentPage
|
|
||||||
{
|
|
||||||
public PersonalInfo()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
Title = "Profilo";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
using Android.App;
|
using Android.App;
|
||||||
using Android.Content.PM;
|
using Android.Content.PM;
|
||||||
using AndroidX.AppCompat.App;
|
|
||||||
|
|
||||||
namespace salesbook.Maui
|
namespace salesbook.Maui
|
||||||
{
|
{
|
||||||
@@ -10,9 +9,5 @@ namespace salesbook.Maui
|
|||||||
ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
|
ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
|
||||||
public class MainActivity : MauiAppCompatActivity
|
public class MainActivity : MauiAppCompatActivity
|
||||||
{
|
{
|
||||||
public MainActivity()
|
|
||||||
{
|
|
||||||
AppCompatDelegate.DefaultNightMode = AppCompatDelegate.ModeNightNo;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,7 @@ using Android.Runtime;
|
|||||||
|
|
||||||
namespace salesbook.Maui
|
namespace salesbook.Maui
|
||||||
{
|
{
|
||||||
[Application]
|
[Application(HardwareAccelerated = true)]
|
||||||
public class MainApplication : MauiApplication
|
public class MainApplication : MauiApplication
|
||||||
{
|
{
|
||||||
public MainApplication(IntPtr handle, JniHandleOwnership ownership)
|
public MainApplication(IntPtr handle, JniHandleOwnership ownership)
|
||||||
|
|||||||
@@ -35,8 +35,5 @@
|
|||||||
<key>NSAllowsArbitraryLoads</key>
|
<key>NSAllowsArbitraryLoads</key>
|
||||||
<true/>
|
<true/>
|
||||||
</dict>
|
</dict>
|
||||||
|
|
||||||
<key>UIUserInterfaceStyle</key>
|
|
||||||
<string>Light</string>
|
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@@ -29,8 +29,8 @@
|
|||||||
<ApplicationId>it.integry.salesbook</ApplicationId>
|
<ApplicationId>it.integry.salesbook</ApplicationId>
|
||||||
|
|
||||||
<!-- Versions -->
|
<!-- Versions -->
|
||||||
<ApplicationDisplayVersion>1.0.0</ApplicationDisplayVersion>
|
<ApplicationDisplayVersion>1.0.1</ApplicationDisplayVersion>
|
||||||
<ApplicationVersion>3</ApplicationVersion>
|
<ApplicationVersion>4</ApplicationVersion>
|
||||||
|
|
||||||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
|
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
|
||||||
<!--<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
|
<!--<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
|
||||||
@@ -78,8 +78,9 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(TargetFramework)'=='net9.0-ios'">
|
<PropertyGroup Condition="'$(TargetFramework)'=='net9.0-ios'">
|
||||||
<CodesignKey>Apple Development: Created via API (5B7B69P4JY)</CodesignKey>
|
<CodesignKey>Apple Distribution: Integry S.r.l. (UNP26J4R89)</CodesignKey>
|
||||||
<CodesignProvision>VS: WildCard Development</CodesignProvision>
|
<CodesignProvision></CodesignProvision>
|
||||||
|
<ProvisioningType>manual</ProvisioningType>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' OR $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
|
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' OR $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
|
||||||
@@ -118,14 +119,15 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="CommunityToolkit.Maui" Version="11.2.0" />
|
<PackageReference Include="CommunityToolkit.Maui" Version="12.0.0" />
|
||||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
|
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
|
||||||
<PackageReference Include="IntegryApiClient.MAUI" Version="1.1.4" />
|
<PackageReference Include="IntegryApiClient.MAUI" Version="1.1.6" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.5" />
|
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.6" />
|
||||||
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.70" />
|
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.81" />
|
||||||
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.70" />
|
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.81" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="9.0.70" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="9.0.81" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.5" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.6" />
|
||||||
|
<PackageReference Include="Sentry.Maui" Version="5.11.2" />
|
||||||
<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
|
<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
@@ -133,16 +135,4 @@
|
|||||||
<ProjectReference Include="..\salesbook.Shared\salesbook.Shared.csproj" />
|
<ProjectReference Include="..\salesbook.Shared\salesbook.Shared.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Update="PersonalInfo.xaml.cs">
|
|
||||||
<DependentUpon>PersonalInfo.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<MauiXaml Update="PersonalInfo.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</MauiXaml>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
@@ -1,7 +1,4 @@
|
|||||||
@using Microsoft.Maui.Controls
|
|
||||||
@using salesbook.Shared.Core.Interface
|
|
||||||
@inject IJSRuntime JS
|
@inject IJSRuntime JS
|
||||||
@inject INavigationService NavigationService
|
|
||||||
|
|
||||||
<div class="@(Back ? "" : "container") header">
|
<div class="@(Back ? "" : "container") header">
|
||||||
<div class="header-content @(Back ? "with-back" : "no-back")">
|
<div class="header-content @(Back ? "with-back" : "no-back")">
|
||||||
@@ -86,9 +83,7 @@
|
|||||||
await JS.InvokeVoidAsync("goBack");
|
await JS.InvokeVoidAsync("goBack");
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task OpenPersonalInfo()
|
private void OpenPersonalInfo() =>
|
||||||
{
|
NavigationManager.NavigateTo("/PersonalInfo");
|
||||||
await NavigationService.NavigateToDetailsAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
@using System.Globalization
|
@using System.Globalization
|
||||||
@using salesbook.Shared.Core.Interface
|
@using CommunityToolkit.Mvvm.Messaging
|
||||||
@using salesbook.Shared.Core.Messages.Back
|
@using salesbook.Shared.Core.Messages.Back
|
||||||
@inherits LayoutComponentBase
|
@inherits LayoutComponentBase
|
||||||
@inject IJSRuntime JS
|
@inject IJSRuntime JS
|
||||||
|
@inject IMessenger Messenger
|
||||||
@inject BackNavigationService BackService
|
@inject BackNavigationService BackService
|
||||||
@inject INavigationService NavigationService
|
|
||||||
|
|
||||||
<MudThemeProvider Theme="_currentTheme" @ref="@_mudThemeProvider" @bind-IsDarkMode="@IsDarkMode" />
|
<MudThemeProvider Theme="_currentTheme" @ref="@_mudThemeProvider" @bind-IsDarkMode="@IsDarkMode" />
|
||||||
<MudPopoverProvider/>
|
<MudPopoverProvider/>
|
||||||
|
|||||||
@@ -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" />
|
<MudFab Class="custom-plus-button" Color="Color.Surface" Size="Size.Medium" IconSize="Size.Medium" IconColor="Color.Primary" StartIcon="@Icons.Material.Filled.Add" />
|
||||||
</ActivatorContent>
|
</ActivatorContent>
|
||||||
<ChildContent>
|
<ChildContent>
|
||||||
<MudMenuItem Disabled="true">Nuovo contatto</MudMenuItem>
|
<MudMenuItem OnClick="() => CreateUser()">Nuovo contatto</MudMenuItem>
|
||||||
<MudMenuItem OnClick="() => CreateActivity()">Nuova attivit<69></MudMenuItem>
|
<MudMenuItem OnClick="() => CreateActivity()">Nuova attivit<69></MudMenuItem>
|
||||||
</ChildContent>
|
</ChildContent>
|
||||||
</MudMenu>
|
</MudMenu>
|
||||||
@@ -92,5 +92,10 @@
|
|||||||
Messenger.Send(new NewActivityMessage(((StbActivity)result.Data).ActivityId));
|
Messenger.Send(new NewActivityMessage(((StbActivity)result.Data).ActivityId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task CreateUser()
|
||||||
|
{
|
||||||
|
var result = await ModalHelpers.OpenUserForm(Dialog, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,21 @@
|
|||||||
@page "/Calendar"
|
@page "/Calendar"
|
||||||
@using salesbook.Shared.Core.Dto
|
@using salesbook.Shared.Core.Dto
|
||||||
@using salesbook.Shared.Core.Interface
|
@using salesbook.Shared.Core.Interface
|
||||||
|
@using salesbook.Shared.Components.Layout
|
||||||
@using salesbook.Shared.Components.SingleElements
|
@using salesbook.Shared.Components.SingleElements
|
||||||
@using salesbook.Shared.Components.Layout.Spinner
|
@using salesbook.Shared.Components.Layout.Spinner
|
||||||
@using salesbook.Shared.Components.SingleElements.BottomSheet
|
@using salesbook.Shared.Components.SingleElements.BottomSheet
|
||||||
|
@using salesbook.Shared.Core.Entity
|
||||||
@using salesbook.Shared.Core.Messages.Activity.New
|
@using salesbook.Shared.Core.Messages.Activity.New
|
||||||
@inject IManageDataService ManageData
|
@inject IManageDataService ManageData
|
||||||
@inject IJSRuntime JS
|
@inject IJSRuntime JS
|
||||||
@inject NewActivityService NewActivity
|
@inject NewActivityService NewActivity
|
||||||
@inject IPageTitleService PageTitleService
|
|
||||||
|
|
||||||
@* <HeaderLayout Title="@_headerTitle"
|
<HeaderLayout Title="@_headerTitle"
|
||||||
ShowFilter="true"
|
ShowFilter="true"
|
||||||
ShowCalendarToggle="true"
|
ShowCalendarToggle="true"
|
||||||
OnFilterToggle="ToggleFilter"
|
OnFilterToggle="ToggleFilter"
|
||||||
OnCalendarToggle="ToggleExpanded"/> *@
|
OnCalendarToggle="ToggleExpanded"/>
|
||||||
|
|
||||||
<div @ref="_weekSliderRef" class="container week-slider @(Expanded ? "expanded" : "") @(SliderAnimation)">
|
<div @ref="_weekSliderRef" class="container week-slider @(Expanded ? "expanded" : "") @(SliderAnimation)">
|
||||||
@if (Expanded)
|
@if (Expanded)
|
||||||
@@ -259,8 +260,6 @@
|
|||||||
private void PrepareHeaderTitle()
|
private void PrepareHeaderTitle()
|
||||||
{
|
{
|
||||||
_headerTitle = CurrentMonth.ToString("MMMM yyyy", new System.Globalization.CultureInfo("it-IT")).FirstCharToUpper();
|
_headerTitle = CurrentMonth.ToString("MMMM yyyy", new System.Globalization.CultureInfo("it-IT")).FirstCharToUpper();
|
||||||
PageTitleService?.SetTitle(_headerTitle);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PrepareEventsCache()
|
private void PrepareEventsCache()
|
||||||
@@ -373,7 +372,9 @@
|
|||||||
filteredActivity = filteredActivity
|
filteredActivity = filteredActivity
|
||||||
.Where(x => Filter.Category == null || x.Category.Equals(Filter.Category));
|
.Where(x => Filter.Category == null || x.Category.Equals(Filter.Category));
|
||||||
|
|
||||||
return filteredActivity.ToList();
|
return filteredActivity
|
||||||
|
.OrderBy(x => x.EffectiveTime ?? x.EstimatedTime)
|
||||||
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
[JSInvokable]
|
[JSInvokable]
|
||||||
|
|||||||
@@ -1,19 +1,14 @@
|
|||||||
@page "/Notifications"
|
@page "/Notifications"
|
||||||
@attribute [Authorize]
|
@attribute [Authorize]
|
||||||
|
@using salesbook.Shared.Components.Layout
|
||||||
@using salesbook.Shared.Components.SingleElements
|
@using salesbook.Shared.Components.SingleElements
|
||||||
@using salesbook.Shared.Core.Interface
|
|
||||||
@inject IPageTitleService PageTitleService
|
|
||||||
|
|
||||||
@* <HeaderLayout Title="Notifiche" /> *@
|
<HeaderLayout Title="Notifiche" />
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<NoDataAvailable Text="Nessuna notifica meno recente" />
|
<NoDataAvailable Text="Nessuna notifica meno recente" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
protected override void OnInitialized()
|
|
||||||
{
|
|
||||||
PageTitleService?.SetTitle("Notifiche");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
@page "/PersonalInfo"
|
@page "/PersonalInfo"
|
||||||
@attribute [Authorize]
|
@attribute [Authorize]
|
||||||
|
@using salesbook.Shared.Components.Layout
|
||||||
@using salesbook.Shared.Core.Authorization.Enum
|
@using salesbook.Shared.Core.Authorization.Enum
|
||||||
@using salesbook.Shared.Core.Interface
|
@using salesbook.Shared.Core.Interface
|
||||||
@using salesbook.Shared.Core.Services
|
@using salesbook.Shared.Core.Services
|
||||||
@@ -7,7 +8,7 @@
|
|||||||
@inject INetworkService NetworkService
|
@inject INetworkService NetworkService
|
||||||
@inject IFormFactor FormFactor
|
@inject IFormFactor FormFactor
|
||||||
|
|
||||||
@* <HeaderLayout BackTo="Indietro" Back="true" BackOnTop="true" Title="Profilo" ShowProfile="false"/> *@
|
<HeaderLayout BackTo="Indietro" Back="true" BackOnTop="true" Title="Profilo" ShowProfile="false"/>
|
||||||
|
|
||||||
@if (IsLoggedIn)
|
@if (IsLoggedIn)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
@page "/User/{CodAnag}"
|
@page "/User/{CodContact}/{IsContact:bool}"
|
||||||
@attribute [Authorize]
|
@attribute [Authorize]
|
||||||
|
@using AutoMapper
|
||||||
@using salesbook.Shared.Components.Layout
|
@using salesbook.Shared.Components.Layout
|
||||||
@using salesbook.Shared.Core.Entity
|
@using salesbook.Shared.Core.Entity
|
||||||
@using salesbook.Shared.Core.Interface
|
@using salesbook.Shared.Core.Interface
|
||||||
@using salesbook.Shared.Components.Layout.Spinner
|
@using salesbook.Shared.Components.Layout.Spinner
|
||||||
|
@using salesbook.Shared.Core.Dto
|
||||||
|
@using salesbook.Shared.Components.SingleElements
|
||||||
@inject IManageDataService ManageData
|
@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)
|
@if (IsLoading)
|
||||||
{
|
{
|
||||||
@@ -35,72 +40,93 @@ else
|
|||||||
|
|
||||||
<div class="section-info">
|
<div class="section-info">
|
||||||
<div class="section-personal-info">
|
<div class="section-personal-info">
|
||||||
<div>
|
@if (!string.IsNullOrEmpty(Anag.Telefono))
|
||||||
<span class="info-title">Telefono</span>
|
{
|
||||||
<span class="info-text">
|
<div>
|
||||||
@if (string.IsNullOrEmpty(Anag.Telefono))
|
<span class="info-title">Telefono</span>
|
||||||
{
|
<span class="info-text">
|
||||||
@("Nessuna mail configurata")
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
@Anag.Telefono
|
@Anag.Telefono
|
||||||
}
|
</span>
|
||||||
</span>
|
</div>
|
||||||
</div>
|
}
|
||||||
|
|
||||||
|
@if (!string.IsNullOrEmpty(Anag.PartIva))
|
||||||
|
{
|
||||||
|
<div>
|
||||||
|
<span class="info-title">P. IVA</span>
|
||||||
|
<span class="info-text">
|
||||||
|
@Anag.PartIva
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="section-personal-info">
|
<div class="section-personal-info">
|
||||||
<div>
|
@if (!string.IsNullOrEmpty(Anag.EMail))
|
||||||
<span class="info-title">E-mail</span>
|
{
|
||||||
<span class="info-text">
|
<div>
|
||||||
@if (string.IsNullOrEmpty(Anag.EMail))
|
<span class="info-title">E-mail</span>
|
||||||
{
|
<span class="info-text">
|
||||||
@("Nessuna mail configurata")
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
@Anag.EMail
|
@Anag.EMail
|
||||||
}
|
</span>
|
||||||
</span>
|
</div>
|
||||||
</div>
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if (PersRif is { Count: > 0 })
|
<MudTabs TabPanelClass="custom-tab-panel" Elevation="2" Rounded="true" PanelClass="pt-2" Centered="true">
|
||||||
{
|
<MudTabPanel Text="Contatti">
|
||||||
<div class="container-pers-rif">
|
@if (PersRif is { Count: > 0 })
|
||||||
<Virtualize Items="PersRif" Context="person">
|
{
|
||||||
@{
|
<div style="margin-top: 1rem;" class="container-pers-rif">
|
||||||
var index = PersRif.IndexOf(person);
|
<Virtualize Items="PersRif" Context="person">
|
||||||
var isLast = index == PersRif.Count - 1;
|
@{
|
||||||
}
|
var index = PersRif.IndexOf(person);
|
||||||
<ContactCard Contact="person" />
|
var isLast = index == PersRif.Count - 1;
|
||||||
@if (!isLast)
|
}
|
||||||
{
|
<ContactCard Contact="person"/>
|
||||||
<div class="divider"></div>
|
@if (!isLast)
|
||||||
}
|
{
|
||||||
</Virtualize>
|
<div class="divider"></div>
|
||||||
</div>
|
}
|
||||||
}
|
</Virtualize>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
<div class="container-button">
|
<div class="container-button">
|
||||||
<MudButton Class="button-settings infoText"
|
<MudButton Class="button-settings infoText"
|
||||||
FullWidth="true"
|
FullWidth="true"
|
||||||
Size="Size.Medium"
|
Size="Size.Medium"
|
||||||
Variant="Variant.Outlined">
|
OnClick="OpenPersRifForm"
|
||||||
Aggiungi contatto
|
Variant="Variant.Outlined">
|
||||||
</MudButton>
|
Aggiungi contatto
|
||||||
</div>
|
</MudButton>
|
||||||
|
</div>
|
||||||
|
</MudTabPanel>
|
||||||
|
<MudTabPanel Text="Commesse">
|
||||||
|
@if (Commesse.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
<NoDataAvailable Text="Nessuna commessa presente"/>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<Virtualize Items="Commesse" Context="commessa">
|
||||||
|
<CommessaCard Commessa="commessa"/>
|
||||||
|
</Virtualize>
|
||||||
|
}
|
||||||
|
</MudTabPanel>
|
||||||
|
</MudTabs>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
@code {
|
@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 ContactDTO Anag { get; set; } = new();
|
||||||
private List<VtbCliePersRif>? PersRif { get; set; }
|
private List<PersRifDTO>? PersRif { get; set; }
|
||||||
|
private List<JtbComt> Commesse { get; set; }
|
||||||
|
|
||||||
private bool IsLoading { get; set; } = true;
|
private bool IsLoading { get; set; } = true;
|
||||||
|
|
||||||
@@ -111,11 +137,37 @@ else
|
|||||||
|
|
||||||
private async Task LoadData()
|
private async Task LoadData()
|
||||||
{
|
{
|
||||||
Anag = (await ManageData.GetTable<AnagClie>(x => x.CodAnag.Equals(CodAnag))).Last();
|
if (IsContact)
|
||||||
PersRif = await ManageData.GetTable<VtbCliePersRif>(x => x.CodAnag.Equals(Anag.CodAnag));
|
{
|
||||||
|
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;
|
IsLoading = false;
|
||||||
StateHasChanged();
|
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;
|
margin-bottom: 1rem;
|
||||||
box-shadow: var(--custom-box-shadow);
|
box-shadow: var(--custom-box-shadow);
|
||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
|
max-height: 32vh;
|
||||||
|
overflow: auto;
|
||||||
|
scrollbar-width: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.container-pers-rif::-webkit-scrollbar { display: none; }
|
||||||
|
|
||||||
.container-pers-rif .divider {
|
.container-pers-rif .divider {
|
||||||
margin: 0 0 0 3.5rem;
|
margin: 0 0 0 3.5rem;
|
||||||
width: unset;
|
width: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.custom-tab-panel {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
gap: 1rem;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
@@ -1,27 +1,43 @@
|
|||||||
@page "/Users"
|
@page "/Users"
|
||||||
@attribute [Authorize]
|
@attribute [Authorize]
|
||||||
@using salesbook.Shared.Core.Entity
|
@using salesbook.Shared.Components.Layout
|
||||||
|
@using salesbook.Shared.Core.Dto
|
||||||
@using salesbook.Shared.Core.Interface
|
@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
|
@inject IManageDataService ManageData
|
||||||
@inject IPageTitleService PageTitleService
|
|
||||||
|
|
||||||
@* <HeaderLayout Title="Contatti"/> *@
|
<HeaderLayout Title="Contatti"/>
|
||||||
|
|
||||||
<div class="container search-box">
|
<div class="container search-box">
|
||||||
<div class="input-card clearButton">
|
<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())
|
@if (!TextToFilter.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
<MudIconButton Class="closeIcon" Icon="@Icons.Material.Filled.Close" OnClick="() => FilterUsers(true)"/>
|
<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>
|
</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>
|
||||||
|
|
||||||
<div class="container users">
|
<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)
|
@if (item.ShowHeader)
|
||||||
{
|
{
|
||||||
<div class="letter-header">@item.HeaderLetter</div>
|
<div class="letter-header">@item.HeaderLetter</div>
|
||||||
@@ -29,30 +45,45 @@
|
|||||||
<UserCard User="item.User"/>
|
<UserCard User="item.User"/>
|
||||||
</Virtualize>
|
</Virtualize>
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<NoDataAvailable Text="Nessun contatto trovato"/>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<FilterUsers @bind-IsSheetVisible="OpenFilter" @bind-Filter="Filter" @bind-Filter:after="FilterUsers"/>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private List<UserDisplayItem> GroupedUserList { get; set; } = [];
|
private List<UserDisplayItem> GroupedUserList { get; set; } = [];
|
||||||
private List<UserDisplayItem> FilteredGroupedUserList { get; set; } = [];
|
private List<UserDisplayItem> FilteredGroupedUserList { get; set; } = [];
|
||||||
private string? TextToFilter { get; set; }
|
|
||||||
|
|
||||||
protected override void OnInitialized()
|
private bool IsLoading { get; set; }
|
||||||
{
|
|
||||||
PageTitleService?.SetTitle("Contatti");
|
//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)
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||||
{
|
{
|
||||||
if (firstRender)
|
if (firstRender)
|
||||||
{
|
{
|
||||||
await LoadData();
|
await LoadData();
|
||||||
StateHasChanged();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task LoadData()
|
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
|
var sortedUsers = users
|
||||||
.Where(u => !string.IsNullOrWhiteSpace(u.RagSoc))
|
.Where(u => !string.IsNullOrWhiteSpace(u.RagSoc))
|
||||||
@@ -85,11 +116,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
FilterUsers();
|
FilterUsers();
|
||||||
|
|
||||||
|
IsLoading = false;
|
||||||
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
private class UserDisplayItem
|
private class UserDisplayItem
|
||||||
{
|
{
|
||||||
public required AnagClie User { get; set; }
|
public required ContactDTO User { get; set; }
|
||||||
public bool ShowHeader { get; set; }
|
public bool ShowHeader { get; set; }
|
||||||
public string? HeaderLetter { get; set; }
|
public string? HeaderLetter { get; set; }
|
||||||
}
|
}
|
||||||
@@ -101,23 +135,49 @@
|
|||||||
if (clearFilter || string.IsNullOrWhiteSpace(TextToFilter))
|
if (clearFilter || string.IsNullOrWhiteSpace(TextToFilter))
|
||||||
{
|
{
|
||||||
TextToFilter = null;
|
TextToFilter = null;
|
||||||
FilteredGroupedUserList = GroupedUserList;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var filter = TextToFilter.Trim();
|
|
||||||
var result = new List<UserDisplayItem>();
|
var result = new List<UserDisplayItem>();
|
||||||
|
|
||||||
foreach (var item in GroupedUserList)
|
foreach (var item in GroupedUserList)
|
||||||
{
|
{
|
||||||
var user = item.User;
|
var user = item.User;
|
||||||
if (
|
|
||||||
(!string.IsNullOrEmpty(user.RagSoc) && user.RagSoc.Contains(filter, StringComparison.OrdinalIgnoreCase)) ||
|
switch (TypeUser)
|
||||||
(!string.IsNullOrEmpty(user.Indirizzo) && user.Indirizzo.Contains(filter, StringComparison.OrdinalIgnoreCase)) ||
|
{
|
||||||
(!string.IsNullOrEmpty(user.Telefono) && user.Telefono.Contains(filter, StringComparison.OrdinalIgnoreCase)) ||
|
case "contact" when !user.IsContact:
|
||||||
(!string.IsNullOrEmpty(user.EMail) && user.EMail.Contains(filter, StringComparison.OrdinalIgnoreCase)) ||
|
case "prospect" when user.IsContact:
|
||||||
(!string.IsNullOrEmpty(user.PartIva) && user.PartIva.Contains(filter, StringComparison.OrdinalIgnoreCase))
|
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));
|
||||||
|
|
||||||
|
if (matchesText)
|
||||||
|
{
|
||||||
|
result.Add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
result.Add(item);
|
result.Add(item);
|
||||||
}
|
}
|
||||||
@@ -126,4 +186,10 @@
|
|||||||
FilteredGroupedUserList = result;
|
FilteredGroupedUserList = result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ToggleFilter()
|
||||||
|
{
|
||||||
|
OpenFilter = !OpenFilter;
|
||||||
|
StateHasChanged();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -28,6 +28,6 @@
|
|||||||
padding-bottom: .5rem;
|
padding-bottom: .5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-box .input-card {
|
.search-box .input-card { margin: 0 !important; }
|
||||||
margin: 0 !important;
|
|
||||||
}
|
.search-box .input-card ::deep .rounded-button { border-radius: 50%; }
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@using salesbook.Shared.Components.SingleElements
|
@using salesbook.Shared.Components.SingleElements.Modal.ExceptionModal
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
|
|
||||||
<ErrorBoundary @ref="ErrorBoundary">
|
<ErrorBoundary @ref="ErrorBoundary">
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
<div class="bottom-sheet-backdrop @(IsSheetVisible ? "show" : "")" @onclick="CloseBottomSheet"></div>
|
||||||
|
|
||||||
|
<div class="bottom-sheet-container @(IsSheetVisible ? "show" : "")">
|
||||||
|
<div class="bottom-sheet pb-safe-area">
|
||||||
|
<div class="title">
|
||||||
|
<MudText Typo="Typo.h6">
|
||||||
|
<b>Aggiungi un promemoria</b>
|
||||||
|
</MudText>
|
||||||
|
<MudIconButton Icon="@Icons.Material.Filled.Close" OnClick="() => CloseBottomSheet()"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="input-card">
|
||||||
|
<div class="form-container">
|
||||||
|
<span>Data</span>
|
||||||
|
|
||||||
|
<MudTextField T="DateTime?" Format="yyyy-MM-dd" InputType="InputType.Date" @bind-Value="Date" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="input-card">
|
||||||
|
<MudTextField T="string?" Placeholder="Memo" Variant="Variant.Text" Lines="4" @bind-Value="Memo" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="button-section">
|
||||||
|
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="() => CloseBottomSheet(true)">Salva</MudButton>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
[Parameter] public bool IsSheetVisible { get; set; }
|
||||||
|
[Parameter] public EventCallback<bool> IsSheetVisibleChanged { get; set; }
|
||||||
|
|
||||||
|
private DateTime? Date { get; set; } = DateTime.Today;
|
||||||
|
private string? Memo { get; set; }
|
||||||
|
|
||||||
|
private void CloseBottomSheet(bool save)
|
||||||
|
{
|
||||||
|
IsSheetVisible = false;
|
||||||
|
IsSheetVisibleChanged.InvokeAsync(IsSheetVisible);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CloseBottomSheet() => CloseBottomSheet(false);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
@@ -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.Entity
|
||||||
@using salesbook.Shared.Core.Helpers.Enum
|
|
||||||
@using salesbook.Shared.Core.Interface
|
@using salesbook.Shared.Core.Interface
|
||||||
@inject IManageDataService manageData
|
@inject IManageDataService manageData
|
||||||
|
|
||||||
@@ -15,89 +15,81 @@
|
|||||||
<MudIconButton Icon="@Icons.Material.Filled.Close" OnClick="CloseBottomSheet"/>
|
<MudIconButton Icon="@Icons.Material.Filled.Close" OnClick="CloseBottomSheet"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="input-card clearButton">
|
<div class="input-card">
|
||||||
<MudTextField T="string?" Placeholder="Cerca..." Variant="Variant.Text" @bind-Value="Filter.Text" DebounceInterval="500"/>
|
<div class="form-container">
|
||||||
|
<span class="disable-full-width">Con agente</span>
|
||||||
|
|
||||||
<MudIconButton Class="closeIcon" Icon="@Icons.Material.Filled.Close" OnClick="() => Filter.Text = null"/>
|
<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">Senza agente</span>
|
||||||
|
|
||||||
|
<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">Agente</span>
|
||||||
|
|
||||||
|
<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="@user.UserCode">@($"{user.UserCode} - {user.FullName}")</MudSelectItemExtended>
|
||||||
|
}
|
||||||
|
</MudSelectExtended>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="input-card">
|
<div class="input-card">
|
||||||
<div class="form-container">
|
<div class="form-container">
|
||||||
<span class="disable-full-width">Assegnata a</span>
|
<MudTextField T="string?"
|
||||||
|
Placeholder="Indirizzo"
|
||||||
<MudSelectExtended SearchBox="true"
|
Variant="Variant.Text"
|
||||||
ItemCollection="Users.Select(x => x.UserName).ToList()"
|
@bind-Value="Filter.Indirizzo"
|
||||||
SelectAllPosition="SelectAllPosition.NextToSearchBox"
|
DebounceInterval="500"/>
|
||||||
SelectAll="true"
|
|
||||||
NoWrap="true"
|
|
||||||
MultiSelection="true"
|
|
||||||
MultiSelectionTextFunc="@(new Func<List<string>, string>(GetMultiSelectionUser))"
|
|
||||||
FullWidth="true" T="string"
|
|
||||||
Variant="Variant.Text"
|
|
||||||
Virtualize="true"
|
|
||||||
@bind-SelectedValues="Filter.User"
|
|
||||||
Class="customIcon-select"
|
|
||||||
AdornmentIcon="@Icons.Material.Filled.Code"/>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="divider"></div>
|
<div class="divider"></div>
|
||||||
|
|
||||||
<div class="form-container">
|
<div class="form-container">
|
||||||
<span class="disable-full-width">Tipo</span>
|
<MudTextField T="string?"
|
||||||
|
Placeholder="Città"
|
||||||
<MudSelectExtended FullWidth="true"
|
Variant="Variant.Text"
|
||||||
T="string?"
|
@bind-Value="Filter.Citta"
|
||||||
Variant="Variant.Text"
|
DebounceInterval="500"/>
|
||||||
@bind-Value="Filter.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>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="divider"></div>
|
<div class="divider"></div>
|
||||||
|
|
||||||
<div class="form-container">
|
<div class="form-container">
|
||||||
<span class="disable-full-width">Esito</span>
|
<MudTextField T="string?"
|
||||||
|
Placeholder="Provincia"
|
||||||
<MudSelectExtended FullWidth="true"
|
Variant="Variant.Text"
|
||||||
T="string?"
|
@bind-Value="Filter.Prov"
|
||||||
Variant="Variant.Text"
|
DebounceInterval="500"/>
|
||||||
@bind-Value="Filter.Result"
|
|
||||||
Class="customIcon-select"
|
|
||||||
AdornmentIcon="@Icons.Material.Filled.Code">
|
|
||||||
@foreach (var result in ActivityResult)
|
|
||||||
{
|
|
||||||
<MudSelectItemExtended Class="custom-item-select" Value="@result.ActivityResultId">@result.ActivityResultId</MudSelectItemExtended>
|
|
||||||
}
|
|
||||||
</MudSelectExtended>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="divider"></div>
|
<div class="divider"></div>
|
||||||
|
|
||||||
<div class="form-container">
|
<div class="form-container">
|
||||||
<span class="disable-full-width">Categoria</span>
|
<MudTextField T="string?"
|
||||||
|
Placeholder="Nazione"
|
||||||
<MudSelectExtended FullWidth="true"
|
Variant="Variant.Text"
|
||||||
T="ActivityCategoryEnum?"
|
@bind-Value="Filter.Nazione"
|
||||||
Variant="Variant.Text"
|
DebounceInterval="500"/>
|
||||||
@bind-Value="Filter.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>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="button-section">
|
<div class="button-section">
|
||||||
<MudButton OnClick="() => Filter = new FilterActivityDTO()" Variant="Variant.Outlined" Color="Color.Error">Pulisci</MudButton>
|
<MudButton OnClick="() => Filter = new FilterUserDTO()" Variant="Variant.Outlined" Color="Color.Error">Pulisci</MudButton>
|
||||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="OnFilterButton">Filtra</MudButton>
|
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="OnFilterButton">Filtra</MudButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -107,13 +99,10 @@
|
|||||||
[Parameter] public bool IsSheetVisible { get; set; }
|
[Parameter] public bool IsSheetVisible { get; set; }
|
||||||
[Parameter] public EventCallback<bool> IsSheetVisibleChanged { get; set; }
|
[Parameter] public EventCallback<bool> IsSheetVisibleChanged { get; set; }
|
||||||
|
|
||||||
[Parameter] public FilterActivityDTO Filter { get; set; }
|
[Parameter] public FilterUserDTO Filter { get; set; }
|
||||||
[Parameter] public EventCallback<FilterActivityDTO> FilterChanged { get; set; }
|
[Parameter] public EventCallback<FilterUserDTO> FilterChanged { get; set; }
|
||||||
|
|
||||||
private List<StbActivityResult> ActivityResult { get; set; } = [];
|
|
||||||
private List<StbActivityType> ActivityType { get; set; } = [];
|
|
||||||
private List<StbUser> Users { get; set; } = [];
|
private List<StbUser> Users { get; set; } = [];
|
||||||
private List<ActivityCategoryEnum> CategoryList { get; set; } = [];
|
|
||||||
|
|
||||||
protected override async Task OnParametersSetAsync()
|
protected override async Task OnParametersSetAsync()
|
||||||
{
|
{
|
||||||
@@ -121,19 +110,14 @@
|
|||||||
await LoadData();
|
await LoadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetMultiSelectionUser(List<string> selectedValues)
|
|
||||||
{
|
|
||||||
return $"{selectedValues.Count} Utent{(selectedValues.Count != 1 ? "i selezionati" : "e selezionato")}";
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task LoadData()
|
private async Task LoadData()
|
||||||
{
|
{
|
||||||
Users = await manageData.GetTable<StbUser>();
|
Users = await manageData.GetTable<StbUser>(x => x.KeyGroup == 5);
|
||||||
ActivityResult = await manageData.GetTable<StbActivityResult>();
|
}
|
||||||
ActivityType = await manageData.GetTable<StbActivityType>(x => x.FlagTipologia.Equals("A"));
|
|
||||||
CategoryList = ActivityCategoryHelper.AllActivityCategory;
|
|
||||||
|
|
||||||
StateHasChanged();
|
private string GetMultiSelectionAgente(List<string> selectedValues)
|
||||||
|
{
|
||||||
|
return $"{selectedValues.Count} Agent{(selectedValues.Count != 1 ? "i selezionati" : "e selezionato")}";
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CloseBottomSheet()
|
private void CloseBottomSheet()
|
||||||
@@ -148,4 +132,24 @@
|
|||||||
CloseBottomSheet();
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
@using salesbook.Shared.Core.Entity
|
||||||
|
|
||||||
|
<div style="margin-top: 1rem;" class="activity-card">
|
||||||
|
<div class="activity-left-section">
|
||||||
|
<div class="activity-body-section">
|
||||||
|
<div class="title-section">
|
||||||
|
<MudText Class="activity-title" Typo="Typo.body1" HtmlTag="h3">@Commessa.Descrizione</MudText>
|
||||||
|
<div class="activity-hours-section">
|
||||||
|
<span class="activity-hours">
|
||||||
|
@Commessa.CodJcom
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="activity-info-section">
|
||||||
|
<MudChip T="string" Icon="@IconConstants.Chip.User" Size="Size.Small">Stato</MudChip>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
[Parameter] public JtbComt Commessa { get; set; } = new();
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
.activity-card {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: .5rem .5rem;
|
||||||
|
border-radius: 12px;
|
||||||
|
line-height: normal;
|
||||||
|
box-shadow: var(--custom-box-shadow);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-card.memo { border-left: 5px solid var(--mud-palette-info-darken); }
|
||||||
|
|
||||||
|
.activity-card.interna { border-left: 5px solid var(--mud-palette-success-darken); }
|
||||||
|
|
||||||
|
.activity-card.commessa { border-left: 5px solid var(--mud-palette-warning); }
|
||||||
|
|
||||||
|
.activity-left-section {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-left: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-section {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-hours {
|
||||||
|
font-weight: 700;
|
||||||
|
color: var(--mud-palette-text-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-hours-section ::deep .mud-chip { margin: 5px 0 0 !important; }
|
||||||
|
|
||||||
|
.activity-body-section {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-section ::deep > .activity-title {
|
||||||
|
font-weight: 800 !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
line-height: normal !important;
|
||||||
|
color: var(--mud-palette-text-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-body-section ::deep > .activity-subtitle {
|
||||||
|
color: var(--mud-palette-gray-darker);
|
||||||
|
margin: .2rem 0 !important;
|
||||||
|
line-height: normal !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-info-section {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
@@ -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">
|
<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="contact-body-section">
|
||||||
<div class="title-section">
|
<div class="title-section">
|
||||||
@@ -18,15 +19,25 @@
|
|||||||
<div class="contact-right-section">
|
<div class="contact-right-section">
|
||||||
@if (!Contact.NumCellulare.IsNullOrEmpty())
|
@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()){
|
@if (!Contact.EMail.IsNullOrEmpty())
|
||||||
<MudIcon Color="Color.Info" Size="Size.Large" Icon="@Icons.Material.Filled.MailOutline" />
|
{
|
||||||
|
<a href="@($"mailto:{Contact.EMail}")">
|
||||||
|
<MudIcon Color="Color.Info" Size="Size.Large" Icon="@Icons.Material.Filled.MailOutline"/>
|
||||||
|
</a>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@code {
|
@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.Entity
|
||||||
@using salesbook.Shared.Core.Interface
|
@using salesbook.Shared.Core.Interface
|
||||||
@inject IManageDataService ManageData
|
@inject IManageDataService ManageData
|
||||||
@@ -6,7 +7,7 @@
|
|||||||
<div class="user-card-left-section">
|
<div class="user-card-left-section">
|
||||||
<div class="user-card-body-section">
|
<div class="user-card-body-section">
|
||||||
<div class="title-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-right-section">
|
||||||
<div class="user-card-title">
|
<div class="user-card-title">
|
||||||
@@ -47,14 +48,14 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
[Parameter] public AnagClie User { get; set; } = new();
|
[Parameter] public ContactDTO User { get; set; } = new();
|
||||||
|
|
||||||
private List<JtbComt>? Commesse { get; set; }
|
private List<JtbComt>? Commesse { get; set; }
|
||||||
private bool IsLoading { get; set; } = true;
|
private bool IsLoading { get; set; } = true;
|
||||||
private bool ShowSectionCommesse { get; set; }
|
private bool ShowSectionCommesse { get; set; }
|
||||||
|
|
||||||
private void OpenUser() =>
|
private void OpenUser() =>
|
||||||
NavigationManager.NavigateTo($"/User/{User.CodAnag}");
|
NavigationManager.NavigateTo($"/User/{User.CodContact}/{User.IsContact}");
|
||||||
|
|
||||||
private async Task ShowCommesse()
|
private async Task ShowCommesse()
|
||||||
{
|
{
|
||||||
@@ -62,7 +63,7 @@
|
|||||||
|
|
||||||
if (ShowSectionCommesse)
|
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;
|
IsLoading = false;
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -149,17 +149,31 @@
|
|||||||
</MessageContent>
|
</MessageContent>
|
||||||
<YesButton>
|
<YesButton>
|
||||||
<MudButton Size="Size.Small" Variant="Variant.Filled" Color="Color.Error"
|
<MudButton Size="Size.Small" Variant="Variant.Filled" Color="Color.Error"
|
||||||
StartIcon="@Icons.Material.Filled.DeleteForever">
|
StartIcon="@Icons.Material.Rounded.Check">
|
||||||
Cancella
|
Cancella
|
||||||
</MudButton>
|
</MudButton>
|
||||||
</YesButton>
|
</YesButton>
|
||||||
</MudMessageBox>
|
</MudMessageBox>
|
||||||
|
|
||||||
|
<MudMessageBox @ref="ConfirmMemo" Class="c-messageBox" Title="Attenzione!" CancelText="Annulla">
|
||||||
|
<MessageContent>
|
||||||
|
Vuoi creare un promemoria?
|
||||||
|
</MessageContent>
|
||||||
|
<YesButton>
|
||||||
|
<MudButton Size="Size.Small" Variant="Variant.Filled" Color="Color.Primary"
|
||||||
|
StartIcon="@Icons.Material.Rounded.DeleteForever">
|
||||||
|
Crea
|
||||||
|
</MudButton>
|
||||||
|
</YesButton>
|
||||||
|
</MudMessageBox>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</MudDialog>
|
</MudDialog>
|
||||||
|
|
||||||
<SaveOverlay VisibleOverlay="VisibleOverlay" SuccessAnimation="SuccessAnimation"/>
|
<SaveOverlay VisibleOverlay="VisibleOverlay" SuccessAnimation="SuccessAnimation"/>
|
||||||
|
|
||||||
<SelectEsito @bind-IsSheetVisible="OpenEsito" @bind-ActivityModel="ActivityModel" @bind-ActivityModel:after="OnAfterChangeValue"/>
|
<SelectEsito @bind-IsSheetVisible="OpenEsito" @bind-ActivityModel="ActivityModel" @bind-ActivityModel:after="OnAfterChangeEsito"/>
|
||||||
|
|
||||||
|
<AddMemo @bind-IsSheetVisible="OpenAddMemo" />
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
[CascadingParameter] private IMudDialogInstance MudDialog { get; set; }
|
[CascadingParameter] private IMudDialogInstance MudDialog { get; set; }
|
||||||
@@ -186,12 +200,17 @@
|
|||||||
private bool VisibleOverlay { get; set; }
|
private bool VisibleOverlay { get; set; }
|
||||||
private bool SuccessAnimation { get; set; }
|
private bool SuccessAnimation { get; set; }
|
||||||
|
|
||||||
private bool OpenEsito { get; set; } = false;
|
private bool OpenEsito { get; set; }
|
||||||
|
private bool OpenAddMemo { get; set; }
|
||||||
|
|
||||||
|
//MessageBox
|
||||||
private MudMessageBox ConfirmDelete { get; set; }
|
private MudMessageBox ConfirmDelete { get; set; }
|
||||||
|
private MudMessageBox ConfirmMemo { get; set; }
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
|
Snackbar.Configuration.PositionClass = Defaults.Classes.Position.TopCenter;
|
||||||
|
|
||||||
_ = LoadData();
|
_ = LoadData();
|
||||||
|
|
||||||
LabelSave = IsNew ? "Aggiungi" : null;
|
LabelSave = IsNew ? "Aggiungi" : null;
|
||||||
@@ -243,7 +262,6 @@
|
|||||||
private bool CheckPreSave()
|
private bool CheckPreSave()
|
||||||
{
|
{
|
||||||
Snackbar.Clear();
|
Snackbar.Clear();
|
||||||
Snackbar.Configuration.PositionClass = Defaults.Classes.Position.TopCenter;
|
|
||||||
|
|
||||||
if (!ActivityModel.ActivityTypeId.IsNullOrEmpty()) return true;
|
if (!ActivityModel.ActivityTypeId.IsNullOrEmpty()) return true;
|
||||||
Snackbar.Add("Tipo attività obbligatorio!", Severity.Error);
|
Snackbar.Add("Tipo attività obbligatorio!", Severity.Error);
|
||||||
@@ -317,9 +335,23 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task OnAfterChangeEsito()
|
||||||
|
{
|
||||||
|
OnAfterChangeValue();
|
||||||
|
|
||||||
|
var result = await ConfirmMemo.ShowAsync();
|
||||||
|
|
||||||
|
if (result is true)
|
||||||
|
OpenAddMemo = !OpenAddMemo;
|
||||||
|
}
|
||||||
|
|
||||||
private void OpenSelectEsito()
|
private void OpenSelectEsito()
|
||||||
{
|
{
|
||||||
if (!IsNew && (ActivityModel.UserName is null || !ActivityModel.UserName.Equals(UserSession.User.Username))) return;
|
if (!IsNew && (ActivityModel.UserName is null || !ActivityModel.UserName.Equals(UserSession.User.Username)))
|
||||||
|
{
|
||||||
|
Snackbar.Add("Non puoi inserire un esito per un'attività che non ti è stata assegnata.", Severity.Info);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
OpenEsito = !OpenEsito;
|
OpenEsito = !OpenEsito;
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
@@ -1,6 +1,3 @@
|
|||||||
@using salesbook.Shared.Core.Services
|
|
||||||
@inject AppAuthenticationStateProvider AuthenticationStateProvider
|
|
||||||
|
|
||||||
<div class="container container-modal">
|
<div class="container container-modal">
|
||||||
<div class="c-modal">
|
<div class="c-modal">
|
||||||
<div class="exception-header mb-2">
|
<div class="exception-header mb-2">
|
||||||
@@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
13
salesbook.Shared/Core/Dto/FilterUserDTO.cs
Normal file
13
salesbook.Shared/Core/Dto/FilterUserDTO.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
namespace salesbook.Shared.Core.Dto;
|
||||||
|
|
||||||
|
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")]
|
[JsonPropertyName("stbUsers")]
|
||||||
public List<StbUser>? StbUsers { get; set; }
|
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")]
|
[Column("full_name"), JsonPropertyName("fullName")]
|
||||||
public string FullName { get; set; }
|
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()
|
public MappingProfile()
|
||||||
{
|
{
|
||||||
CreateMap<StbActivity, ActivityDTO>();
|
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;
|
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 DeleteActivity(string activityId);
|
||||||
|
|
||||||
Task<List<StbActivity>?> SaveActivity(ActivityDTO activity);
|
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
|
public interface IManageDataService
|
||||||
{
|
{
|
||||||
Task<List<T>> GetTable<T>(Expression<Func<T, bool>>? whereCond = null) where T : new();
|
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<ActivityDTO>> GetActivity(Expression<Func<StbActivity, bool>>? whereCond = null);
|
||||||
|
Task<List<ContactDTO>> GetContact();
|
||||||
|
|
||||||
Task InsertOrUpdate<T>(T objectToSave);
|
Task InsertOrUpdate<T>(T objectToSave);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
namespace salesbook.Shared.Core.Interface;
|
|
||||||
|
|
||||||
public interface INavigationService
|
|
||||||
{
|
|
||||||
Task NavigateToDetailsAsync();
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
namespace salesbook.Shared.Core.Interface;
|
|
||||||
|
|
||||||
public interface IPageTitleService
|
|
||||||
{
|
|
||||||
void SetTitle(string title);
|
|
||||||
}
|
|
||||||
@@ -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 IntegryApiClient.Core.Domain.RestClient.Contacts;
|
||||||
using salesbook.Shared.Core.Dto;
|
using salesbook.Shared.Core.Dto;
|
||||||
using salesbook.Shared.Core.Entity;
|
using salesbook.Shared.Core.Entity;
|
||||||
@@ -67,4 +68,10 @@ public class IntegryApiService(IIntegryApiRestClient integryApiRestClient, IUser
|
|||||||
|
|
||||||
public Task<List<StbActivity>?> SaveActivity(ActivityDTO activity) =>
|
public Task<List<StbActivity>?> SaveActivity(ActivityDTO activity) =>
|
||||||
integryApiRestClient.AuthorizedPost<List<StbActivity>?>("crm/saveActivity", 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)!;
|
||||||
}
|
}
|
||||||
@@ -1,32 +1,41 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net9.0</TargetFramework>
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
<SupportedPlatform Include="browser" />
|
<IsAotCompatible>True</IsAotCompatible>
|
||||||
</ItemGroup>
|
<RunAOTCompilation>true</RunAOTCompilation>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||||
<PackageReference Include="AutoMapper" Version="14.0.0" />
|
<IsAotCompatible>True</IsAotCompatible>
|
||||||
<PackageReference Include="CodeBeam.MudBlazor.Extensions" Version="8.2.2" />
|
<RunAOTCompilation>true</RunAOTCompilation>
|
||||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
|
</PropertyGroup>
|
||||||
<PackageReference Include="IntegryApiClient.Core" Version="1.1.4" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.5" />
|
|
||||||
<PackageReference Include="Microsoft.Maui.Controls.Core" Version="9.0.70" />
|
|
||||||
<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
|
|
||||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.11.0" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="9.0.5" />
|
|
||||||
<PackageReference Include="MudBlazor" Version="8.6.0" />
|
|
||||||
<PackageReference Include="MudBlazor.ThemeManager" Version="3.0.0" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="wwwroot\css\lineicons\" />
|
<SupportedPlatform Include="browser" />
|
||||||
<Folder Include="wwwroot\js\bootstrap\" />
|
</ItemGroup>
|
||||||
</ItemGroup>
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="AutoMapper" Version="14.0.0" />
|
||||||
|
<PackageReference Include="CodeBeam.MudBlazor.Extensions" Version="8.2.2" />
|
||||||
|
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
|
||||||
|
<PackageReference Include="IntegryApiClient.Core" Version="1.1.6" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.6" />
|
||||||
|
<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
|
||||||
|
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.12.1" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="9.0.6" />
|
||||||
|
<PackageReference Include="MudBlazor" Version="8.6.0" />
|
||||||
|
<PackageReference Include="MudBlazor.ThemeManager" Version="3.0.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="wwwroot\css\lineicons\" />
|
||||||
|
<Folder Include="wwwroot\js\bootstrap\" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
@@ -41,20 +41,23 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.form-container > span {
|
.form-container > span {
|
||||||
font-weight: 600;
|
font-weight: 700;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
margin-right: .3rem;
|
margin-right: .3rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-container > .warning-text {
|
.form-container > .warning-text {
|
||||||
font-weight: 500;
|
font-weight: 700;
|
||||||
color: var(--mud-palette-gray-darker);
|
color: var(--mud-palette-gray-darker);
|
||||||
width: unset;
|
width: unset;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.form-container > .disable-full-width { width: unset !important; }
|
.form-container > .disable-full-width {
|
||||||
|
width: unset !important;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
.dateTime-picker {
|
.dateTime-picker {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -17,6 +17,11 @@ public class ManageDataService : IManageDataService
|
|||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Task<List<ContactDTO>> GetContact()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
public Task InsertOrUpdate<T>(T objectToSave)
|
public Task InsertOrUpdate<T>(T objectToSave)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ builder.Services.AddScoped<IManageDataService, ManageDataService>();
|
|||||||
builder.Services.AddScoped<AppAuthenticationStateProvider>();
|
builder.Services.AddScoped<AppAuthenticationStateProvider>();
|
||||||
builder.Services.AddScoped<AuthenticationStateProvider>(provider => provider.GetRequiredService<AppAuthenticationStateProvider>());
|
builder.Services.AddScoped<AuthenticationStateProvider>(provider => provider.GetRequiredService<AppAuthenticationStateProvider>());
|
||||||
|
|
||||||
builder.Services.UseLoginAzienda("f0484398-1f8b-42f5-ab79-5282c164e1d8");
|
const string appToken = "f0484398-1f8b-42f5-ab79-5282c164e1d8";
|
||||||
|
builder.Services.UseIntegry(appToken: appToken, useLoginAzienda: true);
|
||||||
|
|
||||||
builder.RootComponents.Add<Routes>("#app");
|
builder.RootComponents.Add<Routes>("#app");
|
||||||
builder.RootComponents.Add<HeadOutlet>("head::after");
|
builder.RootComponents.Add<HeadOutlet>("head::after");
|
||||||
|
|||||||
@@ -16,10 +16,10 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="IntegryApiClient.Blazor" Version="1.1.4" />
|
<PackageReference Include="IntegryApiClient.Blazor" Version="1.1.6" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.5" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.6" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.5" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.6" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.5" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.6" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user