Compare commits
13 Commits
85f19acda6
...
v2.0.0(6)
| Author | SHA1 | Date | |
|---|---|---|---|
| 149eb27628 | |||
| 8b331d5824 | |||
| 31db52d0d7 | |||
| ce56e9e57d | |||
| c61093a942 | |||
| 4645b2660e | |||
| 06bda7c881 | |||
| 8a45bffebc | |||
| e9a0ffdb7a | |||
| 83264731f3 | |||
| 0f3047a2b6 | |||
| 223e74c490 | |||
| b798b01da0 |
@@ -1,20 +1,15 @@
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
|
||||
namespace salesbook.Maui
|
||||
{
|
||||
public partial class App : Application
|
||||
{
|
||||
private readonly IMessenger _messenger;
|
||||
|
||||
public App(IMessenger messenger)
|
||||
public App()
|
||||
{
|
||||
InitializeComponent();
|
||||
_messenger = messenger;
|
||||
}
|
||||
|
||||
protected override Window CreateWindow(IActivationState? activationState)
|
||||
{
|
||||
return new Window(new MainPage(_messenger));
|
||||
return new Window(new MainPage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,20 +5,49 @@ namespace salesbook.Maui.Core.Services;
|
||||
|
||||
public class AttachedService : IAttachedService
|
||||
{
|
||||
public async Task<AttachedDTO?> SelectImage()
|
||||
public async Task<AttachedDTO?> SelectImageFromCamera()
|
||||
{
|
||||
var perm = await Permissions.RequestAsync<Permissions.Photos>();
|
||||
if (perm != PermissionStatus.Granted) return null;
|
||||
var cameraPerm = await Permissions.RequestAsync<Permissions.Camera>();
|
||||
if (cameraPerm != PermissionStatus.Granted)
|
||||
return null;
|
||||
|
||||
var result = await FilePicker.PickAsync(new PickOptions
|
||||
FileResult? result = null;
|
||||
|
||||
try
|
||||
{
|
||||
PickerTitle = "Scegli un'immagine",
|
||||
FileTypes = FilePickerFileType.Images
|
||||
});
|
||||
result = await MediaPicker.Default.CapturePhotoAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Errore cattura foto: {ex.Message}");
|
||||
return null;
|
||||
}
|
||||
|
||||
return result is null ? null : await ConvertToDto(result, AttachedDTO.TypeAttached.Image);
|
||||
}
|
||||
|
||||
public async Task<AttachedDTO?> SelectImageFromGallery()
|
||||
{
|
||||
var storagePerm = await Permissions.RequestAsync<Permissions.StorageRead>();
|
||||
if (storagePerm != PermissionStatus.Granted)
|
||||
return null;
|
||||
|
||||
FileResult? result = null;
|
||||
|
||||
try
|
||||
{
|
||||
result = await MediaPicker.Default.PickPhotoAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Errore selezione galleria: {ex.Message}");
|
||||
return null;
|
||||
}
|
||||
|
||||
return result is null ? null : await ConvertToDto(result, AttachedDTO.TypeAttached.Image);
|
||||
}
|
||||
|
||||
|
||||
public async Task<AttachedDTO?> SelectFile()
|
||||
{
|
||||
var perm = await Permissions.RequestAsync<Permissions.StorageRead>();
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
using AutoMapper;
|
||||
using MudBlazor.Extensions;
|
||||
using IntegryApiClient.Core.Domain.Abstraction.Contracts.Storage;
|
||||
using salesbook.Shared.Core.Dto;
|
||||
using salesbook.Shared.Core.Dto.Activity;
|
||||
using salesbook.Shared.Core.Dto.Contact;
|
||||
using salesbook.Shared.Core.Entity;
|
||||
using salesbook.Shared.Core.Helpers;
|
||||
using salesbook.Shared.Core.Helpers.Enum;
|
||||
using salesbook.Shared.Core.Interface;
|
||||
using salesbook.Shared.Core.Interface.IntegryApi;
|
||||
using salesbook.Shared.Core.Interface.System.Network;
|
||||
using Sentry.Protocol;
|
||||
using System.Linq.Expressions;
|
||||
using salesbook.Shared.Core.Dto.PageState;
|
||||
|
||||
namespace salesbook.Maui.Core.Services;
|
||||
|
||||
public class ManageDataService(
|
||||
LocalDbService localDb,
|
||||
IMapper mapper,
|
||||
UserListState userListState,
|
||||
IIntegryApiService integryApiService,
|
||||
INetworkService networkService
|
||||
) : IManageDataService
|
||||
@@ -85,7 +87,7 @@ public class ManageDataService(
|
||||
return prospect;
|
||||
}
|
||||
|
||||
public async Task<List<ContactDTO>> GetContact(WhereCondContact? whereCond)
|
||||
public async Task<List<ContactDTO>> GetContact(WhereCondContact? whereCond, DateTime? lastSync)
|
||||
{
|
||||
List<AnagClie>? contactList;
|
||||
List<PtbPros>? prospectList;
|
||||
@@ -93,26 +95,37 @@ public class ManageDataService(
|
||||
|
||||
if (networkService.ConnectionAvailable)
|
||||
{
|
||||
var response = new UsersSyncResponseDTO();
|
||||
|
||||
var clienti = await integryApiService.RetrieveAnagClie(
|
||||
new CRMAnagRequestDTO
|
||||
{
|
||||
CodAnag = whereCond.CodAnag,
|
||||
FlagStato = whereCond.FlagStato,
|
||||
PartIva = whereCond.PartIva,
|
||||
ReturnPersRif = !whereCond.OnlyContact
|
||||
ReturnPersRif = !whereCond.OnlyContact,
|
||||
FilterDate = lastSync
|
||||
}
|
||||
);
|
||||
_ = UpdateDbUsers(clienti);
|
||||
|
||||
response.AnagClie = clienti.AnagClie;
|
||||
response.VtbDest = clienti.VtbDest;
|
||||
response.VtbCliePersRif = clienti.VtbCliePersRif;
|
||||
|
||||
var prospect = await integryApiService.RetrieveProspect(
|
||||
new CRMProspectRequestDTO
|
||||
{
|
||||
CodPpro = whereCond.CodAnag,
|
||||
PartIva = whereCond.PartIva,
|
||||
ReturnPersRif = !whereCond.OnlyContact
|
||||
ReturnPersRif = !whereCond.OnlyContact,
|
||||
FilterDate = lastSync
|
||||
}
|
||||
);
|
||||
_ = UpdateDbUsers(prospect);
|
||||
|
||||
response.PtbPros = prospect.PtbPros;
|
||||
response.PtbProsRif = prospect.PtbProsRif;
|
||||
|
||||
_ = UpdateDbUsers(response);
|
||||
|
||||
contactList = clienti.AnagClie;
|
||||
prospectList = prospect.PtbPros;
|
||||
@@ -159,6 +172,35 @@ public class ManageDataService(
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<List<ActivityDTO>> GetActivityTryLocalDb(WhereCondActivity whereCond)
|
||||
{
|
||||
List<StbActivity>? activities;
|
||||
|
||||
activities = await localDb.Get<StbActivity>(x =>
|
||||
(whereCond.ActivityId != null && x.ActivityId != null && whereCond.ActivityId.Equals(x.ActivityId)) ||
|
||||
(whereCond.Start != null && whereCond.End != null && x.EffectiveDate == null &&
|
||||
x.EstimatedDate >= whereCond.Start && x.EstimatedDate <= whereCond.End) ||
|
||||
(x.EffectiveDate >= whereCond.Start && x.EffectiveDate <= whereCond.End) ||
|
||||
(whereCond.ActivityId == null && (whereCond.Start == null || whereCond.End == null))
|
||||
);
|
||||
|
||||
if (activities.IsNullOrEmpty() && networkService.ConnectionAvailable)
|
||||
{
|
||||
activities = await integryApiService.RetrieveActivity(
|
||||
new CRMRetrieveActivityRequestDTO
|
||||
{
|
||||
StarDate = whereCond.Start,
|
||||
EndDate = whereCond.End,
|
||||
ActivityId = whereCond.ActivityId
|
||||
}
|
||||
);
|
||||
|
||||
_ = UpdateDb(activities);
|
||||
}
|
||||
|
||||
return await MapActivity(activities);
|
||||
}
|
||||
|
||||
public async Task<List<ActivityDTO>> GetActivity(WhereCondActivity whereCond, bool useLocalDb)
|
||||
{
|
||||
List<StbActivity>? activities;
|
||||
@@ -187,6 +229,11 @@ public class ManageDataService(
|
||||
);
|
||||
}
|
||||
|
||||
return await MapActivity(activities);
|
||||
}
|
||||
|
||||
public async Task<List<ActivityDTO>> MapActivity(List<StbActivity>? activities)
|
||||
{
|
||||
if (activities == null) return [];
|
||||
|
||||
var codJcomList = activities
|
||||
@@ -195,17 +242,20 @@ public class ManageDataService(
|
||||
.Distinct().ToList();
|
||||
|
||||
var jtbComtList = await localDb.Get<JtbComt>(x => codJcomList.Contains(x.CodJcom));
|
||||
var commesseDict = jtbComtList.ToDictionary(x => x.CodJcom, x => x.Descrizione);
|
||||
|
||||
var codAnagList = activities
|
||||
.Select(x => x.CodAnag)
|
||||
.Where(x => !string.IsNullOrEmpty(x))
|
||||
.Distinct().ToList();
|
||||
var clientList = await localDb.Get<AnagClie>(x => codAnagList.Contains(x.CodAnag));
|
||||
var distinctClient = clientList.ToDictionary(x => x.CodAnag, x => x.RagSoc);
|
||||
|
||||
var prospectList = await localDb.Get<PtbPros>(x => codAnagList.Contains(x.CodPpro));
|
||||
var distinctProspect = prospectList.ToDictionary(x => x.CodPpro, x => x.RagSoc);
|
||||
IDictionary<string, string?>? distinctUser = null;
|
||||
|
||||
if (userListState.AllUsers != null)
|
||||
{
|
||||
distinctUser = userListState.AllUsers
|
||||
.Where(x => codAnagList.Contains(x.CodContact))
|
||||
.ToDictionary(x => x.CodContact, x => x.RagSoc);
|
||||
}
|
||||
|
||||
var returnDto = activities
|
||||
.Select(activity =>
|
||||
@@ -234,16 +284,14 @@ public class ManageDataService(
|
||||
{
|
||||
string? ragSoc;
|
||||
|
||||
if (distinctClient.TryGetValue(activity.CodAnag, out ragSoc) ||
|
||||
distinctProspect.TryGetValue(activity.CodAnag, out ragSoc))
|
||||
if (distinctUser != null && (distinctUser.TryGetValue(activity.CodAnag, out ragSoc) ||
|
||||
distinctUser.TryGetValue(activity.CodAnag, out ragSoc)))
|
||||
{
|
||||
dto.Cliente = ragSoc;
|
||||
}
|
||||
}
|
||||
|
||||
dto.Commessa = activity.CodJcom != null && commesseDict.TryGetValue(activity.CodJcom, out var descr)
|
||||
? descr
|
||||
: null;
|
||||
dto.Commessa = jtbComtList.Find(x => x.CodJcom.Equals(dto.CodJcom));
|
||||
return dto;
|
||||
})
|
||||
.ToList();
|
||||
@@ -287,6 +335,26 @@ public class ManageDataService(
|
||||
public Task InsertOrUpdate<T>(T objectToSave) =>
|
||||
localDb.InsertOrUpdate<T>([objectToSave]);
|
||||
|
||||
public async Task DeleteProspect(string codPpro)
|
||||
{
|
||||
var persRifList = await GetTable<PtbProsRif>(x => x.CodPpro!.Equals(codPpro));
|
||||
|
||||
if (!persRifList.IsNullOrEmpty())
|
||||
{
|
||||
foreach (var persRif in persRifList)
|
||||
{
|
||||
await localDb.Delete(persRif);
|
||||
}
|
||||
}
|
||||
|
||||
var ptbPros = (await GetTable<PtbPros>(x => x.CodPpro!.Equals(codPpro))).FirstOrDefault();
|
||||
|
||||
if (ptbPros != null)
|
||||
{
|
||||
await localDb.Delete(ptbPros);
|
||||
}
|
||||
}
|
||||
|
||||
public Task Delete<T>(T objectToDelete) =>
|
||||
localDb.Delete(objectToDelete);
|
||||
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using salesbook.Shared.Core.Dto;
|
||||
using salesbook.Shared.Core.Entity;
|
||||
using salesbook.Shared.Core.Helpers;
|
||||
using salesbook.Shared.Core.Interface.IntegryApi;
|
||||
using salesbook.Shared.Core.Messages.Notification;
|
||||
using salesbook.Shared.Core.Messages.Notification.NewPush;
|
||||
using Shiny.Push;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace salesbook.Maui.Core.System.Notification.Push;
|
||||
|
||||
@@ -20,10 +23,25 @@ public class PushNotificationDelegate(
|
||||
public Task OnReceived(PushNotification notification)
|
||||
{
|
||||
if (notification.Notification is null) return Task.CompletedTask;
|
||||
var data = notification.Data;
|
||||
|
||||
NotificationDataDTO? notificationDataDto = null;
|
||||
|
||||
if (!data.IsNullOrEmpty())
|
||||
{
|
||||
var json = JsonSerializer.Serialize(data);
|
||||
notificationDataDto = JsonSerializer.Deserialize<NotificationDataDTO>(json);
|
||||
}
|
||||
|
||||
if (notificationDataDto?.NotificationId == null) return Task.CompletedTask;
|
||||
var notificationId = long.Parse(notificationDataDto.NotificationId);
|
||||
|
||||
var pushNotification = new WtbNotification
|
||||
{
|
||||
Id = notificationId,
|
||||
Title = notification.Notification.Title,
|
||||
Body = notification.Notification.Message
|
||||
Body = notification.Notification.Message,
|
||||
NotificationData = notificationDataDto
|
||||
};
|
||||
|
||||
messenger.Send(new NewPushNotificationMessage(pushNotification));
|
||||
|
||||
@@ -1,23 +1,10 @@
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using salesbook.Shared.Core.Messages.Back;
|
||||
|
||||
namespace salesbook.Maui
|
||||
{
|
||||
public partial class MainPage : ContentPage
|
||||
{
|
||||
private readonly IMessenger _messenger;
|
||||
|
||||
public MainPage(IMessenger messenger)
|
||||
public MainPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
_messenger = messenger;
|
||||
}
|
||||
|
||||
protected override bool OnBackButtonPressed()
|
||||
{
|
||||
_messenger.Send(new HardwareBackMessage("back"));
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,8 @@ using salesbook.Shared.Core.Messages.Activity.Copy;
|
||||
using salesbook.Shared.Core.Messages.Activity.New;
|
||||
using salesbook.Shared.Core.Messages.Back;
|
||||
using salesbook.Shared.Core.Messages.Contact;
|
||||
using salesbook.Shared.Core.Messages.Notification;
|
||||
using salesbook.Shared.Core.Messages.Notification.Loaded;
|
||||
using salesbook.Shared.Core.Messages.Notification.NewPush;
|
||||
using salesbook.Shared.Core.Services;
|
||||
using Shiny;
|
||||
|
||||
@@ -81,6 +82,7 @@ namespace salesbook.Maui
|
||||
builder.Services.AddSingleton<BackNavigationService>();
|
||||
builder.Services.AddSingleton<CopyActivityService>();
|
||||
builder.Services.AddSingleton<NewContactService>();
|
||||
builder.Services.AddSingleton<NotificationsLoadedService>();
|
||||
builder.Services.AddSingleton<NewPushNotificationService>();
|
||||
|
||||
//Notification
|
||||
@@ -90,6 +92,7 @@ namespace salesbook.Maui
|
||||
builder.Services.AddSingleton<IIntegryNotificationRestClient, IntegryNotificationRestClient>();
|
||||
builder.Services.AddSingleton<IFirebaseNotificationService, FirebaseNotificationService>();
|
||||
builder.Services.AddSingleton<IShinyNotificationManager, ShinyNotificationManager>();
|
||||
builder.Services.AddSingleton<INotificationService, NotificationService>();
|
||||
|
||||
#if DEBUG
|
||||
builder.Services.AddBlazorWebViewDeveloperTools();
|
||||
|
||||
@@ -14,7 +14,10 @@
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
||||
<uses-permission android:name="android.permission.BATTERY_STATS" />
|
||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
|
||||
@@ -39,8 +39,11 @@
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string>L'app utilizza la tua posizione per allegarla alle attività.</string>
|
||||
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>Questa app necessita di accedere alla fotocamera per scattare foto.</string>
|
||||
|
||||
<key>NSPhotoLibraryUsageDescription</key>
|
||||
<string>Consente di selezionare immagini da allegare alle attività.</string>
|
||||
<string>Questa app necessita di accedere alla libreria foto.</string>
|
||||
|
||||
<key>NSPhotoLibraryAddUsageDescription</key>
|
||||
<string>Permette all'app di salvare file o immagini nella tua libreria fotografica se necessario.</string>
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
<ApplicationId>it.integry.salesbook</ApplicationId>
|
||||
|
||||
<!-- Versions -->
|
||||
<ApplicationDisplayVersion>1.1.0</ApplicationDisplayVersion>
|
||||
<ApplicationVersion>5</ApplicationVersion>
|
||||
<ApplicationDisplayVersion>2.0.0</ApplicationDisplayVersion>
|
||||
<ApplicationVersion>6</ApplicationVersion>
|
||||
|
||||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
|
||||
<!--<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
|
||||
@@ -78,8 +78,8 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)'=='net9.0-ios'">
|
||||
<CodesignKey>Apple Distribution: Integry S.r.l. (UNP26J4R89)</CodesignKey>
|
||||
<CodesignProvision></CodesignProvision>
|
||||
<CodesignKey>Apple Development: Created via API (5B7B69P4JY)</CodesignKey>
|
||||
<CodesignProvision>VS: it.integry.salesbook Development</CodesignProvision>
|
||||
<ProvisioningType>manual</ProvisioningType>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -95,16 +95,6 @@
|
||||
<BundleResource Include="Platforms\iOS\PrivacyInfo.xcprivacy" LogicalName="PrivacyInfo.xcprivacy" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0-android'">
|
||||
<GoogleServicesJson Include="google-services.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</GoogleServicesJson>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0-ios'">
|
||||
<BundleResource Include="GoogleService-Info.plist" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
|
||||
<!-- Android App Icon -->
|
||||
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" ForegroundScale="0.65" />
|
||||
@@ -130,16 +120,26 @@
|
||||
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
|
||||
<GoogleServicesJson Include="google-services.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</GoogleServicesJson>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">
|
||||
<BundleResource Include="GoogleService-Info.plist" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommunityToolkit.Maui" Version="12.0.0" />
|
||||
<PackageReference Include="CommunityToolkit.Maui" Version="12.2.0" />
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
|
||||
<PackageReference Include="IntegryApiClient.MAUI" Version="1.2.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.6" />
|
||||
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.81" />
|
||||
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.81" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="9.0.81" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.6" />
|
||||
<PackageReference Include="Sentry.Maui" Version="5.11.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.9" />
|
||||
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.110" />
|
||||
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.110" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="9.0.110" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.9" />
|
||||
<PackageReference Include="Sentry.Maui" Version="5.15.0" />
|
||||
<PackageReference Include="Shiny.Hosting.Maui" Version="3.3.4" />
|
||||
<PackageReference Include="Shiny.Notifications" Version="3.3.4" />
|
||||
<PackageReference Include="Shiny.Push" Version="3.3.4" />
|
||||
|
||||
26
salesbook.Shared/Components/Layout/ConnectionState.razor
Normal file
26
salesbook.Shared/Components/Layout/ConnectionState.razor
Normal file
@@ -0,0 +1,26 @@
|
||||
<div class="Connection @(ShowWarning ? "Show" : "Hide") @(IsNetworkAvailable? ServicesIsDown ? "ServicesIsDown" : "SystemOk" : "NetworkKo")">
|
||||
@if (IsNetworkAvailable)
|
||||
{
|
||||
if(ServicesIsDown)
|
||||
{
|
||||
<i class="ri-cloud-off-fill"></i>
|
||||
<span>Servizi offline</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<i class="ri-cloud-fill"></i>
|
||||
<span>Online</span>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<i class="ri-wifi-off-line"></i>
|
||||
<span>Nessuna connessione</span>
|
||||
}
|
||||
</div>
|
||||
|
||||
@code{
|
||||
[Parameter] public bool IsNetworkAvailable { get; set; }
|
||||
[Parameter] public bool ServicesIsDown { get; set; }
|
||||
[Parameter] public bool ShowWarning { get; set; }
|
||||
}
|
||||
@@ -14,6 +14,8 @@
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.header-content > .title { width: 100%; }
|
||||
|
||||
.header-content.with-back .page-title {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@using System.Globalization
|
||||
@using salesbook.Shared.Core.Interface
|
||||
@using salesbook.Shared.Core.Interface.IntegryApi
|
||||
@using salesbook.Shared.Core.Interface.System.Network
|
||||
@using salesbook.Shared.Core.Messages.Back
|
||||
@@ -14,30 +13,11 @@
|
||||
<MudDialogProvider/>
|
||||
<MudSnackbarProvider/>
|
||||
|
||||
<ConnectionState IsNetworkAvailable="IsNetworkAvailable" ServicesIsDown="ServicesIsDown" ShowWarning="ShowWarning" />
|
||||
|
||||
<div class="page">
|
||||
<NavMenu/>
|
||||
|
||||
<div class="Connection @(ShowWarning ? "Show" : "Hide") @(IsNetworkAvailable? ServicesIsDown ? "ServicesIsDown" : "SystemOk" : "NetworkKo")">
|
||||
@if (IsNetworkAvailable)
|
||||
{
|
||||
if(ServicesIsDown)
|
||||
{
|
||||
<i class="ri-cloud-off-fill"></i>
|
||||
<span>Servizi offline</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<i class="ri-cloud-fill"></i>
|
||||
<span>Online</span>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<i class="ri-wifi-off-line"></i>
|
||||
<span>Nessuna connessione</span>
|
||||
}
|
||||
</div>
|
||||
|
||||
<main>
|
||||
<article>
|
||||
@Body
|
||||
@@ -51,13 +31,12 @@
|
||||
private string _mainContentClass = "";
|
||||
|
||||
//Connection state
|
||||
private bool FirstCheck { get; set; } = true;
|
||||
private bool _isNetworkAvailable;
|
||||
private bool _servicesIsDown;
|
||||
private bool _showWarning;
|
||||
|
||||
private DateTime _lastApiCheck = DateTime.MinValue;
|
||||
private const int DelaySeconds = 180;
|
||||
private const int DelaySeconds = 90;
|
||||
|
||||
private CancellationTokenSource? _cts;
|
||||
|
||||
|
||||
@@ -3,15 +3,19 @@
|
||||
@using salesbook.Shared.Core.Dto.Activity
|
||||
@using salesbook.Shared.Core.Dto.PageState
|
||||
@using salesbook.Shared.Core.Entity
|
||||
@using salesbook.Shared.Core.Interface.System.Network
|
||||
@using salesbook.Shared.Core.Messages.Activity.Copy
|
||||
@using salesbook.Shared.Core.Messages.Activity.New
|
||||
@using salesbook.Shared.Core.Messages.Contact
|
||||
@using salesbook.Shared.Core.Messages.Notification
|
||||
@using salesbook.Shared.Core.Messages.Notification.Loaded
|
||||
@using salesbook.Shared.Core.Messages.Notification.NewPush
|
||||
@inject IDialogService Dialog
|
||||
@inject IMessenger Messenger
|
||||
@inject CopyActivityService CopyActivityService
|
||||
@inject NewPushNotificationService NewPushNotificationService
|
||||
@inject NotificationState Notification
|
||||
@inject INetworkService NetworkService
|
||||
@inject NotificationsLoadedService NotificationsLoadedService
|
||||
|
||||
<div class="container animated-navbar @(IsVisible ? "show-nav" : "hide-nav") @(IsVisible ? PlusVisible ? "with-plus" : "without-plus" : "with-plus")">
|
||||
<nav class="navbar @(IsVisible ? PlusVisible ? "with-plus" : "without-plus" : "with-plus")">
|
||||
@@ -53,8 +57,8 @@
|
||||
<MudFab Class="custom-plus-button" Color="Color.Surface" Size="Size.Medium" IconSize="Size.Medium" IconColor="Color.Primary" StartIcon="@Icons.Material.Filled.Add"/>
|
||||
</ActivatorContent>
|
||||
<ChildContent>
|
||||
<MudMenuItem OnClick="() => CreateUser()">Nuovo contatto</MudMenuItem>
|
||||
<MudMenuItem OnClick="() => CreateActivity()">Nuova attivit<69></MudMenuItem>
|
||||
<MudMenuItem Disabled="!NetworkService.IsNetworkAvailable()" OnClick="() => CreateUser()">Nuovo contatto</MudMenuItem>
|
||||
<MudMenuItem Disabled="!NetworkService.IsNetworkAvailable()" OnClick="() => CreateActivity()">Nuova attivit<69></MudMenuItem>
|
||||
</ChildContent>
|
||||
</MudMenu>
|
||||
}
|
||||
@@ -68,8 +72,7 @@
|
||||
|
||||
protected override Task OnInitializedAsync()
|
||||
{
|
||||
CopyActivityService.OnCopyActivity += async dto => await CreateActivity(dto);
|
||||
NewPushNotificationService.OnNotificationReceived += NewNotificationReceived;
|
||||
InitMessage();
|
||||
|
||||
NavigationManager.LocationChanged += (_, args) =>
|
||||
{
|
||||
@@ -117,4 +120,11 @@
|
||||
Notification.ReceivedNotifications.Add(notification);
|
||||
InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
private void InitMessage()
|
||||
{
|
||||
CopyActivityService.OnCopyActivity += async dto => await CreateActivity(dto);
|
||||
NewPushNotificationService.OnNotificationReceived += NewNotificationReceived;
|
||||
NotificationsLoadedService.OnNotificationsLoaded += () => InvokeAsync(StateHasChanged);
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
.animated-navbar.show-nav { transform: translateY(0); }
|
||||
|
||||
.animated-navbar.hide-nav { transform: translateY(100%); }
|
||||
.animated-navbar.hide-nav { transform: translateY(150%); }
|
||||
|
||||
.animated-navbar.with-plus { margin-left: 30px; }
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<MudOverlay Visible="Visible" DarkBackground="false">
|
||||
<div class="overlay-container">
|
||||
<span>Caricamento</span>
|
||||
|
||||
<MudProgressLinear Color="Color.Primary" Rounded="true" Size="Size.Medium" Indeterminate="true" />
|
||||
</div>
|
||||
</MudOverlay>
|
||||
|
||||
@code
|
||||
{
|
||||
[Parameter] public bool Visible { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
.overlay-container {
|
||||
background: var(--mud-palette-background);
|
||||
width: 20rem;
|
||||
height: 6rem;
|
||||
padding: 0 1rem;
|
||||
display: flex;
|
||||
gap: .5rem;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
border-radius: 20px;
|
||||
box-shadow: var(--custom-box-shadow);
|
||||
}
|
||||
|
||||
.overlay-container > span {
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
}
|
||||
@@ -4,11 +4,13 @@
|
||||
@using salesbook.Shared.Components.SingleElements
|
||||
@using salesbook.Shared.Components.SingleElements.BottomSheet
|
||||
@using salesbook.Shared.Core.Dto.Activity
|
||||
@using salesbook.Shared.Core.Dto.PageState
|
||||
@using salesbook.Shared.Core.Interface
|
||||
@using salesbook.Shared.Core.Messages.Activity.New
|
||||
@inject IManageDataService ManageData
|
||||
@inject IJSRuntime JS
|
||||
@inject NewActivityService NewActivity
|
||||
@inject UserListState UserState
|
||||
|
||||
<HeaderLayout Title="@_headerTitle"
|
||||
ShowFilter="true"
|
||||
@@ -168,7 +170,6 @@
|
||||
<FilterActivity @bind-IsSheetVisible="OpenFilter" @bind-Filter="Filter" @bind-Filter:after="ApplyFilter"/>
|
||||
|
||||
@code {
|
||||
|
||||
// Modelli per ottimizzazione rendering
|
||||
private record DayData(DateTime Date, string CssClass, bool HasEvents, CategoryData[] EventCategories, string DayName = "");
|
||||
|
||||
@@ -221,11 +222,20 @@
|
||||
PrepareRenderingData();
|
||||
|
||||
NewActivity.OnActivityCreated += async activityId => await OnActivityCreated(activityId);
|
||||
UserState.OnUsersLoaded += async () => await InvokeAsync(LoadData);
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
if (firstRender && UserState.IsLoaded)
|
||||
{
|
||||
await LoadData();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task LoadData()
|
||||
{
|
||||
if (!_isInitialized)
|
||||
{
|
||||
Filter.User = new HashSet<string> { UserSession.User.Username };
|
||||
|
||||
|
||||
@@ -80,13 +80,12 @@
|
||||
}
|
||||
|
||||
.day {
|
||||
background: var(--mud-palette-surface);
|
||||
border-radius: 10px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
transition: background 0.3s ease, transform 0.2s ease;
|
||||
font-size: 0.95rem;
|
||||
box-shadow: var(--custom-box-shadow);
|
||||
background: var(--mud-palette-background-gray);
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
display: flex;
|
||||
@@ -94,7 +93,7 @@
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: var(--mud-palette-text-primary);
|
||||
border: 1px solid var(--mud-palette-surface);
|
||||
border: 1px solid var(--mud-palette-background-gray);
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="container content">
|
||||
<div class="container content pb-safe-area">
|
||||
@if (CommessaModel == null)
|
||||
{
|
||||
<NoDataAvailable Text="Nessuna commessa trovata"/>
|
||||
@@ -149,10 +149,9 @@ else
|
||||
await Task.Run(async () =>
|
||||
{
|
||||
var activities = await IntegryApiService.RetrieveActivity(new CRMRetrieveActivityRequestDTO { CodJcom = CodJcom });
|
||||
ActivityList = Mapper.Map<List<ActivityDTO>>(activities)
|
||||
.OrderBy(x =>
|
||||
(x.EffectiveTime ?? x.EstimatedTime) ?? x.DataInsAct
|
||||
).ToList();
|
||||
ActivityList = (await ManageData.MapActivity(activities)).OrderByDescending(x =>
|
||||
(x.EffectiveTime ?? x.EstimatedTime) ?? x.DataInsAct
|
||||
).ToList();
|
||||
});
|
||||
|
||||
ActivityIsLoading = false;
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: -webkit-fill-available;
|
||||
box-shadow: var(--custom-box-shadow);
|
||||
background: var(--light-card-background);
|
||||
border-radius: 16px;
|
||||
overflow: clip;
|
||||
margin-bottom: 1rem;
|
||||
@@ -135,7 +135,6 @@
|
||||
display: flex;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
background: var(--mud-palette-surface);
|
||||
}
|
||||
|
||||
/* la lineetta */
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
@page "/"
|
||||
@attribute [Authorize]
|
||||
@using CommunityToolkit.Mvvm.Messaging
|
||||
@using salesbook.Shared.Core.Interface
|
||||
@using salesbook.Shared.Components.Layout.Spinner
|
||||
@using salesbook.Shared.Core.Interface.System.Network
|
||||
@using salesbook.Shared.Core.Interface.System.Notification
|
||||
@using salesbook.Shared.Core.Messages.Notification.Loaded
|
||||
@using salesbook.Shared.Core.Services
|
||||
@inject IFormFactor FormFactor
|
||||
@inject INetworkService NetworkService
|
||||
@inject IFirebaseNotificationService FirebaseNotificationService
|
||||
@inject IShinyNotificationManager NotificationManager
|
||||
@inject INotificationService NotificationService
|
||||
@inject PreloadService PreloadService
|
||||
@inject IMessenger Messenger
|
||||
|
||||
<SpinnerLayout FullScreen="true" />
|
||||
|
||||
@@ -17,6 +21,9 @@
|
||||
{
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
NetworkService.ConnectionAvailable = NetworkService.IsNetworkAvailable();
|
||||
|
||||
await LoadNotification();
|
||||
await CheckAndRequestPermissions();
|
||||
|
||||
try
|
||||
@@ -40,12 +47,15 @@
|
||||
NavigationManager.NavigateTo("/Calendar");
|
||||
}
|
||||
|
||||
private async Task LoadNotification()
|
||||
{
|
||||
await NotificationService.LoadNotification();
|
||||
Messenger.Send(new NotificationsLoadedMessage());
|
||||
}
|
||||
|
||||
private async Task CheckAndRequestPermissions()
|
||||
{
|
||||
await NotificationManager.RequestAccess();
|
||||
|
||||
// if (BatteryOptimizationManagerService.IsBatteryOptimizationEnabled())
|
||||
// BatteryOptimizationManagerService.OpenBatteryOptimizationSettings(_ => { });
|
||||
}
|
||||
|
||||
private Task StartSyncUser()
|
||||
|
||||
@@ -1,20 +1,25 @@
|
||||
@page "/Notifications"
|
||||
@attribute [Authorize]
|
||||
@using CommunityToolkit.Mvvm.Messaging
|
||||
@using salesbook.Shared.Components.Layout
|
||||
@using salesbook.Shared.Components.Layout.Spinner
|
||||
@using salesbook.Shared.Components.SingleElements
|
||||
@using salesbook.Shared.Core.Dto.PageState
|
||||
@using salesbook.Shared.Core.Entity
|
||||
@using salesbook.Shared.Core.Interface
|
||||
@using salesbook.Shared.Core.Interface.IntegryApi
|
||||
@using salesbook.Shared.Core.Messages.Notification
|
||||
@using salesbook.Shared.Core.Messages.Notification.Loaded
|
||||
@using salesbook.Shared.Core.Messages.Notification.NewPush
|
||||
@inject NotificationState Notification
|
||||
@inject NewPushNotificationService NewPushNotificationService
|
||||
@inject IJSRuntime JS
|
||||
@inject IIntegryNotificationRestClient IntegryNotificationRestClient
|
||||
@inject INotificationService NotificationService
|
||||
@inject IMessenger Messenger
|
||||
|
||||
<HeaderLayout Title="Notifiche" />
|
||||
|
||||
<div class="container">
|
||||
<div class="container container-notifications">
|
||||
@if (Loading)
|
||||
{
|
||||
<SpinnerLayout FullScreen="true" />
|
||||
@@ -50,7 +55,7 @@
|
||||
|
||||
@code {
|
||||
private DotNetObjectReference<Notifications>? _objectReference;
|
||||
private bool Loading { get; set; } = true;
|
||||
private bool Loading { get; set; }
|
||||
|
||||
protected override Task OnInitializedAsync()
|
||||
{
|
||||
@@ -62,37 +67,6 @@
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
await JS.InvokeVoidAsync("initNotifications", _objectReference);
|
||||
|
||||
if (firstRender)
|
||||
{
|
||||
await LoadData();
|
||||
Loading = false;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task LoadData()
|
||||
{
|
||||
var allNotifications = await IntegryNotificationRestClient.Get();
|
||||
var allIds = allNotifications.Select(n => n.Id).ToHashSet();
|
||||
|
||||
Notification.ReceivedNotifications = Notification.ReceivedNotifications
|
||||
.Where(r => !allIds.Contains(r.Id))
|
||||
.ToList();
|
||||
|
||||
Notification.UnreadNotifications = allNotifications
|
||||
.Where(x =>
|
||||
x.WtbDeviceNotifications == null ||
|
||||
x.WtbDeviceNotifications.Any(y => y.ReadDate == null))
|
||||
.ToList();
|
||||
|
||||
Notification.NotificationsRead = allNotifications
|
||||
.Where(x =>
|
||||
x.WtbDeviceNotifications != null &&
|
||||
x.WtbDeviceNotifications.All(y => y.ReadDate != null))
|
||||
.ToList();
|
||||
|
||||
OrderNotificationList();
|
||||
}
|
||||
|
||||
private void NewNotificationReceived(WtbNotification notification)
|
||||
@@ -103,11 +77,11 @@
|
||||
[JSInvokable]
|
||||
public async Task Delete(string id)
|
||||
{
|
||||
Loading = true;
|
||||
_ = InvokeAsync(StateHasChanged);
|
||||
|
||||
if (!long.TryParse(id, out var notificationId)) return;
|
||||
|
||||
Loading = true;
|
||||
StateHasChanged();
|
||||
|
||||
var removed = false;
|
||||
|
||||
if (Notification.ReceivedNotifications.RemoveAll(x => x.Id == notificationId) > 0)
|
||||
@@ -117,23 +91,27 @@
|
||||
else if (Notification.NotificationsRead.RemoveAll(x => x.Id == notificationId) > 0)
|
||||
removed = true;
|
||||
|
||||
if (!removed) return;
|
||||
|
||||
OrderNotificationList();
|
||||
Loading = false;
|
||||
_ = InvokeAsync(StateHasChanged);
|
||||
|
||||
_ = Task.Run(() =>
|
||||
if (!removed)
|
||||
{
|
||||
_ = IntegryNotificationRestClient.Delete(notificationId);
|
||||
});
|
||||
Loading = false;
|
||||
StateHasChanged();
|
||||
return;
|
||||
}
|
||||
|
||||
await IntegryNotificationRestClient.Delete(notificationId);
|
||||
|
||||
NotificationService.OrderNotificationList();
|
||||
Loading = false;
|
||||
StateHasChanged();
|
||||
|
||||
Messenger.Send(new NotificationsLoadedMessage());
|
||||
}
|
||||
|
||||
[JSInvokable]
|
||||
public async Task MarkAsRead(string id)
|
||||
{
|
||||
Loading = true;
|
||||
_ = InvokeAsync(StateHasChanged);
|
||||
StateHasChanged();
|
||||
|
||||
var notificationId = long.Parse(id);
|
||||
|
||||
@@ -155,23 +133,12 @@
|
||||
wtbNotification = await IntegryNotificationRestClient.MarkAsRead(notificationId);
|
||||
Notification.NotificationsRead.Add(wtbNotification);
|
||||
|
||||
OrderNotificationList();
|
||||
NotificationService.OrderNotificationList();
|
||||
Messenger.Send(new NotificationsLoadedMessage());
|
||||
Loading = false;
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private void OrderNotificationList()
|
||||
{
|
||||
Notification.ReceivedNotifications = Notification.ReceivedNotifications
|
||||
.OrderByDescending(x => x.StartDate).ToList();
|
||||
|
||||
Notification.UnreadNotifications = Notification.UnreadNotifications
|
||||
.OrderByDescending(x => x.StartDate).ToList();
|
||||
|
||||
Notification.NotificationsRead = Notification.NotificationsRead
|
||||
.OrderByDescending(x => x.StartDate).ToList();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_objectReference?.Dispose();
|
||||
|
||||
@@ -1,6 +1,21 @@
|
||||
.container-notifications {
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
padding: .2rem 0 75px 0;
|
||||
}
|
||||
|
||||
.list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.container-notifications::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
.container-notifications::-webkit-scrollbar-thumb {
|
||||
background: #bbb;
|
||||
border-radius: 3px;
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
@if (IsLoggedIn)
|
||||
{
|
||||
<div class="container content">
|
||||
<div class="container content pb-safe-area">
|
||||
<div class="container-primary-info">
|
||||
<div class="section-primary-info">
|
||||
<MudAvatar Style="height: 70px; width: 70px; font-size: 2rem; font-weight: bold" Color="Color.Secondary">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.container-primary-info {
|
||||
box-shadow: var(--custom-box-shadow);
|
||||
background: var(--light-card-background);
|
||||
width: 100%;
|
||||
margin-bottom: 2rem;
|
||||
border-radius: 12px;
|
||||
|
||||
@@ -24,18 +24,18 @@
|
||||
Back="true"
|
||||
BackOnTop="true"
|
||||
Title=""
|
||||
ShowProfile="false" />
|
||||
ShowProfile="false"/>
|
||||
|
||||
@if (IsLoading)
|
||||
{
|
||||
<SpinnerLayout FullScreen="true" />
|
||||
<SpinnerLayout FullScreen="true"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="container content" style="overflow: auto;" id="topPage">
|
||||
<div class="container content pb-safe-area" style="overflow: auto;" id="topPage">
|
||||
<div class="container-primary-info">
|
||||
<div class="section-primary-info">
|
||||
<MudAvatar Style="height: 70px; width: 70px; font-size: 2rem; font-weight: bold" Color="Color.Secondary">
|
||||
<MudAvatar Style="height: 70px; width: 70px; font-size: 2rem; font-weight: bold" Variant="@(IsContact ? Variant.Filled : Variant.Outlined)" Color="Color.Secondary">
|
||||
@UtilityString.ExtractInitials(Anag.RagSoc)
|
||||
</MudAvatar>
|
||||
|
||||
@@ -55,216 +55,229 @@ else
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="section-info">
|
||||
<div class="section-personal-info">
|
||||
@if (!string.IsNullOrEmpty(Anag.Telefono))
|
||||
{
|
||||
<div>
|
||||
<span class="info-title">Telefono</span>
|
||||
<span class="info-text">@Anag.Telefono</span>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (!string.IsNullOrEmpty(Anag.PartIva))
|
||||
{
|
||||
<div>
|
||||
<span class="info-title">P. IVA</span>
|
||||
<span class="info-text">@Anag.PartIva</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="section-personal-info">
|
||||
@if (!string.IsNullOrEmpty(Anag.EMail))
|
||||
{
|
||||
<div>
|
||||
<span class="info-title">E-mail</span>
|
||||
<span class="info-text">@Anag.EMail</span>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (Agente != null)
|
||||
{
|
||||
@if (Agente != null)
|
||||
{
|
||||
<div class="section-personal-info">
|
||||
<div>
|
||||
<span class="info-title">Agente</span>
|
||||
<span class="info-text">@Agente.FullName</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (!string.IsNullOrEmpty(Anag.Telefono))
|
||||
{
|
||||
<div class="section-personal-info">
|
||||
<div>
|
||||
<span class="info-title">Telefono</span>
|
||||
<span class="info-text">@Anag.Telefono</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (!string.IsNullOrEmpty(Anag.PartIva))
|
||||
{
|
||||
<div class="section-personal-info">
|
||||
<div>
|
||||
<span class="info-title">P. IVA</span>
|
||||
<span class="info-text">@Anag.PartIva</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (!string.IsNullOrEmpty(Anag.EMail))
|
||||
{
|
||||
<div class="section-personal-info">
|
||||
<div>
|
||||
<span class="info-title">E-mail</span>
|
||||
<span class="info-text">@Anag.EMail</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-section">
|
||||
<input type="radio" class="tab-toggle" name="tab-toggle" id="tab1" checked="@(ActiveTab == 0)">
|
||||
<input type="radio" class="tab-toggle" name="tab-toggle" id="tab2" checked="@(ActiveTab == 1)">
|
||||
<input type="radio" class="tab-toggle" name="tab-toggle" id="tab3" checked="@(ActiveTab == 2)">
|
||||
|
||||
<div class="box">
|
||||
<ul class="tab-list">
|
||||
<li class="tab-item">
|
||||
<label class="tab-trigger" for="tab1" @onclick="() => SwitchTab(0)">Contatti</label>
|
||||
</li>
|
||||
<li class="tab-item">
|
||||
<label class="tab-trigger" for="tab2" @onclick="() => SwitchTab(1)">Commesse</label>
|
||||
</li>
|
||||
<li class="tab-item">
|
||||
<label class="tab-trigger" for="tab3" @onclick="() => SwitchTab(2)">Attivit<69></label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="tab-container">
|
||||
<!-- Tab Contatti -->
|
||||
<div class="tab-content" style="display: @(ActiveTab == 0 ? "block" : "none")">
|
||||
@if (PersRif?.Count > 0)
|
||||
{
|
||||
<div class="container-pers-rif">
|
||||
@foreach (var person in PersRif)
|
||||
{
|
||||
<ContactCard Contact="person"/>
|
||||
@if (person != PersRif.Last())
|
||||
{
|
||||
<div class="divider"></div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="container-button">
|
||||
<div class="divider"></div>
|
||||
|
||||
<MudButton Class="button-settings infoText"
|
||||
FullWidth="true"
|
||||
Size="Size.Medium"
|
||||
StartIcon="@Icons.Material.Rounded.Add"
|
||||
OnClick="OpenPersRifForm"
|
||||
Variant="Variant.Outlined">
|
||||
Aggiungi contatto
|
||||
</MudButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tab Commesse -->
|
||||
<div class="tab-content" style="display: @(ActiveTab == 1 ? "block" : "none")">
|
||||
@if (IsLoadingCommesse)
|
||||
{
|
||||
<MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="my-7"/>
|
||||
}
|
||||
else if (Commesse?.Count == 0)
|
||||
{
|
||||
<NoDataAvailable Text="Nessuna commessa presente"/>
|
||||
}
|
||||
else if (Commesse != null)
|
||||
{
|
||||
<!-- Filtri e ricerca -->
|
||||
<div class="input-card clearButton custom-border-bottom">
|
||||
<MudTextField T="string?"
|
||||
Placeholder="Cerca..."
|
||||
Variant="Variant.Text"
|
||||
@bind-Value="SearchTermCommesse"
|
||||
AdornmentIcon="@Icons.Material.Rounded.Search"
|
||||
Adornment="Adornment.Start"
|
||||
OnDebounceIntervalElapsed="() => ApplyFiltersCommesse()"
|
||||
DebounceInterval="500"/>
|
||||
</div>
|
||||
|
||||
<div class="commesse-container">
|
||||
@if (IsLoadingSteps)
|
||||
{
|
||||
<MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="my-3"/>
|
||||
}
|
||||
|
||||
@foreach (var commessa in CurrentPageCommesse)
|
||||
{
|
||||
<div class="commessa-wrapper" style="@(IsLoadingStep(commessa.CodJcom) ? "opacity: 0.7;" : "")">
|
||||
@if (Steps.TryGetValue(commessa.CodJcom, out var steps))
|
||||
{
|
||||
<CommessaCard Steps="@steps" RagSoc="@Anag.RagSoc" Commessa="commessa"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<CommessaCard Steps="null" RagSoc="@Anag.RagSoc" Commessa="commessa"/>
|
||||
@if (IsLoadingStep(commessa.CodJcom))
|
||||
{
|
||||
<MudProgressLinear Indeterminate="true" Color="Color.Primary" Class="my-1" Style="height: 2px;"/>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (TotalPagesCommesse > 1)
|
||||
{
|
||||
<div class="custom-pagination">
|
||||
<MudPagination BoundaryCount="1" MiddleCount="1" Count="@TotalPagesCommesse"
|
||||
@bind-Selected="SelectedPageCommesse"
|
||||
Color="Color.Primary"/>
|
||||
</div>
|
||||
|
||||
<div class="SelectedPageSize">
|
||||
<MudSelect @bind-Value="SelectedPageSizeCommesse"
|
||||
Variant="Variant.Text"
|
||||
Label="Elementi per pagina"
|
||||
Dense="true"
|
||||
Style="width: 100%;">
|
||||
<MudSelectItem Value="5">5</MudSelectItem>
|
||||
<MudSelectItem Value="10">10</MudSelectItem>
|
||||
<MudSelectItem Value="15">15</MudSelectItem>
|
||||
</MudSelect>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<!-- Tab Attivit<69> -->
|
||||
<div class="tab-content" style="display: @(ActiveTab == 2 ? "block" : "none")">
|
||||
@if (ActivityIsLoading)
|
||||
{
|
||||
<MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="my-7"/>
|
||||
}
|
||||
else if (ActivityList?.Count == 0)
|
||||
{
|
||||
<NoDataAvailable Text="Nessuna attivit<69> presente"/>
|
||||
}
|
||||
else if (ActivityList != null)
|
||||
{
|
||||
<!-- Filtri e ricerca -->
|
||||
<div class="input-card clearButton custom-border-bottom">
|
||||
<MudTextField T="string?"
|
||||
Placeholder="Cerca..."
|
||||
Variant="Variant.Text"
|
||||
AdornmentIcon="@Icons.Material.Rounded.Search"
|
||||
Adornment="Adornment.Start"
|
||||
@bind-Value="SearchTermActivity"
|
||||
OnDebounceIntervalElapsed="() => ApplyFiltersActivity()"
|
||||
DebounceInterval="500"/>
|
||||
</div>
|
||||
|
||||
<div class="attivita-container">
|
||||
@foreach (var activity in CurrentPageActivity)
|
||||
{
|
||||
<ActivityCard ShowDate="true" Activity="activity"/>
|
||||
}
|
||||
|
||||
@if (TotalPagesActivity > 1)
|
||||
{
|
||||
<div class="custom-pagination">
|
||||
<MudPagination BoundaryCount="1" MiddleCount="1" Count="@TotalPagesActivity"
|
||||
@bind-Selected="CurrentPageActivityIndex"
|
||||
Color="Color.Primary"/>
|
||||
</div>
|
||||
|
||||
<div class="SelectedPageSize">
|
||||
<MudSelect @bind-Value="SelectedPageSizeActivity"
|
||||
Variant="Variant.Text"
|
||||
Label="Elementi per pagina"
|
||||
Dense="true"
|
||||
Style="width: 100%;">
|
||||
<MudSelectItem Value="5">5</MudSelectItem>
|
||||
<MudSelectItem Value="15">15</MudSelectItem>
|
||||
<MudSelectItem Value="30">30</MudSelectItem>
|
||||
</MudSelect>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<MudScrollToTop Selector="#topPage" VisibleCssClass="visible absolute" TopOffset="100" HiddenCssClass="invisible">
|
||||
<MudFab Size="Size.Small" Color="Color.Primary" StartIcon="@Icons.Material.Rounded.KeyboardArrowUp"/>
|
||||
</MudScrollToTop>
|
||||
</div>
|
||||
|
||||
<input type="radio" class="tab-toggle" name="tab-toggle" id="tab1" checked="@(ActiveTab == 0)">
|
||||
<input type="radio" class="tab-toggle" name="tab-toggle" id="tab2" checked="@(ActiveTab == 1)">
|
||||
<input type="radio" class="tab-toggle" name="tab-toggle" id="tab3" checked="@(ActiveTab == 2)">
|
||||
|
||||
<div class="box">
|
||||
<ul class="tab-list">
|
||||
<li class="tab-item">
|
||||
<label class="tab-trigger" for="tab1" @onclick="() => SwitchTab(0)">Contatti</label>
|
||||
</li>
|
||||
<li class="tab-item">
|
||||
<label class="tab-trigger" for="tab2" @onclick="() => SwitchTab(1)">Commesse</label>
|
||||
</li>
|
||||
<li class="tab-item">
|
||||
<label class="tab-trigger" for="tab3" @onclick="() => SwitchTab(2)">Attivit<69></label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="tab-container">
|
||||
<!-- Tab Contatti -->
|
||||
<div class="tab-content" style="display: @(ActiveTab == 0 ? "block" : "none")">
|
||||
@if (PersRif?.Count > 0)
|
||||
{
|
||||
<div class="container-pers-rif">
|
||||
@foreach (var person in PersRif)
|
||||
{
|
||||
<ContactCard Contact="person" />
|
||||
@if (person != PersRif.Last())
|
||||
{
|
||||
<div class="divider"></div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="container-button">
|
||||
<MudButton Class="button-settings infoText"
|
||||
FullWidth="true"
|
||||
Size="Size.Medium"
|
||||
OnClick="OpenPersRifForm"
|
||||
Variant="Variant.Outlined">
|
||||
Aggiungi contatto
|
||||
</MudButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tab Commesse -->
|
||||
<div class="tab-content" style="display: @(ActiveTab == 1 ? "block" : "none")">
|
||||
@if (IsLoadingCommesse)
|
||||
{
|
||||
<MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="my-7" />
|
||||
}
|
||||
else if (Commesse?.Count == 0)
|
||||
{
|
||||
<NoDataAvailable Text="Nessuna commessa presente" />
|
||||
}
|
||||
else if (Commesse != null)
|
||||
{
|
||||
<!-- Filtri e ricerca -->
|
||||
<div class="input-card clearButton">
|
||||
<MudTextField T="string?"
|
||||
Placeholder="Cerca..."
|
||||
Variant="Variant.Text"
|
||||
@bind-Value="SearchTermCommesse"
|
||||
OnDebounceIntervalElapsed="() => ApplyFiltersCommesse()"
|
||||
DebounceInterval="500" />
|
||||
</div>
|
||||
|
||||
<div class="commesse-container">
|
||||
@if (IsLoadingSteps)
|
||||
{
|
||||
<MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="my-3" />
|
||||
}
|
||||
|
||||
@foreach (var commessa in CurrentPageCommesse)
|
||||
{
|
||||
<div class="commessa-wrapper" style="@(IsLoadingStep(commessa.CodJcom) ? "opacity: 0.7;" : "")">
|
||||
@if (Steps.TryGetValue(commessa.CodJcom, out var steps))
|
||||
{
|
||||
<CommessaCard Steps="@steps" RagSoc="@Anag.RagSoc" Commessa="commessa" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<CommessaCard Steps="null" RagSoc="@Anag.RagSoc" Commessa="commessa" />
|
||||
@if (IsLoadingStep(commessa.CodJcom))
|
||||
{
|
||||
<MudProgressLinear Indeterminate="true" Color="Color.Primary" Class="my-1" Style="height: 2px;" />
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (TotalPagesCommesse > 1)
|
||||
{
|
||||
<div class="custom-pagination">
|
||||
<MudPagination BoundaryCount="1" MiddleCount="1" Count="@TotalPagesCommesse"
|
||||
@bind-Selected="SelectedPageCommesse"
|
||||
Color="Color.Primary" />
|
||||
</div>
|
||||
|
||||
<div class="SelectedPageSize">
|
||||
<MudSelect @bind-Value="SelectedPageSizeCommesse"
|
||||
Variant="Variant.Text"
|
||||
Label="Elementi per pagina"
|
||||
Dense="true"
|
||||
Style="width: 100%;">
|
||||
<MudSelectItem Value="5">5</MudSelectItem>
|
||||
<MudSelectItem Value="10">10</MudSelectItem>
|
||||
<MudSelectItem Value="15">15</MudSelectItem>
|
||||
</MudSelect>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<!-- Tab Attivit<69> -->
|
||||
<div class="tab-content" style="display: @(ActiveTab == 2 ? "block" : "none")">
|
||||
@if (ActivityIsLoading)
|
||||
{
|
||||
<MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="my-7" />
|
||||
}
|
||||
else if (ActivityList?.Count == 0)
|
||||
{
|
||||
<NoDataAvailable Text="Nessuna attivit<69> presente" />
|
||||
}
|
||||
else if (ActivityList != null)
|
||||
{
|
||||
<!-- Filtri e ricerca -->
|
||||
<div class="input-card clearButton">
|
||||
<MudTextField T="string?"
|
||||
Placeholder="Cerca..."
|
||||
Variant="Variant.Text"
|
||||
@bind-Value="SearchTermActivity"
|
||||
OnDebounceIntervalElapsed="() => ApplyFiltersActivity()"
|
||||
DebounceInterval="500" />
|
||||
</div>
|
||||
|
||||
<div class="attivita-container">
|
||||
@foreach (var activity in CurrentPageActivity)
|
||||
{
|
||||
<ActivityCard ShowDate="true" Activity="activity" />
|
||||
}
|
||||
|
||||
@if (TotalPagesActivity > 1)
|
||||
{
|
||||
<div class="custom-pagination">
|
||||
<MudPagination BoundaryCount="1" MiddleCount="1" Count="@TotalPagesActivity"
|
||||
@bind-Selected="CurrentPageActivityIndex"
|
||||
Color="Color.Primary" />
|
||||
</div>
|
||||
|
||||
<div class="SelectedPageSize">
|
||||
<MudSelect @bind-Value="SelectedPageSizeActivity"
|
||||
Variant="Variant.Text"
|
||||
Label="Elementi per pagina"
|
||||
Dense="true"
|
||||
Style="width: 100%;">
|
||||
<MudSelectItem Value="5">5</MudSelectItem>
|
||||
<MudSelectItem Value="15">15</MudSelectItem>
|
||||
<MudSelectItem Value="30">30</MudSelectItem>
|
||||
</MudSelect>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<MudScrollToTop Selector="#topPage" VisibleCssClass="visible absolute" TopOffset="100" HiddenCssClass="invisible">
|
||||
<MudFab Size="Size.Small" Color="Color.Primary" StartIcon="@Icons.Material.Rounded.KeyboardArrowUp" />
|
||||
</MudScrollToTop>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -523,10 +536,9 @@ else
|
||||
await Task.Run(async () =>
|
||||
{
|
||||
var activities = await IntegryApiService.RetrieveActivity(new CRMRetrieveActivityRequestDTO { CodAnag = Anag.CodContact });
|
||||
ActivityList = Mapper.Map<List<ActivityDTO>>(activities)
|
||||
.OrderByDescending(x =>
|
||||
(x.EffectiveTime ?? x.EstimatedTime) ?? x.DataInsAct
|
||||
).ToList();
|
||||
ActivityList = (await ManageData.MapActivity(activities)).OrderByDescending(x =>
|
||||
(x.EffectiveTime ?? x.EstimatedTime) ?? x.DataInsAct
|
||||
).ToList();
|
||||
});
|
||||
|
||||
UserState.Activitys = ActivityList;
|
||||
@@ -575,6 +587,9 @@ else
|
||||
Steps = UserState.Steps;
|
||||
ActivityList = UserState.Activitys;
|
||||
|
||||
if (ActiveTab != UserState.ActiveTab)
|
||||
SwitchTab(UserState.ActiveTab);
|
||||
|
||||
ApplyFiltersCommesse();
|
||||
ApplyFiltersActivity();
|
||||
|
||||
@@ -680,6 +695,7 @@ else
|
||||
private void SwitchTab(int tabIndex)
|
||||
{
|
||||
ActiveTab = tabIndex;
|
||||
UserState.ActiveTab = ActiveTab;
|
||||
|
||||
if (tabIndex == 1 && Commesse == null)
|
||||
{
|
||||
@@ -769,7 +785,16 @@ else
|
||||
{
|
||||
var result = await ModalHelpers.OpenUserForm(Dialog, anag);
|
||||
|
||||
if (result is { Canceled: false })
|
||||
if (result is { Canceled: false, Data: not null } && result.Data.GetType() == typeof(AnagClie))
|
||||
{
|
||||
var clie = (AnagClie)result.Data;
|
||||
IsContact = true;
|
||||
CodContact = clie.CodAnag!;
|
||||
|
||||
await LoadAnagAsync();
|
||||
SaveDataToSession();
|
||||
}
|
||||
else if (result is { Canceled: false })
|
||||
{
|
||||
await LoadAnagAsync();
|
||||
SaveDataToSession();
|
||||
@@ -777,4 +802,5 @@ else
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -1,5 +1,11 @@
|
||||
.tab-section {
|
||||
width: 100%;
|
||||
border-radius: var(--mud-default-borderradius);
|
||||
background: var(--light-card-background);
|
||||
}
|
||||
|
||||
.container-primary-info {
|
||||
box-shadow: var(--custom-box-shadow);
|
||||
background: var(--light-card-background);
|
||||
width: 100%;
|
||||
margin-bottom: 2rem;
|
||||
border-radius: 16px;
|
||||
@@ -39,9 +45,10 @@
|
||||
|
||||
.section-info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-direction: row;
|
||||
padding: .4rem 1.2rem .8rem;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.section-personal-info {
|
||||
@@ -84,8 +91,9 @@
|
||||
|
||||
.container-button {
|
||||
width: 100%;
|
||||
box-shadow: var(--custom-box-shadow);
|
||||
padding: .25rem 0;
|
||||
background: var(--light-card-background);
|
||||
padding: 0 !important;
|
||||
padding-bottom: .5rem !important;
|
||||
border-radius: 16px;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
@@ -137,8 +145,7 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
box-shadow: var(--custom-box-shadow);
|
||||
background: var(--light-card-background);
|
||||
border-radius: 16px;
|
||||
max-height: 32vh;
|
||||
overflow: auto;
|
||||
@@ -146,7 +153,12 @@
|
||||
padding: 1rem 0;
|
||||
}
|
||||
|
||||
.container-pers-rif::-webkit-scrollbar { display: none; }
|
||||
.container-pers-rif::-webkit-scrollbar { width: 3px; }
|
||||
|
||||
.container-pers-rif::-webkit-scrollbar-thumb {
|
||||
background: #bbb;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.container-pers-rif .divider {
|
||||
margin: 0 0 0 3.5rem;
|
||||
@@ -175,12 +187,14 @@
|
||||
/*--------------
|
||||
TabPanel
|
||||
----------------*/
|
||||
|
||||
.box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: -webkit-fill-available;
|
||||
box-shadow: var(--custom-box-shadow);
|
||||
border-radius: 16px;
|
||||
background: var(--light-card-background);
|
||||
border-radius: 20px 20px 0 0;
|
||||
border-bottom: .1rem solid var(--card-border-color);
|
||||
overflow: clip;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
@@ -196,7 +210,6 @@
|
||||
display: flex;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
background: var(--mud-palette-surface);
|
||||
}
|
||||
|
||||
/* la lineetta */
|
||||
@@ -267,9 +280,7 @@
|
||||
|
||||
#tab1:checked ~ .tab-container .tab-content:nth-child(1),
|
||||
#tab2:checked ~ .tab-container .tab-content:nth-child(2),
|
||||
#tab3:checked ~ .tab-container .tab-content:nth-child(3) {
|
||||
display: block;
|
||||
}
|
||||
#tab3:checked ~ .tab-container .tab-content:nth-child(3) { display: block; }
|
||||
|
||||
@keyframes fade {
|
||||
from {
|
||||
@@ -285,10 +296,6 @@
|
||||
|
||||
.custom-pagination ::deep ul { padding-left: 0 !important; }
|
||||
|
||||
.SelectedPageSize {
|
||||
width: 100%;
|
||||
}
|
||||
.SelectedPageSize { width: 100%; }
|
||||
|
||||
.FilterSection {
|
||||
display: flex;
|
||||
}
|
||||
.FilterSection { display: flex; }
|
||||
@@ -1,6 +1,5 @@
|
||||
@using salesbook.Shared.Components.Layout.Spinner
|
||||
@using salesbook.Shared.Core.Dto
|
||||
@using salesbook.Shared.Core.Interface
|
||||
@using salesbook.Shared.Components.Layout.Overlay
|
||||
@using salesbook.Shared.Core.Interface.IntegryApi
|
||||
@inject IIntegryApiService IntegryApiService
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
@using salesbook.Shared.Core.Dto
|
||||
@using salesbook.Shared.Core.Dto.Activity
|
||||
@using salesbook.Shared.Core.Entity
|
||||
@using salesbook.Shared.Core.Helpers.Enum
|
||||
@@ -12,7 +11,7 @@
|
||||
@switch (Activity.Category)
|
||||
{
|
||||
case ActivityCategoryEnum.Commessa:
|
||||
@Activity.Commessa
|
||||
@Activity.Commessa?.Descrizione
|
||||
break;
|
||||
case ActivityCategoryEnum.Interna:
|
||||
@Activity.Cliente
|
||||
|
||||
@@ -5,14 +5,23 @@
|
||||
padding: .5rem .5rem;
|
||||
border-radius: 12px;
|
||||
line-height: normal;
|
||||
box-shadow: var(--custom-box-shadow);
|
||||
/*box-shadow: var(--custom-box-shadow);*/
|
||||
}
|
||||
|
||||
.activity-card.memo { border-left: 5px solid var(--mud-palette-info-darken); }
|
||||
.activity-card.memo {
|
||||
border-left: 5px solid var(--mud-palette-info-darken);
|
||||
background-color: hsl(from var(--mud-palette-info-darken) h s 98%);
|
||||
}
|
||||
|
||||
.activity-card.interna { border-left: 5px solid var(--mud-palette-success-darken); }
|
||||
.activity-card.interna {
|
||||
border-left: 5px solid var(--mud-palette-success-darken);
|
||||
background-color: hsl(from var(--mud-palette-success-darken) h s 98%);
|
||||
}
|
||||
|
||||
.activity-card.commessa { border-left: 5px solid var(--mud-palette-warning); }
|
||||
.activity-card.commessa {
|
||||
border-left: 5px solid var(--mud-palette-warning);
|
||||
background-color: hsl(from var(--mud-palette-warning) h s 98%);
|
||||
}
|
||||
|
||||
.activity-left-section {
|
||||
display: flex;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
padding: .5rem .5rem;
|
||||
border-radius: 12px;
|
||||
line-height: normal;
|
||||
box-shadow: var(--custom-box-shadow);
|
||||
background: var(--light-card-background);
|
||||
}
|
||||
|
||||
.activity-card.memo { border-left: 5px solid var(--mud-palette-info-darken); }
|
||||
|
||||
@@ -44,21 +44,25 @@
|
||||
{
|
||||
if (Steps is null) return;
|
||||
|
||||
// Ultimo step non skip
|
||||
var lastBeforeSkip = Steps
|
||||
.TakeWhile(s => s.Status is { Skip: false })
|
||||
.LastOrDefault();
|
||||
.LastOrDefault(s => s.Status is { Skip: false });
|
||||
|
||||
if (lastBeforeSkip is not null) Stato = lastBeforeSkip.StepName;
|
||||
if (lastBeforeSkip is not null)
|
||||
Stato = lastBeforeSkip.StepName;
|
||||
|
||||
// Ultima data disponibile
|
||||
LastUpd = Steps
|
||||
.Where(s => s.Date.HasValue)
|
||||
.Select(s => s.Date!.Value)
|
||||
.DefaultIfEmpty()
|
||||
.Max();
|
||||
|
||||
if (LastUpd.Equals(DateTime.MinValue)) LastUpd = null;
|
||||
if (LastUpd.Equals(DateTime.MinValue))
|
||||
LastUpd = null;
|
||||
}
|
||||
|
||||
|
||||
private void OpenPageCommessa()
|
||||
{
|
||||
JobSteps.Steps = Steps;
|
||||
|
||||
@@ -5,15 +5,11 @@
|
||||
padding: .5rem .5rem;
|
||||
border-radius: 12px;
|
||||
line-height: normal;
|
||||
box-shadow: var(--custom-box-shadow);
|
||||
|
||||
border-left: 5px solid var(--card-border-color);
|
||||
background-color: hsl(from var(--card-border-color) h s 99%);
|
||||
}
|
||||
|
||||
.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;
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
padding: 0 .75rem;
|
||||
border-radius: 16px;
|
||||
padding: 0 .5rem;
|
||||
line-height: normal;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
@using Java.Sql
|
||||
@using salesbook.Shared.Components.Layout.Spinner
|
||||
@using salesbook.Shared.Core.Dto.Activity
|
||||
@using salesbook.Shared.Core.Entity
|
||||
@using salesbook.Shared.Core.Interface
|
||||
@inject IManageDataService ManageDataService
|
||||
@inject ISnackbar Snackbar
|
||||
@inject IDialogService Dialog
|
||||
|
||||
<div class="row" id="@Notification.Id">
|
||||
<div class="row" id="@Notification.Id" @onclick="OpenActivity">
|
||||
<div class="behind-left">
|
||||
<button class="read-btn">
|
||||
<MudIcon Icon="@Icons.Material.Rounded.Check" />
|
||||
@@ -41,26 +48,54 @@
|
||||
Notification.StartDate < DateTime.Today && Notification.Body != null && Notification.Body.Contains("Oggi")
|
||||
)
|
||||
{
|
||||
<MudText Typo="Typo.caption" Class="subtitle">@Notification.Body.Replace("Oggi", $"{Notification.StartDate:d}")</MudText>
|
||||
<div class="subtitle">@Notification.Body.Replace("Oggi", $"{Notification.StartDate:d}")</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudText Typo="Typo.caption" Class="subtitle">@Notification.Body</MudText>
|
||||
<div class="subtitle">@Notification.Body</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<OverlayLayout Visible="VisibleOverlay" />
|
||||
|
||||
@code {
|
||||
[Parameter] public bool Unread { get; set; }
|
||||
[Parameter] public WtbNotification Notification { get; set; } = new();
|
||||
|
||||
private bool VisibleOverlay { get; set; }
|
||||
|
||||
private async Task OpenActivity()
|
||||
{
|
||||
if(Notification.NotificationData?.ActivityId == null) return;
|
||||
var activityId = Notification.NotificationData.ActivityId;
|
||||
|
||||
Snackbar.Configuration.PositionClass = Defaults.Classes.Position.TopCenter;
|
||||
Snackbar.Clear();
|
||||
|
||||
VisibleOverlay = true;
|
||||
StateHasChanged();
|
||||
|
||||
var activity = (await ManageDataService.GetActivityTryLocalDb(new WhereCondActivity { ActivityId = activityId })).LastOrDefault();
|
||||
|
||||
VisibleOverlay = false;
|
||||
StateHasChanged();
|
||||
|
||||
if (activity == null) Snackbar.Add("Impossibile aprire l'attivit<69>", Severity.Error);
|
||||
|
||||
_ = ModalHelpers.OpenActivityForm(Dialog, activity, null);
|
||||
}
|
||||
|
||||
private static string GetTimeAgo(DateTime? timestamp)
|
||||
{
|
||||
if (timestamp is null) return "";
|
||||
|
||||
var difference = DateTime.Now - timestamp.Value;
|
||||
|
||||
if (DateTime.Now.Day != timestamp.Value.Day)
|
||||
return timestamp.Value.ToString("dd/MM/yyyy");
|
||||
|
||||
switch (difference.TotalMinutes)
|
||||
{
|
||||
case < 1:
|
||||
@@ -77,7 +112,7 @@
|
||||
return $"{timestamp.Value:t}";
|
||||
default:
|
||||
{
|
||||
return difference.TotalDays < 7 ? $"{(int)difference.TotalDays}g fa" : timestamp.Value.ToString("dd/MM/yyyy");
|
||||
return timestamp.Value.ToString("dd/MM/yyyy");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border-radius: var(--mud-default-borderradius);
|
||||
box-shadow: var(--custom-box-shadow);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@@ -39,7 +38,7 @@
|
||||
align-items: center;
|
||||
padding: 12px;
|
||||
gap: 12px;
|
||||
background: var(--mud-palette-background);
|
||||
background: var(--light-card-background);
|
||||
transition: transform .2s ease;
|
||||
touch-action: pan-y;
|
||||
will-change: transform;
|
||||
@@ -80,12 +79,15 @@
|
||||
.title {
|
||||
font-weight: 700;
|
||||
margin-bottom: unset !important;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.section-time {
|
||||
display: flex;
|
||||
gap: .65rem;
|
||||
min-width: max-content;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
gap: .5rem;
|
||||
}
|
||||
|
||||
.notification-time {
|
||||
@@ -99,7 +101,9 @@
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
.notification-body ::deep > .subtitle {
|
||||
font-size: 12px;
|
||||
color: var(--mud-palette-drawer-text);
|
||||
line-height: inherit;
|
||||
margin-top: .5rem;
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
@using System.Globalization
|
||||
@using System.Text.RegularExpressions
|
||||
@using CommunityToolkit.Mvvm.Messaging
|
||||
@using salesbook.Shared.Components.Layout
|
||||
@using salesbook.Shared.Components.Layout.Overlay
|
||||
@@ -40,18 +39,25 @@
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">Commessa</span>
|
||||
|
||||
@if (Commesse.IsNullOrEmpty())
|
||||
@if (ActivityModel.CodJcom != null && SelectedComessa == null)
|
||||
{
|
||||
<span class="warning-text">Nessuna commessa presente</span>
|
||||
<MudSkeleton />
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudSelectExtended FullWidth="true" ReadOnly="@(IsView || Commesse.IsNullOrEmpty())" T="string?" Variant="Variant.Text" @bind-Value="ActivityModel.CodJcom" @bind-Value:after="OnCommessaChanged" Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code">
|
||||
@foreach (var com in Commesse)
|
||||
{
|
||||
<MudSelectItemExtended Class="custom-item-select" Value="@com.CodJcom">@($"{com.CodJcom} - {com.Descrizione}")</MudSelectItemExtended>
|
||||
}
|
||||
</MudSelectExtended>
|
||||
<MudAutocomplete
|
||||
Disabled="ActivityModel.Cliente.IsNullOrEmpty()"
|
||||
T="JtbComt?" ReadOnly="IsView"
|
||||
@bind-Value="SelectedComessa"
|
||||
@bind-Value:after="OnCommessaSelectedAfter"
|
||||
SearchFunc="SearchCommesseAsync"
|
||||
ToStringFunc="@(c => c == null ? string.Empty : $"{c.CodJcom} - {c.Descrizione}")"
|
||||
Clearable="true"
|
||||
OnClearButtonClick="OnCommessaClear"
|
||||
ShowProgressIndicator="true"
|
||||
DebounceInterval="300"
|
||||
MaxItems="50"
|
||||
Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code"/>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@@ -79,7 +85,6 @@
|
||||
<MudSelectExtended FullWidth="true" ReadOnly="@(IsView || ActivityModel.EstimatedTime == null)" T="int" Variant="Variant.Text" @bind-Value="ActivityModel.MinuteBefore" @bind-Value:after="OnAfterChangeTimeBefore" Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code">
|
||||
<MudSelectItemExtended Class="custom-item-select" Text="Nessuno" Value="-1">Nessuno</MudSelectItemExtended>
|
||||
<MudSelectItemExtended Class="custom-item-select" Text="All'ora pianificata" Value="0">All'ora pianificata</MudSelectItemExtended>
|
||||
<MudSelectItemExtended Class="custom-item-select" Text="15 minuti prima" Value="15">15 minuti prima</MudSelectItemExtended>
|
||||
<MudSelectItemExtended Class="custom-item-select" Text="30 minuti prima" Value="30">30 minuti prima</MudSelectItemExtended>
|
||||
<MudSelectItemExtended Class="custom-item-select" Text="1 ora prima" Value="60">1 ora prima</MudSelectItemExtended>
|
||||
<MudSelectItemExtended Class="custom-item-select" Text="2 ore prima" Value="120">2 ore prima</MudSelectItemExtended>
|
||||
@@ -93,12 +98,27 @@
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">Assegnata a</span>
|
||||
|
||||
<MudSelectExtended FullWidth="true" ReadOnly="IsView" T="string?" Variant="Variant.Text" @bind-Value="ActivityModel.UserName" @bind-Value:after="OnUserChanged" Class="customIcon-select" AdornmentIcon="@Icons.Material.Filled.Code">
|
||||
@foreach (var user in Users)
|
||||
{
|
||||
<MudSelectItemExtended Class="custom-item-select" Value="@user.UserName">@user.FullName</MudSelectItemExtended>
|
||||
}
|
||||
</MudSelectExtended>
|
||||
@if (ActivityModel.UserName != null && SelectedUser == null)
|
||||
{
|
||||
<MudSkeleton />
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudAutocomplete
|
||||
Disabled="Users.IsNullOrEmpty()" ReadOnly="IsView"
|
||||
T="StbUser"
|
||||
@bind-Value="SelectedUser"
|
||||
@bind-Value:after="OnUserSelectedAfter"
|
||||
SearchFunc="SearchUtentiAsync"
|
||||
ToStringFunc="@(u => u == null ? string.Empty : u.FullName)"
|
||||
Clearable="true"
|
||||
OnClearButtonClick="OnUserClear"
|
||||
ShowProgressIndicator="true"
|
||||
DebounceInterval="300"
|
||||
MaxItems="50"
|
||||
Class="customIcon-select"
|
||||
AdornmentIcon="@Icons.Material.Filled.Code"/>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
@@ -106,12 +126,19 @@
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">Tipo</span>
|
||||
|
||||
<MudSelectExtended ReadOnly="IsView" FullWidth="true" T="string?" Variant="Variant.Text" @bind-Value="ActivityModel.ActivityTypeId" @bind-Value:after="OnAfterChangeValue" 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>
|
||||
@if (ActivityType.IsNullOrEmpty())
|
||||
{
|
||||
<MudSkeleton />
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudSelectExtended ReadOnly="IsView" FullWidth="true" T="string?" Variant="Variant.Text" @bind-Value="ActivityModel.ActivityTypeId" @bind-Value:after="OnAfterChangeValue" 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 class="divider"></div>
|
||||
@@ -163,41 +190,44 @@
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="container-button">
|
||||
<MudButton Class="button-settings green-icon"
|
||||
FullWidth="true"
|
||||
StartIcon="@Icons.Material.Rounded.AttachFile"
|
||||
Size="Size.Medium"
|
||||
OnClick="OpenAddAttached"
|
||||
Variant="Variant.Outlined">
|
||||
Aggiungi allegati
|
||||
</MudButton>
|
||||
|
||||
@if (!IsNew)
|
||||
{
|
||||
<div class="divider"></div>
|
||||
|
||||
<MudButton Class="button-settings gray-icon"
|
||||
@if (!IsView)
|
||||
{
|
||||
<div class="container-button">
|
||||
<MudButton Class="button-settings green-icon"
|
||||
FullWidth="true"
|
||||
StartIcon="@Icons.Material.Filled.ContentCopy"
|
||||
StartIcon="@Icons.Material.Rounded.AttachFile"
|
||||
Size="Size.Medium"
|
||||
OnClick="Duplica"
|
||||
OnClick="OpenAddAttached"
|
||||
Variant="Variant.Outlined">
|
||||
Duplica
|
||||
Aggiungi allegati
|
||||
</MudButton>
|
||||
|
||||
<div class="divider"></div>
|
||||
@if (!IsNew)
|
||||
{
|
||||
<div class="divider"></div>
|
||||
|
||||
<MudButton Class="button-settings red-icon"
|
||||
FullWidth="true"
|
||||
StartIcon="@Icons.Material.Outlined.Delete"
|
||||
Size="Size.Medium"
|
||||
OnClick="DeleteActivity"
|
||||
Variant="Variant.Outlined">
|
||||
Elimina
|
||||
</MudButton>
|
||||
}
|
||||
</div>
|
||||
<MudButton Class="button-settings gray-icon"
|
||||
FullWidth="true"
|
||||
StartIcon="@Icons.Material.Filled.ContentCopy"
|
||||
Size="Size.Medium"
|
||||
OnClick="Duplica"
|
||||
Variant="Variant.Outlined">
|
||||
Duplica
|
||||
</MudButton>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<MudButton Class="button-settings red-icon"
|
||||
FullWidth="true"
|
||||
StartIcon="@Icons.Material.Outlined.Delete"
|
||||
Size="Size.Medium"
|
||||
OnClick="DeleteActivity"
|
||||
Variant="Variant.Outlined">
|
||||
Elimina
|
||||
</MudButton>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<MudMessageBox @ref="ConfirmDelete" Class="c-messageBox" Title="Attenzione!" CancelText="Annulla">
|
||||
@@ -211,30 +241,6 @@
|
||||
</MudButton>
|
||||
</YesButton>
|
||||
</MudMessageBox>
|
||||
|
||||
<MudMessageBox @ref="AddNamePosition" Class="c-messageBox" Title="Nome della posizione" CancelText="Annulla">
|
||||
<MessageContent>
|
||||
<MudTextField @bind-Value="NamePosition" Variant="Variant.Outlined" />
|
||||
</MessageContent>
|
||||
<YesButton>
|
||||
<MudButton Size="Size.Small" Variant="Variant.Filled" Color="Color.Primary"
|
||||
StartIcon="@Icons.Material.Rounded.Check">
|
||||
Salva
|
||||
</MudButton>
|
||||
</YesButton>
|
||||
</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.Check">
|
||||
Crea
|
||||
</MudButton>
|
||||
</YesButton>
|
||||
</MudMessageBox>
|
||||
</DialogContent>
|
||||
</MudDialog>
|
||||
|
||||
@@ -275,14 +281,20 @@
|
||||
|
||||
//MessageBox
|
||||
private MudMessageBox ConfirmDelete { get; set; }
|
||||
private MudMessageBox ConfirmMemo { get; set; }
|
||||
private MudMessageBox AddNamePosition { get; set; }
|
||||
|
||||
//Attached
|
||||
private List<AttachedDTO>? AttachedList { get; set; }
|
||||
private string? NamePosition { get; set; }
|
||||
private bool CanAddPosition { get; set; } = true;
|
||||
|
||||
// cache per commesse
|
||||
private string? _lastLoadedCodAnag;
|
||||
|
||||
//Commessa
|
||||
private JtbComt? SelectedComessa { get; set; }
|
||||
|
||||
//User
|
||||
private StbUser? SelectedUser { get; set; }
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
Snackbar.Configuration.PositionClass = Defaults.Classes.Position.TopCenter;
|
||||
@@ -292,24 +304,24 @@
|
||||
ActivityModel = ActivityCopied.Clone();
|
||||
}
|
||||
else if (!Id.IsNullOrEmpty())
|
||||
{
|
||||
ActivityModel = (await ManageData.GetActivity(new WhereCondActivity { ActivityId = Id }, true)).Last();
|
||||
}
|
||||
|
||||
if (Id.IsNullOrEmpty()) Id = ActivityModel.ActivityId;
|
||||
IsNew = Id.IsNullOrEmpty();
|
||||
LabelSave = IsNew ? "Aggiungi" : null;
|
||||
|
||||
_ = LoadData();
|
||||
await LoadCommesse();
|
||||
|
||||
if (IsNew)
|
||||
{
|
||||
ActivityModel.EstimatedTime = DateTime.Today.Add(TimeSpan.FromHours(DateTime.Now.Hour));
|
||||
ActivityModel.EstimatedEndtime = DateTime.Today.Add(TimeSpan.FromHours(DateTime.Now.Hour) + TimeSpan.FromHours(1));
|
||||
ActivityModel.EstimatedTime = DateTime.Today.AddHours(DateTime.Now.Hour);
|
||||
ActivityModel.EstimatedEndtime = ActivityModel.EstimatedTime?.AddHours(1);
|
||||
ActivityModel.UserName = UserSession.User.Username;
|
||||
}
|
||||
|
||||
await LoadActivityType();
|
||||
_ = LoadData();
|
||||
|
||||
await LoadActivityType();
|
||||
OriginalModel = ActivityModel.Clone();
|
||||
}
|
||||
|
||||
@@ -321,67 +333,59 @@
|
||||
StateHasChanged();
|
||||
|
||||
await SavePosition();
|
||||
|
||||
var response = await IntegryApiService.SaveActivity(ActivityModel);
|
||||
|
||||
if (response == null)
|
||||
return;
|
||||
|
||||
var newActivity = response.Last();
|
||||
|
||||
await ManageData.InsertOrUpdate(newActivity);
|
||||
|
||||
await SaveAttached(newActivity.ActivityId!);
|
||||
|
||||
SuccessAnimation = true;
|
||||
StateHasChanged();
|
||||
|
||||
await Task.Delay(1250);
|
||||
|
||||
MudDialog.Close(newActivity);
|
||||
}
|
||||
|
||||
private async Task SavePosition()
|
||||
{
|
||||
if (AttachedList != null)
|
||||
{
|
||||
foreach (var attached in AttachedList)
|
||||
{
|
||||
if (attached.Type != AttachedDTO.TypeAttached.Position) continue;
|
||||
if (AttachedList is null) return;
|
||||
|
||||
var positionTasks = AttachedList
|
||||
.Where(a => a.Type == AttachedDTO.TypeAttached.Position)
|
||||
.Select(async attached =>
|
||||
{
|
||||
var position = new PositionDTO
|
||||
{
|
||||
Description = attached.Description,
|
||||
Lat = attached.Lat,
|
||||
Lng = attached.Lng
|
||||
};
|
||||
|
||||
ActivityModel.Position = await IntegryApiService.SavePosition(position);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
await Task.WhenAll(positionTasks);
|
||||
}
|
||||
|
||||
private async Task SaveAttached(string activityId)
|
||||
{
|
||||
if (AttachedList != null)
|
||||
{
|
||||
foreach (var attached in AttachedList)
|
||||
{
|
||||
if (attached.FileContent is not null && attached.Type != AttachedDTO.TypeAttached.Position)
|
||||
{
|
||||
await IntegryApiService.UploadFile(activityId, attached.FileBytes, attached.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (AttachedList is null) return;
|
||||
|
||||
var uploadTasks = AttachedList
|
||||
.Where(a => a.FileContent is not null && a.Type != AttachedDTO.TypeAttached.Position)
|
||||
.Select(a => IntegryApiService.UploadFile(activityId, a.FileBytes, a.Name));
|
||||
|
||||
await Task.WhenAll(uploadTasks);
|
||||
}
|
||||
|
||||
private bool CheckPreSave()
|
||||
{
|
||||
Snackbar.Clear();
|
||||
|
||||
if (!ActivityModel.ActivityTypeId.IsNullOrEmpty()) return true;
|
||||
Snackbar.Add("Tipo attività obbligatorio!", Severity.Error);
|
||||
|
||||
Snackbar.Add("Tipo attività obbligatorio!", Severity.Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -389,14 +393,17 @@
|
||||
{
|
||||
return Task.Run(async () =>
|
||||
{
|
||||
if (!IsNew && Id != null)
|
||||
{
|
||||
ActivityFileList = await IntegryApiService.GetActivityFile(Id);
|
||||
}
|
||||
SelectedComessa = ActivityModel.Commessa;
|
||||
|
||||
Users = await ManageData.GetTable<StbUser>();
|
||||
if (!ActivityModel.UserName.IsNullOrEmpty())
|
||||
SelectedUser = Users.FindLast(x => x.UserName.Equals(ActivityModel.UserName));
|
||||
|
||||
if (!IsNew && Id != null)
|
||||
ActivityFileList = await IntegryApiService.GetActivityFile(Id);
|
||||
|
||||
ActivityResult = await ManageData.GetTable<StbActivityResult>();
|
||||
Clienti = await ManageData.GetClienti(new WhereCondContact {FlagStato = "A"});
|
||||
Clienti = await ManageData.GetClienti(new WhereCondContact { FlagStato = "A" });
|
||||
Pros = await ManageData.GetProspect();
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
@@ -405,76 +412,151 @@
|
||||
|
||||
private async Task LoadActivityType()
|
||||
{
|
||||
if (ActivityModel.UserName is null) ActivityType = [];
|
||||
if (ActivityModel.UserName is null)
|
||||
{
|
||||
ActivityType = [];
|
||||
return;
|
||||
}
|
||||
|
||||
ActivityType = await ManageData.GetTable<SrlActivityTypeUser>(x =>
|
||||
x.UserName != null && x.UserName.Equals(ActivityModel.UserName)
|
||||
ActivityType = await ManageData.GetTable<SrlActivityTypeUser>(x => x.UserName != null && x.UserName.Equals(ActivityModel.UserName)
|
||||
);
|
||||
}
|
||||
|
||||
private async Task LoadCommesse() =>
|
||||
Commesse = await ManageData.GetTable<JtbComt>(x => x.CodAnag != null && x.CodAnag.Equals(ActivityModel.CodAnag));
|
||||
|
||||
private async Task<IEnumerable<string>?> SearchCliente(string value, CancellationToken token)
|
||||
private async Task LoadCommesse()
|
||||
{
|
||||
if (string.IsNullOrEmpty(value))
|
||||
return null;
|
||||
if (_lastLoadedCodAnag == ActivityModel.CodAnag) return;
|
||||
|
||||
var listToReturn = new List<string>();
|
||||
|
||||
listToReturn.AddRange(
|
||||
Clienti.Where(x => x.RagSoc.Contains(value, StringComparison.OrdinalIgnoreCase)).Select(x => $"{x.CodAnag} - {x.RagSoc}")
|
||||
);
|
||||
|
||||
listToReturn.AddRange(
|
||||
Pros.Where(x => x.RagSoc.Contains(value, StringComparison.OrdinalIgnoreCase)).Select(x => $"{x.CodPpro} - {x.RagSoc}")
|
||||
);
|
||||
|
||||
return listToReturn;
|
||||
Commesse = await ManageData.GetTable<JtbComt>(x => x.CodAnag == ActivityModel.CodAnag);
|
||||
Commesse = Commesse.OrderByDescending(x => x.CodJcom).ToList();
|
||||
_lastLoadedCodAnag = ActivityModel.CodAnag;
|
||||
}
|
||||
|
||||
private async Task OnClienteChanged()
|
||||
private async Task<IEnumerable<JtbComt>> SearchCommesseAsync(string value, CancellationToken token)
|
||||
{
|
||||
await LoadCommesse();
|
||||
if (Commesse.IsNullOrEmpty()) return [];
|
||||
|
||||
IEnumerable<JtbComt> list;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(value))
|
||||
{
|
||||
list = Commesse.OrderByDescending(x => x.CodJcom).Take(10);
|
||||
}
|
||||
else
|
||||
{
|
||||
list = Commesse
|
||||
.Where(x => (x.CodJcom.Contains(value, StringComparison.OrdinalIgnoreCase)
|
||||
|| x.Descrizione.Contains(value, StringComparison.OrdinalIgnoreCase))
|
||||
&& (x.CodAnag == ActivityModel.CodAnag || ActivityModel.CodAnag == null))
|
||||
.OrderByDescending(x => x.CodJcom)
|
||||
.Take(50);
|
||||
}
|
||||
|
||||
return token.IsCancellationRequested ? [] : list;
|
||||
}
|
||||
|
||||
private Task<IEnumerable<StbUser>> SearchUtentiAsync(string value, CancellationToken token)
|
||||
{
|
||||
IEnumerable<StbUser> list;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(value))
|
||||
{
|
||||
list = Users.OrderBy(u => u.FullName).Take(50);
|
||||
}
|
||||
else
|
||||
{
|
||||
list = Users
|
||||
.Where(x => x.UserName.Contains(value, StringComparison.OrdinalIgnoreCase)
|
||||
|| x.FullName.Contains(value, StringComparison.OrdinalIgnoreCase))
|
||||
.OrderBy(u => u.FullName)
|
||||
.Take(50);
|
||||
}
|
||||
|
||||
return Task.FromResult(token.IsCancellationRequested ? [] : list);
|
||||
}
|
||||
|
||||
private Task<IEnumerable<string>?> SearchCliente(string value, CancellationToken token)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(value))
|
||||
return Task.FromResult<IEnumerable<string>?>(null);
|
||||
|
||||
var results = new List<string>();
|
||||
|
||||
results.AddRange(Clienti
|
||||
.Where(x => x.RagSoc.Contains(value, StringComparison.OrdinalIgnoreCase))
|
||||
.Select(x => $"{x.CodAnag} - {x.RagSoc}"));
|
||||
|
||||
results.AddRange(Pros
|
||||
.Where(x => x.RagSoc.Contains(value, StringComparison.OrdinalIgnoreCase))
|
||||
.Select(x => $"{x.CodPpro} - {x.RagSoc}"));
|
||||
|
||||
return Task.FromResult<IEnumerable<string>?>(results);
|
||||
}
|
||||
|
||||
private Task OnClienteChanged()
|
||||
{
|
||||
ActivityModel.CodJcom = null;
|
||||
if (string.IsNullOrWhiteSpace(ActivityModel.Cliente)) return Task.CompletedTask;
|
||||
|
||||
if (ActivityModel.Cliente.IsNullOrEmpty()) return;
|
||||
var parts = ActivityModel.Cliente.Split('-', 2, StringSplitOptions.TrimEntries);
|
||||
if (parts.Length == 2)
|
||||
{
|
||||
ActivityModel.CodAnag = parts[0];
|
||||
ActivityModel.Cliente = parts[1];
|
||||
}
|
||||
|
||||
var match = Regex.Match(ActivityModel.Cliente!, @"^\s*(\S+)\s*-\s*(.*)$");
|
||||
if (!match.Success)
|
||||
return;
|
||||
OnAfterChangeValue();
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
ActivityModel.CodAnag = match.Groups[1].Value;
|
||||
ActivityModel.Cliente = match.Groups[2].Value;
|
||||
private async Task OnCommessaSelectedAfter()
|
||||
{
|
||||
var com = SelectedComessa;
|
||||
if (com != null)
|
||||
{
|
||||
ActivityModel.CodJcom = com.CodJcom;
|
||||
ActivityModel.Commessa = com;
|
||||
}
|
||||
else
|
||||
{
|
||||
ActivityModel.CodJcom = null;
|
||||
ActivityModel.Commessa = null;
|
||||
}
|
||||
|
||||
await LoadCommesse();
|
||||
OnAfterChangeValue();
|
||||
}
|
||||
|
||||
private async Task OnCommessaChanged()
|
||||
{
|
||||
ActivityModel.Commessa = (await ManageData.GetTable<JtbComt>(x => x.CodJcom.Equals(ActivityModel.CodJcom))).Last().Descrizione;
|
||||
OnAfterChangeValue();
|
||||
}
|
||||
|
||||
private async Task OnUserChanged()
|
||||
private async Task OnUserSelectedAfter()
|
||||
{
|
||||
ActivityModel.UserName = SelectedUser?.UserName;
|
||||
await LoadActivityType();
|
||||
OnAfterChangeValue();
|
||||
}
|
||||
|
||||
private async Task OnCommessaClear()
|
||||
{
|
||||
ActivityModel.Commessa = null;
|
||||
ActivityModel.CodJcom = null;
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private async Task OnUserClear()
|
||||
{
|
||||
ActivityModel.UserName = null;
|
||||
ActivityType = [];
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private void OnAfterChangeTimeBefore()
|
||||
{
|
||||
if (ActivityModel.EstimatedTime != null)
|
||||
if (ActivityModel.EstimatedTime is not null)
|
||||
{
|
||||
if (ActivityModel.MinuteBefore != -1)
|
||||
ActivityModel.NotificationDate = ActivityModel.MinuteBefore switch
|
||||
{
|
||||
ActivityModel.NotificationDate = ActivityModel.MinuteBefore == 0 ?
|
||||
ActivityModel.EstimatedTime : ActivityModel.EstimatedTime.Value.AddMinutes(ActivityModel.MinuteBefore * -1);
|
||||
}
|
||||
else
|
||||
{
|
||||
ActivityModel.NotificationDate = null;
|
||||
}
|
||||
-1 => null,
|
||||
0 => ActivityModel.EstimatedTime,
|
||||
_ => ActivityModel.EstimatedTime.Value.AddMinutes(ActivityModel.MinuteBefore * -1)
|
||||
};
|
||||
}
|
||||
|
||||
OnAfterChangeValue();
|
||||
@@ -483,28 +565,27 @@
|
||||
private void OnAfterChangeValue()
|
||||
{
|
||||
if (!IsNew)
|
||||
{
|
||||
LabelSave = !OriginalModel.Equals(ActivityModel) ? "Aggiorna" : null;
|
||||
}
|
||||
|
||||
if (ActivityModel.EstimatedEndtime <= ActivityModel.EstimatedTime)
|
||||
if (ActivityModel.EstimatedTime is not null &&
|
||||
(ActivityModel.EstimatedEndtime is null || ActivityModel.EstimatedEndtime <= ActivityModel.EstimatedTime))
|
||||
{
|
||||
ActivityModel.EstimatedEndtime = ActivityModel.EstimatedTime.Value.AddHours(1);
|
||||
}
|
||||
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private async Task OnAfterChangeEsito()
|
||||
private Task OnAfterChangeEsito()
|
||||
{
|
||||
OnAfterChangeValue();
|
||||
|
||||
// var result = await ConfirmMemo.ShowAsync();
|
||||
|
||||
// if (result is true)
|
||||
// OpenAddMemo = !OpenAddMemo;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private void OpenSelectEsito()
|
||||
{
|
||||
if (IsView) 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);
|
||||
@@ -563,16 +644,8 @@
|
||||
var attached = (AttachedDTO)result.Data;
|
||||
|
||||
if (attached.Type == AttachedDTO.TypeAttached.Position)
|
||||
{
|
||||
CanAddPosition = false;
|
||||
|
||||
var resultNamePosition = await AddNamePosition.ShowAsync();
|
||||
|
||||
if (resultNamePosition is true)
|
||||
attached.Description = NamePosition;
|
||||
attached.Name = NamePosition!;
|
||||
}
|
||||
|
||||
AttachedList ??= [];
|
||||
AttachedList.Add(attached);
|
||||
|
||||
|
||||
@@ -4,27 +4,58 @@
|
||||
@using salesbook.Shared.Components.Layout.Overlay
|
||||
@inject IAttachedService AttachedService
|
||||
|
||||
<MudDialog Class="customDialog-form">
|
||||
<MudDialog Class="customDialog-form disable-safe-area">
|
||||
<DialogContent>
|
||||
<HeaderLayout ShowProfile="false" SmallHeader="true" Cancel="true" OnCancel="() => MudDialog.Cancel()" Title="Aggiungi allegati"/>
|
||||
|
||||
<div style="margin-bottom: 1rem;" class="content attached">
|
||||
<MudFab Size="Size.Small" Color="Color.Primary"
|
||||
StartIcon="@Icons.Material.Rounded.Image"
|
||||
Label="Immagini" OnClick="OnImage"/>
|
||||
|
||||
<MudFab Size="Size.Small" Color="Color.Primary"
|
||||
StartIcon="@Icons.Material.Rounded.InsertDriveFile"
|
||||
Label="File" OnClick="OnFile"/>
|
||||
|
||||
@if (CanAddPosition)
|
||||
@if (RequireNewName)
|
||||
{
|
||||
<MudTextField @bind-Value="NewName" Class="px-3" Variant="Variant.Outlined"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
@if (!SelectTypePicture)
|
||||
{
|
||||
<MudFab Size="Size.Small" Color="Color.Primary"
|
||||
StartIcon="@Icons.Material.Rounded.AddLocationAlt"
|
||||
Label="Posizione" OnClick="OnPosition"/>
|
||||
<div style="margin-bottom: 1rem;" class="content attached">
|
||||
<MudFab Size="Size.Small" Color="Color.Primary"
|
||||
StartIcon="@Icons.Material.Rounded.Image"
|
||||
Label="Immagini" OnClick="OnImage"/>
|
||||
|
||||
<MudFab Size="Size.Small" Color="Color.Primary"
|
||||
StartIcon="@Icons.Material.Rounded.InsertDriveFile"
|
||||
Label="File" OnClick="OnFile"/>
|
||||
|
||||
@if (CanAddPosition)
|
||||
{
|
||||
<MudFab Size="Size.Small" Color="Color.Primary"
|
||||
StartIcon="@Icons.Material.Rounded.AddLocationAlt"
|
||||
Label="Posizione" OnClick="OnPosition"/>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
else
|
||||
{
|
||||
<div style="margin-bottom: 1rem;" class="content attached">
|
||||
<MudFab Size="Size.Small" Color="Color.Primary"
|
||||
StartIcon="@Icons.Material.Rounded.CameraAlt"
|
||||
Label="Camera" OnClick="OnCamera"/>
|
||||
|
||||
<MudFab Size="Size.Small" Color="Color.Primary"
|
||||
StartIcon="@Icons.Material.Rounded.Image"
|
||||
Label="Galleria" OnClick="OnGallery"/>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
@if (RequireNewName)
|
||||
{
|
||||
<MudButton Disabled="NewName.IsNullOrEmpty()" Class="my-3" Size="Size.Small" Variant="Variant.Filled" Color="Color.Primary"
|
||||
StartIcon="@Icons.Material.Rounded.Check" OnClick="OnNewName">
|
||||
Salva
|
||||
</MudButton>
|
||||
}
|
||||
</DialogActions>
|
||||
</MudDialog>
|
||||
|
||||
<SaveOverlay VisibleOverlay="VisibleOverlay" SuccessAnimation="SuccessAnimation"/>
|
||||
@@ -40,34 +71,47 @@
|
||||
|
||||
private AttachedDTO? Attached { get; set; }
|
||||
|
||||
private bool RequireNewName { get; set; }
|
||||
private bool SelectTypePicture { get; set; }
|
||||
|
||||
private string? _newName;
|
||||
private string? NewName
|
||||
{
|
||||
get => _newName;
|
||||
set
|
||||
{
|
||||
_newName = value;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
SelectTypePicture = false;
|
||||
RequireNewName = false;
|
||||
Snackbar.Configuration.PositionClass = Defaults.Classes.Position.TopCenter;
|
||||
|
||||
_ = LoadData();
|
||||
}
|
||||
|
||||
private async Task LoadData()
|
||||
{
|
||||
}
|
||||
|
||||
private async Task Save()
|
||||
{
|
||||
VisibleOverlay = true;
|
||||
StateHasChanged();
|
||||
|
||||
SuccessAnimation = true;
|
||||
StateHasChanged();
|
||||
|
||||
await Task.Delay(1250);
|
||||
|
||||
MudDialog.Close();
|
||||
}
|
||||
|
||||
private async Task OnImage()
|
||||
{
|
||||
Attached = await AttachedService.SelectImage();
|
||||
MudDialog.Close(Attached);
|
||||
SelectTypePicture = true;
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private async Task OnCamera()
|
||||
{
|
||||
Attached = await AttachedService.SelectImageFromCamera();
|
||||
|
||||
RequireNewName = true;
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private async Task OnGallery()
|
||||
{
|
||||
Attached = await AttachedService.SelectImageFromGallery();
|
||||
|
||||
RequireNewName = true;
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private async Task OnFile()
|
||||
@@ -79,6 +123,37 @@
|
||||
private async Task OnPosition()
|
||||
{
|
||||
Attached = await AttachedService.SelectPosition();
|
||||
|
||||
RequireNewName = true;
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private void OnNewName()
|
||||
{
|
||||
switch (Attached.Type)
|
||||
{
|
||||
case AttachedDTO.TypeAttached.Position:
|
||||
{
|
||||
CanAddPosition = false;
|
||||
|
||||
Attached.Description = NewName!;
|
||||
Attached.Name = NewName!;
|
||||
|
||||
break;
|
||||
}
|
||||
case AttachedDTO.TypeAttached.Image:
|
||||
{
|
||||
var extension = Path.GetExtension(Attached.Name);
|
||||
Attached.Name = NewName! + extension;
|
||||
|
||||
break;
|
||||
}
|
||||
case AttachedDTO.TypeAttached.Document:
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
|
||||
MudDialog.Close(Attached);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
.content.attached {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2rem;
|
||||
padding: 1rem;
|
||||
height: unset;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@@ -87,19 +87,18 @@
|
||||
<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>
|
||||
}
|
||||
<MudAutocomplete Disabled="VtbTipi.IsNullOrEmpty()" ReadOnly="IsView"
|
||||
T="VtbTipi"
|
||||
@bind-Value="SelectedType"
|
||||
@bind-Value:after="OnTypeSelectedAfter"
|
||||
SearchFunc="SearchTypeAsync"
|
||||
ToStringFunc="@(u => u == null ? string.Empty : $"{u.CodVtip} - {u.Descrizione}")"
|
||||
Clearable="true"
|
||||
ShowProgressIndicator="true"
|
||||
DebounceInterval="300"
|
||||
MaxItems="50"
|
||||
Class="customIcon-select"
|
||||
AdornmentIcon="@Icons.Material.Filled.Code" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -242,14 +241,18 @@
|
||||
<div class="form-container">
|
||||
<span class="disable-full-width">Agente</span>
|
||||
|
||||
<MudSelectExtended FullWidth="true" T="string?" Variant="Variant.Text" NoWrap="true"
|
||||
@bind-Value="ContactModel.CodVage" @bind-Value:after="OnAfterChangeValue"
|
||||
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>
|
||||
<MudAutocomplete Disabled="Users.IsNullOrEmpty()" ReadOnly="IsView"
|
||||
T="StbUser"
|
||||
@bind-Value="SelectedUser"
|
||||
@bind-Value:after="OnUserSelectedAfter"
|
||||
SearchFunc="SearchUtentiAsync"
|
||||
ToStringFunc="@(u => u == null ? string.Empty : u.FullName)"
|
||||
Clearable="true"
|
||||
ShowProgressIndicator="true"
|
||||
DebounceInterval="300"
|
||||
MaxItems="50"
|
||||
Class="customIcon-select"
|
||||
AdornmentIcon="@Icons.Material.Filled.Code" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -268,9 +271,9 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="container-button">
|
||||
@if (IsNew)
|
||||
{
|
||||
@if (IsNew)
|
||||
{
|
||||
<div class="container-button">
|
||||
<MudButton Class="button-settings gray-icon"
|
||||
FullWidth="true"
|
||||
StartIcon="@Icons.Material.Filled.PersonAddAlt1"
|
||||
@@ -279,11 +282,13 @@
|
||||
Variant="Variant.Outlined">
|
||||
Persona di riferimento
|
||||
</MudButton>
|
||||
}
|
||||
else
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
@if (NetworkService.ConnectionAvailable && !ContactModel.IsContact)
|
||||
{
|
||||
@if (NetworkService.ConnectionAvailable && !ContactModel.IsContact)
|
||||
{
|
||||
<div class="container-button">
|
||||
<MudButton Class="button-settings blue-icon"
|
||||
FullWidth="true"
|
||||
StartIcon="@Icons.Material.Rounded.Sync"
|
||||
@@ -292,9 +297,9 @@
|
||||
Variant="Variant.Outlined">
|
||||
Converti in cliente
|
||||
</MudButton>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<MudMessageBox MarkupMessage="new MarkupString(VatMessage)" @ref="CheckVat" Class="c-messageBox" Title="Verifica partita iva" CancelText="@(VatAlreadyRegistered ? "" : "Annulla")">
|
||||
@@ -351,11 +356,17 @@
|
||||
private bool OpenSearchAddress { get; set; }
|
||||
private IndirizzoDTO Address { get; set; }
|
||||
|
||||
//Agente
|
||||
private StbUser? SelectedUser { get; set; }
|
||||
|
||||
//Type
|
||||
private VtbTipi? SelectedType { get; set; }
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
Snackbar.Configuration.PositionClass = Defaults.Classes.Position.TopCenter;
|
||||
|
||||
await LoadData();
|
||||
_ = LoadData();
|
||||
|
||||
LabelSave = IsNew ? "Aggiungi" : null;
|
||||
}
|
||||
@@ -403,24 +414,27 @@
|
||||
MudDialog.Close(response);
|
||||
}
|
||||
|
||||
private async Task LoadData()
|
||||
private Task LoadData()
|
||||
{
|
||||
if (IsNew)
|
||||
return Task.Run(async () =>
|
||||
{
|
||||
var loggedUser = (await ManageData.GetTable<StbUser>(x => x.UserName.Equals(UserSession.User.Username))).Last();
|
||||
if (IsNew)
|
||||
{
|
||||
var loggedUser = (await ManageData.GetTable<StbUser>(x => x.UserName.Equals(UserSession.User.Username))).Last();
|
||||
|
||||
ContactModel.IsContact = false;
|
||||
ContactModel.Nazione = "IT";
|
||||
ContactModel.CodVage = loggedUser.UserCode;
|
||||
}
|
||||
else
|
||||
{
|
||||
ContactModel = OriginalModel!.Clone();
|
||||
}
|
||||
ContactModel.IsContact = false;
|
||||
ContactModel.Nazione = "IT";
|
||||
ContactModel.CodVage = loggedUser.UserCode;
|
||||
}
|
||||
else
|
||||
{
|
||||
ContactModel = OriginalModel!.Clone();
|
||||
}
|
||||
|
||||
Users = await ManageData.GetTable<StbUser>(x => x.KeyGroup == 5);
|
||||
Nazioni = await ManageData.GetTable<Nazioni>();
|
||||
VtbTipi = await ManageData.GetTable<VtbTipi>();
|
||||
Users = await ManageData.GetTable<StbUser>(x => x.KeyGroup == 5);
|
||||
Nazioni = await ManageData.GetTable<Nazioni>();
|
||||
VtbTipi = await ManageData.GetTable<VtbTipi>();
|
||||
});
|
||||
}
|
||||
|
||||
private void OnAfterChangeValue()
|
||||
@@ -562,9 +576,83 @@
|
||||
|
||||
private async Task ConvertProspectToContact()
|
||||
{
|
||||
await IntegryApiService.TransferProspect(new CRMTransferProspectRequestDTO
|
||||
VisibleOverlay = true;
|
||||
StateHasChanged();
|
||||
|
||||
var response = await IntegryApiService.TransferProspect(new CRMTransferProspectRequestDTO
|
||||
{
|
||||
CodPpro = ContactModel.CodContact
|
||||
});
|
||||
|
||||
await ManageData.DeleteProspect(ContactModel.CodContact);
|
||||
|
||||
if (response.AnagClie != null)
|
||||
await ManageData.InsertOrUpdate(response.AnagClie);
|
||||
|
||||
if (response.VtbCliePersRif != null)
|
||||
await ManageData.InsertOrUpdate(response.VtbCliePersRif);
|
||||
|
||||
if (response.VtbDest != null)
|
||||
await ManageData.InsertOrUpdate(response.VtbDest);
|
||||
|
||||
SuccessAnimation = true;
|
||||
StateHasChanged();
|
||||
|
||||
await Task.Delay(1250);
|
||||
MudDialog.Close(response.AnagClie);
|
||||
}
|
||||
|
||||
private async Task OnUserSelectedAfter()
|
||||
{
|
||||
ContactModel.CodVage = SelectedUser?.UserCode;
|
||||
OnAfterChangeValue();
|
||||
}
|
||||
|
||||
private Task<IEnumerable<StbUser>> SearchUtentiAsync(string value, CancellationToken token)
|
||||
{
|
||||
IEnumerable<StbUser> list;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(value))
|
||||
{
|
||||
list = Users.OrderBy(u => u.FullName).Take(50);
|
||||
}
|
||||
else
|
||||
{
|
||||
list = Users
|
||||
.Where(x => x.UserName.Contains(value, StringComparison.OrdinalIgnoreCase)
|
||||
|| x.FullName.Contains(value, StringComparison.OrdinalIgnoreCase))
|
||||
.OrderBy(u => u.FullName)
|
||||
.Take(50);
|
||||
}
|
||||
|
||||
return Task.FromResult(token.IsCancellationRequested ? [] : list);
|
||||
}
|
||||
|
||||
private async Task OnTypeSelectedAfter()
|
||||
{
|
||||
ContactModel.CodVtip = SelectedType?.CodVtip;
|
||||
OnAfterChangeValue();
|
||||
}
|
||||
|
||||
private Task<IEnumerable<VtbTipi>> SearchTypeAsync(string value, CancellationToken token)
|
||||
{
|
||||
IEnumerable<VtbTipi> list = [];
|
||||
|
||||
if (VtbTipi == null) return Task.FromResult(token.IsCancellationRequested ? [] : list);
|
||||
|
||||
if (string.IsNullOrWhiteSpace(value))
|
||||
{
|
||||
list = VtbTipi.OrderBy(u => u.CodVtip);
|
||||
}
|
||||
else
|
||||
{
|
||||
list = VtbTipi
|
||||
.Where(x => x.CodVtip.Contains(value, StringComparison.OrdinalIgnoreCase)
|
||||
|| x.Descrizione.Contains(value, StringComparison.OrdinalIgnoreCase))
|
||||
.OrderBy(u => u.CodVtip)
|
||||
.Take(50);
|
||||
}
|
||||
|
||||
return Task.FromResult(token.IsCancellationRequested ? [] : list);
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ namespace salesbook.Shared.Core.Dto.Activity;
|
||||
|
||||
public class ActivityDTO : StbActivity
|
||||
{
|
||||
public string? Commessa { get; set; }
|
||||
public JtbComt? Commessa { get; set; }
|
||||
public string? Cliente { get; set; }
|
||||
public ActivityCategoryEnum Category { get; set; }
|
||||
public bool Complete { get; set; }
|
||||
|
||||
@@ -7,4 +7,10 @@ public class CRMTransferProspectResponseDTO
|
||||
{
|
||||
[JsonPropertyName("anagClie")]
|
||||
public AnagClie? AnagClie { get; set; }
|
||||
|
||||
[JsonPropertyName("vtbDest")]
|
||||
public List<VtbDest>? VtbDest { get; set; }
|
||||
|
||||
[JsonPropertyName("vtbCliePersRif")]
|
||||
public List<VtbCliePersRif>? VtbCliePersRif { get; set; }
|
||||
}
|
||||
@@ -4,6 +4,9 @@ namespace salesbook.Shared.Core.Dto;
|
||||
|
||||
public class NotificationDataDTO
|
||||
{
|
||||
[JsonPropertyName("notificationId")]
|
||||
public string? NotificationId { get; set; }
|
||||
|
||||
[JsonPropertyName("activityId")]
|
||||
public string? ActivityId { get; set; }
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ public class UserListState
|
||||
public List<UserDisplayItem>? GroupedUserList { get; set; }
|
||||
public List<UserDisplayItem>? FilteredGroupedUserList { get; set; }
|
||||
|
||||
public List<ContactDTO>? AllUsers { get; set; }
|
||||
|
||||
public bool IsLoaded { get; set; }
|
||||
public bool IsLoading { get; set; }
|
||||
|
||||
|
||||
@@ -14,4 +14,6 @@ public class UserPageState
|
||||
public StbUser? Agente { get; set; }
|
||||
public Dictionary<string, List<CRMJobStepDTO>?> Steps { get; set; }
|
||||
public List<ActivityDTO> Activitys { get; set; }
|
||||
|
||||
public int ActiveTab { get; set; }
|
||||
}
|
||||
@@ -80,7 +80,8 @@ public class ModalHelpers
|
||||
{
|
||||
FullScreen = false,
|
||||
CloseButton = false,
|
||||
NoHeader = true
|
||||
NoHeader = true,
|
||||
BackdropClick = false
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@ namespace salesbook.Shared.Core.Interface;
|
||||
|
||||
public interface IAttachedService
|
||||
{
|
||||
Task<AttachedDTO?> SelectImage();
|
||||
Task<AttachedDTO?> SelectImageFromCamera();
|
||||
Task<AttachedDTO?> SelectImageFromGallery();
|
||||
Task<AttachedDTO?> SelectFile();
|
||||
Task<AttachedDTO?> SelectPosition();
|
||||
Task OpenFile(Stream file, string fileName);
|
||||
|
||||
@@ -12,16 +12,20 @@ public interface IManageDataService
|
||||
|
||||
Task<List<AnagClie>> GetClienti(WhereCondContact? whereCond = null);
|
||||
Task<List<PtbPros>> GetProspect(WhereCondContact? whereCond = null);
|
||||
Task<List<ContactDTO>> GetContact(WhereCondContact whereCond);
|
||||
Task<List<ContactDTO>> GetContact(WhereCondContact whereCond, DateTime? lastSync = null);
|
||||
Task<ContactDTO?> GetSpecificContact(string codAnag, bool IsContact);
|
||||
|
||||
Task<List<ActivityDTO>> GetActivityTryLocalDb(WhereCondActivity whereCond);
|
||||
Task<List<ActivityDTO>> GetActivity(WhereCondActivity whereCond, bool useLocalDb = false);
|
||||
|
||||
Task InsertOrUpdate<T>(T objectToSave);
|
||||
Task InsertOrUpdate<T>(List<T> listToSave);
|
||||
|
||||
Task DeleteProspect(string codPpro);
|
||||
Task Delete<T>(T objectToDelete);
|
||||
Task DeleteActivity(ActivityDTO activity);
|
||||
|
||||
Task<List<ActivityDTO>> MapActivity(List<StbActivity>? activities);
|
||||
|
||||
Task ClearDb();
|
||||
}
|
||||
7
salesbook.Shared/Core/Interface/INotificationService.cs
Normal file
7
salesbook.Shared/Core/Interface/INotificationService.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace salesbook.Shared.Core.Interface;
|
||||
|
||||
public interface INotificationService
|
||||
{
|
||||
Task LoadNotification();
|
||||
void OrderNotificationList();
|
||||
}
|
||||
@@ -4,7 +4,7 @@ namespace salesbook.Shared.Core.Interface.IntegryApi;
|
||||
|
||||
public interface IIntegryNotificationRestClient
|
||||
{
|
||||
Task<List<WtbNotification>> Get();
|
||||
Task<List<WtbNotification>?> Get();
|
||||
Task<WtbNotification> MarkAsRead(long id);
|
||||
Task Delete(long id);
|
||||
Task DeleteAll();
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
using CommunityToolkit.Mvvm.Messaging.Messages;
|
||||
|
||||
namespace salesbook.Shared.Core.Messages.Notification.Loaded;
|
||||
|
||||
public class NotificationsLoadedMessage(object? value = null) : ValueChangedMessage<object?>(value);
|
||||
@@ -0,0 +1,13 @@
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
|
||||
namespace salesbook.Shared.Core.Messages.Notification.Loaded;
|
||||
|
||||
public class NotificationsLoadedService
|
||||
{
|
||||
public event Action? OnNotificationsLoaded;
|
||||
|
||||
public NotificationsLoadedService(IMessenger messenger)
|
||||
{
|
||||
messenger.Register<NotificationsLoadedMessage>(this, (_, _) => { OnNotificationsLoaded?.Invoke(); });
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using CommunityToolkit.Mvvm.Messaging.Messages;
|
||||
using salesbook.Shared.Core.Entity;
|
||||
|
||||
namespace salesbook.Shared.Core.Messages.Notification;
|
||||
namespace salesbook.Shared.Core.Messages.Notification.NewPush;
|
||||
|
||||
public class NewPushNotificationMessage(WtbNotification value) : ValueChangedMessage<WtbNotification>(value);
|
||||
@@ -1,7 +1,7 @@
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using salesbook.Shared.Core.Entity;
|
||||
|
||||
namespace salesbook.Shared.Core.Messages.Notification;
|
||||
namespace salesbook.Shared.Core.Messages.Notification.NewPush;
|
||||
|
||||
public class NewPushNotificationService
|
||||
{
|
||||
@@ -10,7 +10,7 @@ public class IntegryNotificationRestClient(
|
||||
IUserSession userSession,
|
||||
IIntegryApiRestClient integryApiRestClient) : IIntegryNotificationRestClient
|
||||
{
|
||||
public Task<List<WtbNotification>> Get()
|
||||
public Task<List<WtbNotification>?> Get()
|
||||
{
|
||||
var queryParams = new Dictionary<string, object>
|
||||
{
|
||||
@@ -18,7 +18,7 @@ public class IntegryNotificationRestClient(
|
||||
{ "forUser", userSession.User.Username }
|
||||
};
|
||||
|
||||
return integryApiRestClient.Get<List<WtbNotification>>("notification", queryParams)!;
|
||||
return integryApiRestClient.Get<List<WtbNotification>>("notification", queryParams);
|
||||
}
|
||||
|
||||
public Task<WtbNotification> MarkAsRead(long id) =>
|
||||
|
||||
47
salesbook.Shared/Core/Services/NotificationService.cs
Normal file
47
salesbook.Shared/Core/Services/NotificationService.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using salesbook.Shared.Core.Dto.PageState;
|
||||
using salesbook.Shared.Core.Interface;
|
||||
using salesbook.Shared.Core.Interface.IntegryApi;
|
||||
|
||||
namespace salesbook.Shared.Core.Services;
|
||||
|
||||
public class NotificationService(
|
||||
IIntegryNotificationRestClient integryNotificationRestClient,
|
||||
NotificationState Notification
|
||||
) : INotificationService
|
||||
{
|
||||
public async Task LoadNotification()
|
||||
{
|
||||
var allNotifications = await integryNotificationRestClient.Get();
|
||||
if (allNotifications == null) return;
|
||||
|
||||
var allIds = allNotifications.Select(n => n.Id).ToHashSet();
|
||||
|
||||
Notification.ReceivedNotifications = Notification.ReceivedNotifications
|
||||
.Where(r => !allIds.Contains(r.Id))
|
||||
.ToList();
|
||||
|
||||
Notification.UnreadNotifications = allNotifications
|
||||
.Where(x =>
|
||||
x.WtbDeviceNotifications == null ||
|
||||
x.WtbDeviceNotifications.Any(y => y.ReadDate == null))
|
||||
.ToList();
|
||||
|
||||
Notification.NotificationsRead = allNotifications
|
||||
.Where(x =>
|
||||
x.WtbDeviceNotifications != null &&
|
||||
x.WtbDeviceNotifications.All(y => y.ReadDate != null))
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public void OrderNotificationList()
|
||||
{
|
||||
Notification.ReceivedNotifications = Notification.ReceivedNotifications
|
||||
.OrderByDescending(x => x.StartDate).ToList();
|
||||
|
||||
Notification.UnreadNotifications = Notification.UnreadNotifications
|
||||
.OrderByDescending(x => x.StartDate).ToList();
|
||||
|
||||
Notification.NotificationsRead = Notification.NotificationsRead
|
||||
.OrderByDescending(x => x.StartDate).ToList();
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,7 @@ public class PreloadService(IManageDataService manageData, UserListState userSta
|
||||
|
||||
userState.GroupedUserList = BuildGroupedList(sorted);
|
||||
userState.FilteredGroupedUserList = userState.GroupedUserList;
|
||||
userState.AllUsers = users;
|
||||
|
||||
userState.NotifyUsersLoaded();
|
||||
}
|
||||
|
||||
@@ -4,8 +4,10 @@ namespace salesbook.Shared.Core.Utility;
|
||||
|
||||
public static class UtilityString
|
||||
{
|
||||
public static string ExtractInitials(string fullname)
|
||||
public static string ExtractInitials(string? fullname)
|
||||
{
|
||||
if (fullname == null) return "";
|
||||
|
||||
return string.Concat(fullname
|
||||
.Split(' ', StringSplitOptions.RemoveEmptyEntries)
|
||||
.Take(3)
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
<PackageReference Include="CodeBeam.MudBlazor.Extensions" Version="8.2.2" />
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
|
||||
<PackageReference Include="IntegryApiClient.Core" Version="1.2.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.6" />
|
||||
<PackageReference Include="Microsoft.Maui.Essentials" Version="9.0.81" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.9" />
|
||||
<PackageReference Include="Microsoft.Maui.Essentials" Version="9.0.110" />
|
||||
<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="System.IdentityModel.Tokens.Jwt" Version="8.14.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="9.0.9" />
|
||||
<PackageReference Include="MudBlazor" Version="8.12.0" />
|
||||
<PackageReference Include="MudBlazor.ThemeManager" Version="3.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
html { overflow: hidden; }
|
||||
|
||||
.page, article, main { height: 100% !important; }
|
||||
.page, article, main { height: 100% !important; overflow: hidden; }
|
||||
|
||||
#app { height: 100vh; }
|
||||
|
||||
@@ -28,6 +28,7 @@ article {
|
||||
}
|
||||
|
||||
/*ServicesIsDown" : "SystemOk" : "NetworkKo*/
|
||||
|
||||
.Connection {
|
||||
padding: 0 .75rem;
|
||||
font-weight: 700;
|
||||
@@ -57,13 +58,11 @@ article {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.page > .Connection.Hide ~ main {
|
||||
.Connection.Hide ~ .page {
|
||||
transition: all 0.5s ease;
|
||||
transform: translateY(-35px);
|
||||
}
|
||||
|
||||
.page > .Connection.Hide ~ main .bottom-sheet-container.show { bottom: -35px; }
|
||||
|
||||
.btn-primary {
|
||||
color: #fff;
|
||||
background-color: var(--primary-color);
|
||||
@@ -269,8 +268,7 @@ h1:focus { outline: none; }
|
||||
|
||||
#app {
|
||||
margin-top: env(safe-area-inset-top);
|
||||
margin-bottom: env(safe-area-inset-bottom);
|
||||
height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
|
||||
height: calc(100vh - env(safe-area-inset-top));
|
||||
}
|
||||
|
||||
.flex-column, .navbar-brand { padding-left: env(safe-area-inset-left); }
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
/*Utility*/
|
||||
--exception-box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.3);
|
||||
--custom-box-shadow: 1px 2px 5px var(--gray-for-shadow);
|
||||
--mud-default-borderradius: 12px !important;
|
||||
--mud-default-borderradius: 20px !important;
|
||||
--m-page-x: 1rem;
|
||||
--mh-header: 4rem;
|
||||
|
||||
--light-card-background: hsl(from var(--mud-palette-background-gray) h s 97%);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.customDialog-form.disable-safe-area .mud-dialog-content { margin-top: unset !important; }
|
||||
|
||||
.customDialog-form.disable-safe-area .content { height: 100% !important; }
|
||||
|
||||
.customDialog-form .content {
|
||||
height: calc(100vh - (.6rem + 40px));
|
||||
overflow: auto;
|
||||
@@ -12,6 +16,14 @@
|
||||
scrollbar-width: none;
|
||||
}
|
||||
|
||||
@supports (-webkit-touch-callout: none) {
|
||||
.customDialog-form .content { height: calc(100vh - (.6rem + 40px) - env(safe-area-inset-top)) !important; }
|
||||
|
||||
.customDialog-form.disable-safe-area .content { height: 100% !important; }
|
||||
|
||||
.customDialog-form.disable-safe-area .mud-dialog-content { margin-top: unset !important; }
|
||||
}
|
||||
|
||||
.customDialog-form .header { padding: 0 !important; }
|
||||
|
||||
.customDialog-form .content::-webkit-scrollbar { display: none; }
|
||||
@@ -31,6 +43,8 @@
|
||||
padding: .4rem 1rem !important;
|
||||
}
|
||||
|
||||
.input-card.clearButton.custom-border-bottom { border-bottom: .1rem solid var(--card-border-color); }
|
||||
|
||||
.input-card > .divider { margin: 0 !important; }
|
||||
|
||||
.form-container {
|
||||
@@ -92,7 +106,7 @@
|
||||
|
||||
.container-button {
|
||||
width: 100%;
|
||||
box-shadow: var(--custom-box-shadow);
|
||||
background: var(--light-card-background);
|
||||
padding: .5rem 0;
|
||||
border-radius: 12px;
|
||||
margin-bottom: 2rem;
|
||||
|
||||
@@ -145,13 +145,17 @@ function initRow(row) {
|
||||
}
|
||||
|
||||
function removeRow(row) {
|
||||
//collapseAndRemove(row);
|
||||
dotnetHelper.invokeMethodAsync('Delete', row.id);
|
||||
const id = row.id;
|
||||
|
||||
collapseAndRemove(row);
|
||||
dotnetHelper.invokeMethodAsync('Delete', id);
|
||||
}
|
||||
|
||||
function markAsRead(row) {
|
||||
//collapseAndRemove(row);
|
||||
dotnetHelper.invokeMethodAsync('MarkAsRead', row.id);
|
||||
const id = row.id;
|
||||
|
||||
collapseAndRemove(row);
|
||||
dotnetHelper.invokeMethodAsync('MarkAsRead', id);
|
||||
}
|
||||
|
||||
function collapseAndRemove(row) {
|
||||
|
||||
@@ -14,17 +14,17 @@ public class ManageDataService : IManageDataService
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<List<AnagClie>> GetClienti(WhereCondContact? whereCond)
|
||||
public Task<List<AnagClie>> GetClienti(WhereCondContact? whereCond = null)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<List<PtbPros>> GetProspect(WhereCondContact? whereCond)
|
||||
public Task<List<PtbPros>> GetProspect(WhereCondContact? whereCond = null)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<List<ContactDTO>> GetContact(WhereCondContact whereCond)
|
||||
public Task<List<ContactDTO>> GetContact(WhereCondContact whereCond, DateTime? lastSync = null)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
@@ -34,6 +34,11 @@ public class ManageDataService : IManageDataService
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<List<ActivityDTO>> GetActivityTryLocalDb(WhereCondActivity whereCond)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<List<ActivityDTO>> GetActivity(WhereCondActivity whereCond, bool useLocalDb = false)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
@@ -49,6 +54,11 @@ public class ManageDataService : IManageDataService
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task DeleteProspect(string codPpro)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task Delete<T>(T objectToDelete)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
@@ -59,6 +69,11 @@ public class ManageDataService : IManageDataService
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<List<ActivityDTO>> MapActivity(List<StbActivity>? activities)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task ClearDb()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="IntegryApiClient.Blazor" Version="1.2.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.6" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.6" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.6" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.9" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.9" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.9" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user