diff --git a/salesbook.Maui/salesbook.Maui.csproj b/salesbook.Maui/salesbook.Maui.csproj index ba13872..0b44523 100644 --- a/salesbook.Maui/salesbook.Maui.csproj +++ b/salesbook.Maui/salesbook.Maui.csproj @@ -78,8 +78,9 @@ - Apple Development: Created via API (5B7B69P4JY) - VS: WildCard Development + Apple Distribution: Integry S.r.l. (UNP26J4R89) + + manual diff --git a/salesbook.Shared/Components/Layout/NavMenu.razor b/salesbook.Shared/Components/Layout/NavMenu.razor index 1d7ecef..cc75f0f 100644 --- a/salesbook.Shared/Components/Layout/NavMenu.razor +++ b/salesbook.Shared/Components/Layout/NavMenu.razor @@ -45,7 +45,7 @@ - Nuovo contatto + Nuovo contatto Nuova attività @@ -92,5 +92,10 @@ Messenger.Send(new NewActivityMessage(((StbActivity)result.Data).ActivityId)); } } + + private async Task CreateUser() + { + var result = await ModalHelpers.OpenUserForm(Dialog, null); + } } diff --git a/salesbook.Shared/Components/Pages/User.razor b/salesbook.Shared/Components/Pages/User.razor index a89e00d..0201904 100644 --- a/salesbook.Shared/Components/Pages/User.razor +++ b/salesbook.Shared/Components/Pages/User.razor @@ -35,16 +35,26 @@ else + @if (!string.IsNullOrEmpty(Anag.Telefono)) + { + + Telefono + + @Anag.Telefono + + + } + - Telefono + P. IVA - @if (string.IsNullOrEmpty(Anag.Telefono)) + @if (string.IsNullOrEmpty(Anag.PartIva)) { - @("Nessuna mail configurata") + @("Nessuna partita iva configurata") } else { - @Anag.Telefono + @Anag.PartIva } diff --git a/salesbook.Shared/Components/SingleElements/Modal/ActivityForm.razor b/salesbook.Shared/Components/SingleElements/Modal/ActivityForm.razor index 91c53a0..fde932d 100644 --- a/salesbook.Shared/Components/SingleElements/Modal/ActivityForm.razor +++ b/salesbook.Shared/Components/SingleElements/Modal/ActivityForm.razor @@ -339,10 +339,10 @@ { OnAfterChangeValue(); - // var result = await ConfirmMemo.ShowAsync(); + var result = await ConfirmMemo.ShowAsync(); - // if (result is true) - // OpenAddMemo = !OpenAddMemo; + if (result is true) + OpenAddMemo = !OpenAddMemo; } private void OpenSelectEsito() diff --git a/salesbook.Shared/Components/SingleElements/Modal/UserForm.razor b/salesbook.Shared/Components/SingleElements/Modal/UserForm.razor new file mode 100644 index 0000000..4a4f9b5 --- /dev/null +++ b/salesbook.Shared/Components/SingleElements/Modal/UserForm.razor @@ -0,0 +1,210 @@ +@using System.Text.RegularExpressions +@using salesbook.Shared.Core.Dto +@using salesbook.Shared.Components.Layout +@using salesbook.Shared.Core.Entity +@using salesbook.Shared.Core.Interface +@using salesbook.Shared.Components.Layout.Overlay +@inject IManageDataService ManageData +@inject INetworkService NetworkService +@inject IIntegryApiService IntegryApiService + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tipo cliente + + @* @if (Commesse.IsNullOrEmpty()) + { + Nessuna commessa presente + } + else + { + + @foreach (var com in Commesse) + { + @($"{com.CodJcom} - {com.Descrizione}") + } + + } *@ + + + + @if (IsNew) + { + + + Persona di riferimento + + + } + + + + + + +@code { + [CascadingParameter] private IMudDialogInstance MudDialog { get; set; } + + [Parameter] public string? CodAnag { get; set; } + [Parameter] public string? UserType { get; set; } + + private UserDTO OriginalModel { get; set; } = new(); + private UserDTO UserModel { get; set; } = new(); + + private List ActivityResult { get; set; } = []; + private List ActivityType { get; set; } = []; + private List Users { get; set; } = []; + private List Commesse { get; set; } = []; + private List Clienti { get; set; } = []; + private List Pros { get; set; } = []; + + private bool IsNew => CodAnag.IsNullOrEmpty(); + private bool IsView => !NetworkService.IsNetworkAvailable(); + + private string? LabelSave { get; set; } + + //Overlay for save + private bool VisibleOverlay { get; set; } + private bool SuccessAnimation { get; set; } + + protected override async Task OnInitializedAsync() + { + Snackbar.Configuration.PositionClass = Defaults.Classes.Position.TopCenter; + + _ = LoadData(); + + LabelSave = IsNew ? "Aggiungi" : null; + } + + private async Task Save() + { + SuccessAnimation = true; + StateHasChanged(); + + await Task.Delay(1250); + + MudDialog.Close(); + } + + private async Task LoadData() + { + + } + + private void OnAfterChangeValue() + { + if (!IsNew) + { + LabelSave = !OriginalModel.Equals(UserModel) ? "Aggiorna" : null; + } + } + + private void NewPersRif() + { + + } +} \ No newline at end of file diff --git a/salesbook.Shared/Components/SingleElements/Modal/UserForm.razor.css b/salesbook.Shared/Components/SingleElements/Modal/UserForm.razor.css new file mode 100644 index 0000000..cb50e2e --- /dev/null +++ b/salesbook.Shared/Components/SingleElements/Modal/UserForm.razor.css @@ -0,0 +1,4 @@ +.container-button { + background: var(--mud-palette-background-gray) !important; + box-shadow: unset; +} diff --git a/salesbook.Shared/Core/Dto/UserDTO.cs b/salesbook.Shared/Core/Dto/UserDTO.cs new file mode 100644 index 0000000..fc6b16e --- /dev/null +++ b/salesbook.Shared/Core/Dto/UserDTO.cs @@ -0,0 +1,13 @@ +namespace salesbook.Shared.Core.Dto; + +public class UserDTO +{ + public string? CodAnag { get; set; } + public string? RagSoc { get; set; } + public string? Indirizzo { get; set; } + public string? Cap { get; set; } + public string? Citta { get; set; } + public string? Prov { get; set; } + public string? Nazione { get; set; } + public string? PartIva { get; set; } +} \ No newline at end of file diff --git a/salesbook.Shared/Core/Helpers/ModalHelpers.cs b/salesbook.Shared/Core/Helpers/ModalHelpers.cs index 74fb247..62f3a6a 100644 --- a/salesbook.Shared/Core/Helpers/ModalHelpers.cs +++ b/salesbook.Shared/Core/Helpers/ModalHelpers.cs @@ -25,4 +25,23 @@ public class ModalHelpers return await modal.Result; } + + public static async Task OpenUserForm(IDialogService dialog, string? codAnag) + { + var modal = await dialog.ShowAsync( + "User form", + new DialogParameters + { + { x => x.CodAnag, codAnag } + }, + new DialogOptions + { + FullScreen = true, + CloseButton = false, + NoHeader = true + } + ); + + return await modal.Result; + } } \ No newline at end of file