using MudBlazor; using salesbook.Shared.Components.SingleElements.Modal; using salesbook.Shared.Core.Dto; using salesbook.Shared.Core.Dto.Activity; using salesbook.Shared.Core.Entity; namespace salesbook.Shared.Core.Helpers; public class ModalHelpers { public static async Task OpenActivityForm(IDialogService dialog, ActivityDTO? activity, string? id) { var modal = await dialog.ShowAsync( "Activity form", new DialogParameters { { x => x.Id, id }, { x => x.ActivityCopied, activity } }, new DialogOptions { FullScreen = true, CloseButton = false, NoHeader = true } ); return await modal.Result; } public static async Task OpenUserForm(IDialogService dialog, ContactDTO? anag) { var modal = await dialog.ShowAsync( "User form", new DialogParameters { { x => x.OriginalModel, anag } }, new DialogOptions { FullScreen = true, CloseButton = false, NoHeader = true } ); return await modal.Result; } public static async Task OpenPersRifForm(IDialogService dialog, PersRifDTO? persRif, ContactDTO? contactModel = null, List? persRifList = null) { var modal = await dialog.ShowAsync( "Pers rif form", new DialogParameters { { x => x.OriginalModel, persRif }, { x => x.ContactModel, contactModel }, { x => x.PersRifList, persRifList } }, new DialogOptions { FullScreen = true, CloseButton = false, NoHeader = true } ); return await modal.Result; } public static async Task OpenAddAttached(IDialogService dialog, bool canAddPosition) { var modal = await dialog.ShowAsync( "Add attached", new DialogParameters { { x => x.CanAddPosition, canAddPosition } }, new DialogOptions { FullScreen = false, CloseButton = false, NoHeader = true, BackdropClick = false } ); return await modal.Result; } public static async Task OpenSuggestActivityDescription(IDialogService dialog, List? activityTypers) { var modal = await dialog.ShowAsync( "Suggest activity description", new DialogParameters { { x => x.ActivityTypers, activityTypers } }, new DialogOptions { FullScreen = false, CloseButton = false, NoHeader = true, BackdropClick = false } ); return await modal.Result; } }