generated from Integry/Template_NetMauiBlazorHybrid
Compare commits
27 Commits
v2.1.0(16)
...
39c34e7c7d
| Author | SHA1 | Date | |
|---|---|---|---|
| 39c34e7c7d | |||
| 1f530bc130 | |||
| a4c2eee49d | |||
| 70a34eef06 | |||
| c61ebe348c | |||
| e586279c6b | |||
| 85e227a5cb | |||
| 71ce027fb8 | |||
| 9318d7bd3f | |||
| 3ae0a7f7d1 | |||
| 2879008c20 | |||
| 0dfc0baa28 | |||
| b423ce8d16 | |||
| 514f98a8a7 | |||
| a26f1a57cc | |||
| f4b2e70881 | |||
| bb0bf1e496 | |||
| d0f961b052 | |||
| 61ea1776b3 | |||
| 8dcd61b697 | |||
| 2480a6a60c | |||
| dd5f354b14 | |||
| 6a8414ff6c | |||
| b93f2f2d16 | |||
| a741d60e01 | |||
| 5c1c9130ec | |||
| 8a97506dfd |
@@ -175,9 +175,7 @@ public class ManageDataService(
|
||||
|
||||
public async Task<List<ActivityDTO>> GetActivityTryLocalDb(WhereCondActivity whereCond)
|
||||
{
|
||||
List<StbActivity>? activities;
|
||||
|
||||
activities = await localDb.Get<StbActivity>(x =>
|
||||
var activities = await localDb.Get<StbActivity>(x =>
|
||||
(whereCond.ActivityId != null && x.ActivityId != null && whereCond.ActivityId.Equals(x.ActivityId)) ||
|
||||
(whereCond.Start != null && whereCond.End != null && x.EffectiveTime == null &&
|
||||
x.EstimatedTime >= whereCond.Start && x.EstimatedTime <= whereCond.End) ||
|
||||
@@ -198,6 +196,7 @@ public class ManageDataService(
|
||||
|
||||
_ = UpdateDb(activities);
|
||||
}
|
||||
else return [];
|
||||
|
||||
return await MapActivity(activities);
|
||||
}
|
||||
@@ -219,16 +218,7 @@ public class ManageDataService(
|
||||
|
||||
_ = UpdateDb(activities);
|
||||
}
|
||||
else
|
||||
{
|
||||
activities = await localDb.Get<StbActivity>(x =>
|
||||
(whereCond.ActivityId != null && x.ActivityId != null && whereCond.ActivityId.Equals(x.ActivityId)) ||
|
||||
(whereCond.Start != null && whereCond.End != null && x.EffectiveTime == null &&
|
||||
x.EstimatedTime >= whereCond.Start && x.EstimatedTime <= whereCond.End) ||
|
||||
(x.EffectiveTime >= whereCond.Start && x.EffectiveTime <= whereCond.End) ||
|
||||
(whereCond.ActivityId == null && (whereCond.Start == null || whereCond.End == null))
|
||||
);
|
||||
}
|
||||
else return await GetActivityTryLocalDb(whereCond);
|
||||
|
||||
return await MapActivity(activities);
|
||||
}
|
||||
|
||||
@@ -51,6 +51,9 @@
|
||||
<key>NSPhotoLibraryAddUsageDescription</key>
|
||||
<string>Permette all'app di salvare file o immagini nella tua libreria fotografica se necessario.</string>
|
||||
|
||||
<key>NSBluetoothAlwaysUsageDescription</key>
|
||||
<string>Alcune librerie di sistema potrebbero accedere al Bluetooth. L’app non utilizza direttamente il Bluetooth.</string>
|
||||
|
||||
<key>UIBackgroundModes</key>
|
||||
<array>
|
||||
<string>remote-notification</string>
|
||||
|
||||
@@ -2,10 +2,34 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSPrivacyTracking</key>
|
||||
<false />
|
||||
<key>NSPrivacyTrackingDomains</key>
|
||||
<array />
|
||||
<key>NSPrivacyAccessedAPITypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>NSPrivacyAccessedAPIType</key>
|
||||
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
|
||||
<key>NSPrivacyAccessedAPITypeReasons</key>
|
||||
<array>
|
||||
<string>CA92.1</string>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>NSPrivacyAccessedAPIType</key>
|
||||
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
|
||||
<key>NSPrivacyAccessedAPITypeReasons</key>
|
||||
<array>
|
||||
<string>35F9.1</string>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>NSPrivacyAccessedAPIType</key>
|
||||
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
|
||||
<key>NSPrivacyAccessedAPITypeReasons</key>
|
||||
<array>
|
||||
<string>C617.1</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
|
||||
<key>NSPrivacyCollectedDataTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
@@ -14,10 +38,10 @@
|
||||
<key>NSPrivacyCollectedDataTypeLinked</key>
|
||||
<false />
|
||||
<key>NSPrivacyCollectedDataTypeTracking</key>
|
||||
<true />
|
||||
<false />
|
||||
<key>NSPrivacyCollectedDataTypePurposes</key>
|
||||
<array>
|
||||
<string>NSPrivacyCollectedDataTypePurposeAnalytics</string>
|
||||
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
@@ -26,10 +50,10 @@
|
||||
<key>NSPrivacyCollectedDataTypeLinked</key>
|
||||
<false />
|
||||
<key>NSPrivacyCollectedDataTypeTracking</key>
|
||||
<true />
|
||||
<false />
|
||||
<key>NSPrivacyCollectedDataTypePurposes</key>
|
||||
<array>
|
||||
<string>NSPrivacyCollectedDataTypePurposeAnalytics</string>
|
||||
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
@@ -38,10 +62,10 @@
|
||||
<key>NSPrivacyCollectedDataTypeLinked</key>
|
||||
<false />
|
||||
<key>NSPrivacyCollectedDataTypeTracking</key>
|
||||
<true />
|
||||
<false />
|
||||
<key>NSPrivacyCollectedDataTypePurposes</key>
|
||||
<array>
|
||||
<string>NSPrivacyCollectedDataTypePurposeAnalytics</string>
|
||||
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
@@ -81,7 +105,5 @@
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>NSPrivacyAccessedAPITypes</key>
|
||||
<array />
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -29,8 +29,8 @@
|
||||
<ApplicationId>it.integry.salesbook</ApplicationId>
|
||||
|
||||
<!-- Versions -->
|
||||
<ApplicationDisplayVersion>2.1.0</ApplicationDisplayVersion>
|
||||
<ApplicationVersion>16</ApplicationVersion>
|
||||
<ApplicationDisplayVersion>2.1.5</ApplicationDisplayVersion>
|
||||
<ApplicationVersion>23</ApplicationVersion>
|
||||
|
||||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
|
||||
<!--<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
|
||||
@@ -120,6 +120,7 @@
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<PublishAot>true</PublishAot>
|
||||
<MonoAotMode>Hybrid</MonoAotMode>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -492,6 +492,8 @@
|
||||
// Selezione giorno in settimana
|
||||
private async Task SelezionaData(DateTime day)
|
||||
{
|
||||
if (IsLoading) return;
|
||||
|
||||
SelectedDate = day;
|
||||
|
||||
var cacheInternalMonth = _internalMonth;
|
||||
@@ -513,6 +515,8 @@
|
||||
// Selezione giorno dal mese (chiude la vista mese!)
|
||||
private async Task SelezionaDataDalMese(DateTime day)
|
||||
{
|
||||
if (IsLoading) return;
|
||||
|
||||
SelectedDate = day;
|
||||
SliderAnimation = "collapse-animation";
|
||||
Expanded = false;
|
||||
|
||||
@@ -15,12 +15,22 @@
|
||||
@inject PreloadService PreloadService
|
||||
@inject IMessenger Messenger
|
||||
|
||||
<SpinnerLayout FullScreen="true" />
|
||||
<SpinnerLayout FullScreen="true"/>
|
||||
|
||||
@code
|
||||
{
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
var lastSyncDate = LocalStorage.Get<DateTime>("last-sync");
|
||||
var syncAllData = lastSyncDate.Equals(DateTime.MinValue) || (DateTime.Now - lastSyncDate).TotalDays >= 7;
|
||||
|
||||
if (!FormFactor.IsWeb() && NetworkService.ConnectionAvailable && syncAllData)
|
||||
{
|
||||
var returnPath = System.Web.HttpUtility.UrlEncode("/");
|
||||
NavigationManager.NavigateTo($"/sync?path={returnPath}");
|
||||
return;
|
||||
}
|
||||
|
||||
NetworkService.ConnectionAvailable = NetworkService.IsNetworkAvailable();
|
||||
|
||||
await LoadNotification();
|
||||
@@ -35,14 +45,6 @@
|
||||
Console.WriteLine($"Firebase init: {e.Message}");
|
||||
}
|
||||
|
||||
var lastSyncDate = LocalStorage.Get<DateTime>("last-sync");
|
||||
|
||||
if (!FormFactor.IsWeb() && NetworkService.ConnectionAvailable && lastSyncDate.Equals(DateTime.MinValue))
|
||||
{
|
||||
NavigationManager.NavigateTo("/sync");
|
||||
return;
|
||||
}
|
||||
|
||||
_ = StartSyncUser();
|
||||
NavigationManager.NavigateTo("/Calendar");
|
||||
}
|
||||
@@ -60,9 +62,6 @@
|
||||
|
||||
private Task StartSyncUser()
|
||||
{
|
||||
return Task.Run(() =>
|
||||
{
|
||||
_ = PreloadService.PreloadUsersAsync();
|
||||
});
|
||||
return Task.Run(() => { _ = PreloadService.PreloadUsersAsync(); });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,29 +214,38 @@
|
||||
@if (item.p.Type == AttachedDTO.TypeAttached.Position)
|
||||
{
|
||||
<MudChip T="string" Icon="@Icons.Material.Rounded.LocationOn" Color="Color.Success"
|
||||
OnClick="() => OpenPosition(item.p)" OnClose="() => OnRemoveAttached(item.index)">
|
||||
OnClick="@(() => OpenPosition(item.p))"
|
||||
OnClose="@(() => OnRemoveAttached(item.index))">
|
||||
@item.p.Description
|
||||
</MudChip>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudChip T="string" Color="Color.Default" OnClick="() => OpenAttached(item.p)"
|
||||
OnClose="() => OnRemoveAttached(item.index)">
|
||||
<MudChip T="string" Color="Color.Default" OnClick="@(() => OpenAttached(item.p))"
|
||||
OnClose="@(() => OnRemoveAttached(item.index))">
|
||||
@item.p.Name
|
||||
</MudChip>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@if (ActivityFileList != null)
|
||||
@if (!IsLoading)
|
||||
{
|
||||
foreach (var file in ActivityFileList)
|
||||
if (ActivityFileList != null)
|
||||
{
|
||||
<MudChip T="string" OnClick="() => OpenAttached(file.Id, file.FileName)" Color="Color.Default">
|
||||
@file.FileName
|
||||
</MudChip>
|
||||
foreach (var file in ActivityFileList)
|
||||
{
|
||||
<MudChip T="string" OnClick="@(() => OpenAttached(file.Id, file.FileName))"
|
||||
OnClose="@(() => DeleteAttach(file))" Color="Color.Default">
|
||||
@file.FileName
|
||||
</MudChip>
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="my-7"/>
|
||||
}
|
||||
</div>
|
||||
|
||||
@if (!IsView)
|
||||
@@ -318,6 +327,7 @@
|
||||
private List<ActivityFileDto>? ActivityFileList { get; set; }
|
||||
|
||||
private bool IsNew { get; set; }
|
||||
private bool IsLoading { get; set; }
|
||||
private bool IsView => !NetworkService.ConnectionAvailable;
|
||||
|
||||
private string? LabelSave { get; set; }
|
||||
@@ -443,6 +453,9 @@
|
||||
{
|
||||
return Task.Run(async () =>
|
||||
{
|
||||
IsLoading = true;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
|
||||
SelectedComessa = ActivityModel.Commessa;
|
||||
|
||||
Users = await ManageData.GetTable<StbUser>();
|
||||
@@ -456,6 +469,7 @@
|
||||
Clienti = await ManageData.GetClienti(new WhereCondContact { FlagStato = "A" });
|
||||
Pros = await ManageData.GetProspect();
|
||||
|
||||
IsLoading = false;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
});
|
||||
}
|
||||
@@ -479,8 +493,8 @@
|
||||
if (ActivityModel.CodAnag == null)
|
||||
{
|
||||
Commesse = await ManageData.GetTable<JtbComt>(x =>
|
||||
x.CodJcom.Contains(searchValue, StringComparison.OrdinalIgnoreCase) ||
|
||||
x.Descrizione.Contains(searchValue, StringComparison.OrdinalIgnoreCase)
|
||||
x.CodJcom.ToUpper().Contains(searchValue.ToUpper()) ||
|
||||
x.Descrizione.ToUpper().Contains(searchValue.ToUpper())
|
||||
);
|
||||
}
|
||||
else
|
||||
@@ -544,11 +558,11 @@
|
||||
var results = new List<string>();
|
||||
|
||||
results.AddRange(Clienti
|
||||
.Where(x => x.RagSoc.Contains(value, StringComparison.OrdinalIgnoreCase))
|
||||
.Where(x => (x.CodAnag != null && x.CodAnag.Contains(value, StringComparison.OrdinalIgnoreCase)) || x.RagSoc.Contains(value, StringComparison.OrdinalIgnoreCase))
|
||||
.Select(x => $"{x.CodAnag} - {x.RagSoc}"));
|
||||
|
||||
results.AddRange(Pros
|
||||
.Where(x => x.RagSoc.Contains(value, StringComparison.OrdinalIgnoreCase))
|
||||
.Where(x => (x.CodPpro != null && x.CodPpro.Contains(value, StringComparison.OrdinalIgnoreCase)) || x.RagSoc.Contains(value, StringComparison.OrdinalIgnoreCase))
|
||||
.Select(x => $"{x.CodPpro} - {x.RagSoc}"));
|
||||
|
||||
return Task.FromResult<IEnumerable<string>?>(results);
|
||||
@@ -564,6 +578,9 @@
|
||||
{
|
||||
ActivityModel.CodAnag = parts[0];
|
||||
ActivityModel.Cliente = parts[1];
|
||||
|
||||
var isCliente = Clienti.FirstOrDefault(x => x.CodAnag != null && x.CodAnag.Equals(ActivityModel.CodAnag));
|
||||
ActivityModel.TipoAnag = isCliente == null ? "P" : "C";
|
||||
}
|
||||
|
||||
OnAfterChangeValue();
|
||||
@@ -581,6 +598,7 @@
|
||||
if (com.CodAnag != null)
|
||||
{
|
||||
ActivityModel.CodAnag = com.CodAnag;
|
||||
ActivityModel.TipoAnag = com.TipoAnag;
|
||||
ActivityModel.Cliente = Clienti
|
||||
.Where(x => x.CodAnag != null && x.CodAnag.Equals(com.CodAnag))
|
||||
.Select(x => x.RagSoc)
|
||||
@@ -593,6 +611,7 @@
|
||||
{
|
||||
ActivityModel.CodAnag = null;
|
||||
ActivityModel.Cliente = null;
|
||||
ActivityModel.TipoAnag = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -601,6 +620,7 @@
|
||||
ActivityModel.Commessa = null;
|
||||
ActivityModel.CodAnag = null;
|
||||
ActivityModel.Cliente = null;
|
||||
ActivityModel.TipoAnag = null;
|
||||
}
|
||||
|
||||
OnAfterChangeValue();
|
||||
@@ -775,6 +795,33 @@
|
||||
}
|
||||
}
|
||||
|
||||
private async Task DeleteAttach(ActivityFileDto file)
|
||||
{
|
||||
Snackbar.Clear();
|
||||
|
||||
if (ActivityFileList == null) return;
|
||||
|
||||
try
|
||||
{
|
||||
ActivityFileList.Remove(file);
|
||||
StateHasChanged();
|
||||
|
||||
await IntegryApiService.DeleteFile(ActivityModel.ActivityId!, file.FileName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ActivityFileList.Add(file);
|
||||
StateHasChanged();
|
||||
|
||||
Snackbar.Add("Impossibile eliminare il file", Severity.Error);
|
||||
Console.WriteLine($"Impossibile eliminare il file: {ex.Message}");
|
||||
}
|
||||
finally
|
||||
{
|
||||
Snackbar.Add($"{file.FileName} eliminato con successo", Severity.Info);
|
||||
}
|
||||
}
|
||||
|
||||
private void OpenPosition(AttachedDTO attached)
|
||||
{
|
||||
if (attached is { Lat: not null, Lng: not null })
|
||||
@@ -804,7 +851,7 @@
|
||||
|
||||
VisibleOverlay = true;
|
||||
StateHasChanged();
|
||||
|
||||
|
||||
_ = Task.Run(async () =>
|
||||
{
|
||||
var activityDescriptions = await IntegryApiService.SuggestActivityDescription(ActivityModel.ActivityTypeId);
|
||||
@@ -813,7 +860,7 @@
|
||||
|
||||
if (modal is { IsCanceled: false, Result: not null })
|
||||
ActivityModel.ActivityDescription = modal.Result.Data!.ToString();
|
||||
|
||||
|
||||
VisibleOverlay = false;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
});
|
||||
|
||||
@@ -160,7 +160,7 @@ public class IntegryApiService(IIntegryApiRestClient integryApiRestClient, IUser
|
||||
}
|
||||
|
||||
public Task<Stream> DownloadFile(string activityId, string fileName) =>
|
||||
integryApiRestClient.Download($"downloadStbFileAttachment/{activityId}/{fileName}")!;
|
||||
integryApiRestClient.Download($"downloadStbActivityFileAttachment/{activityId}/{fileName}")!;
|
||||
|
||||
public Task<Stream> DownloadFileFromRefUuid(string refUuid, string fileName)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user