diff --git a/salesbook.Maui/Core/Services/AttachedService.cs b/salesbook.Maui/Core/Services/AttachedService.cs index 0d42acc..48bce9c 100644 --- a/salesbook.Maui/Core/Services/AttachedService.cs +++ b/salesbook.Maui/Core/Services/AttachedService.cs @@ -8,7 +8,9 @@ public class AttachedService : IAttachedService public async Task SelectImageFromCamera() { var cameraPerm = await Permissions.RequestAsync(); - if (cameraPerm != PermissionStatus.Granted) + var storagePerm = await Permissions.RequestAsync(); + + if (cameraPerm != PermissionStatus.Granted || storagePerm != PermissionStatus.Granted) return null; FileResult? result = null; @@ -20,6 +22,7 @@ public class AttachedService : IAttachedService catch (Exception ex) { Console.WriteLine($"Errore cattura foto: {ex.Message}"); + SentrySdk.CaptureException(ex); return null; } @@ -41,13 +44,13 @@ public class AttachedService : IAttachedService catch (Exception ex) { Console.WriteLine($"Errore selezione galleria: {ex.Message}"); + SentrySdk.CaptureException(ex); return null; } return result is null ? null : await ConvertToDto(result, AttachedDTO.TypeAttached.Image); } - public async Task SelectFile() { var perm = await Permissions.RequestAsync(); @@ -115,6 +118,7 @@ public class AttachedService : IAttachedService catch (Exception e) { Console.WriteLine($"Errore durante il salvataggio dello stream: {e.Message}"); + SentrySdk.CaptureException(e); return null; } finally @@ -128,7 +132,7 @@ public class AttachedService : IAttachedService public async Task OpenFile(Stream file, string fileName) { var filePath = await SaveToTempStorage(file, fileName); - + if (filePath is null) return; await Launcher.OpenAsync(new OpenFileRequest { diff --git a/salesbook.Maui/Core/Services/ManageDataService.cs b/salesbook.Maui/Core/Services/ManageDataService.cs index 087b65a..75e325d 100644 --- a/salesbook.Maui/Core/Services/ManageDataService.cs +++ b/salesbook.Maui/Core/Services/ManageDataService.cs @@ -1,8 +1,8 @@ using AutoMapper; -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.Dto.PageState; using salesbook.Shared.Core.Entity; using salesbook.Shared.Core.Helpers; using salesbook.Shared.Core.Helpers.Enum; @@ -10,7 +10,7 @@ using salesbook.Shared.Core.Interface; using salesbook.Shared.Core.Interface.IntegryApi; using salesbook.Shared.Core.Interface.System.Network; using System.Linq.Expressions; -using salesbook.Shared.Core.Dto.PageState; +using IntegryApiClient.Core.Domain.Abstraction.Contracts.Account; namespace salesbook.Maui.Core.Services; @@ -19,7 +19,8 @@ public class ManageDataService( IMapper mapper, UserListState userListState, IIntegryApiService integryApiService, - INetworkService networkService + INetworkService networkService, + IUserSession userSession ) : IManageDataService { public Task> GetTable(Expression>? whereCond = null) where T : new() => @@ -260,6 +261,11 @@ public class ManageDataService( var returnDto = activities .Select(activity => { + if (activity.CodJcom is "0000" && userSession.ProfileDb != null && userSession.ProfileDb.Equals("smetar", StringComparison.OrdinalIgnoreCase)) + { + activity.CodJcom = null; + } + var dto = mapper.Map(activity); if (activity is { AlarmTime: not null, EstimatedTime: not null }) diff --git a/salesbook.Maui/Platforms/Android/AndroidManifest.xml b/salesbook.Maui/Platforms/Android/AndroidManifest.xml index 7c85307..34aac3e 100644 --- a/salesbook.Maui/Platforms/Android/AndroidManifest.xml +++ b/salesbook.Maui/Platforms/Android/AndroidManifest.xml @@ -1,27 +1,57 @@  - - - - + + + + + + + + + + + + - + + + + + - + + + + + + + + + + - \ No newline at end of file + + diff --git a/salesbook.Maui/salesbook.Maui.csproj b/salesbook.Maui/salesbook.Maui.csproj index 8bd04a4..40a8691 100644 --- a/salesbook.Maui/salesbook.Maui.csproj +++ b/salesbook.Maui/salesbook.Maui.csproj @@ -30,7 +30,7 @@ 2.0.2 - 8 + 9 14.2