diff --git a/salesbook.Maui/Core/Services/ManageDataService.cs b/salesbook.Maui/Core/Services/ManageDataService.cs index d993686..ec0045a 100644 --- a/salesbook.Maui/Core/Services/ManageDataService.cs +++ b/salesbook.Maui/Core/Services/ManageDataService.cs @@ -28,6 +28,22 @@ public class ManageDataService(LocalDbService localDb, IMapper mapper) : IManage return contactMapper; } + public async Task GetSpecificContact(string codAnag, bool isContact) + { + if (isContact) + { + var contact = (await localDb.Get(x => x.CodAnag != null && x.CodAnag.Equals(codAnag))).LastOrDefault(); + + return contact == null ? null : mapper.Map(contact); + } + else + { + var contact = (await localDb.Get(x => x.CodPpro != null && x.CodPpro.Equals(codAnag))).LastOrDefault(); + + return contact == null ? null : mapper.Map(contact); + } + } + public async Task> GetActivity(Expression>? whereCond = null) { var activities = await localDb.Get(whereCond); diff --git a/salesbook.Maui/MauiProgram.cs b/salesbook.Maui/MauiProgram.cs index 1ca8a57..5e78a85 100644 --- a/salesbook.Maui/MauiProgram.cs +++ b/salesbook.Maui/MauiProgram.cs @@ -13,6 +13,7 @@ using salesbook.Shared.Core.Interface; 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.Services; namespace salesbook.Maui @@ -61,6 +62,7 @@ namespace salesbook.Maui builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); + builder.Services.AddScoped(); #if DEBUG builder.Services.AddBlazorWebViewDeveloperTools(); diff --git a/salesbook.Shared/Components/Layout/NavMenu.razor b/salesbook.Shared/Components/Layout/NavMenu.razor index cc75f0f..9cf2d2e 100644 --- a/salesbook.Shared/Components/Layout/NavMenu.razor +++ b/salesbook.Shared/Components/Layout/NavMenu.razor @@ -3,12 +3,13 @@ @using salesbook.Shared.Core.Entity @using salesbook.Shared.Core.Messages.Activity.Copy @using salesbook.Shared.Core.Messages.Activity.New +@using salesbook.Shared.Core.Messages.Contact @inject IDialogService Dialog @inject IMessenger Messenger @inject CopyActivityService CopyActivityService -
-