Exemplo n.º 1
0
 /// <summary>
 /// Method called by the dismiss button to close the dialog
 /// sets the task to complete, show to false and renders the component (which hides it as show is false!)
 /// </summary>
 public async void Dismiss()
 {
     _ = _modalcompletiontask.TrySetResult(ModalResult.Cancel());
     this._ShowModal = false;
     this._Content   = null;
     await InvokeAsync(Render);
 }
Exemplo n.º 2
0
        public async Task SubmitAsync()
        {
            HttpResponseMessage response = null;

            try
            {
                response = await _client.IdentityClient.PostAsync("admin/create-business-admin", JsonMessage.CreateJsonMessage(new { BusinessId = Id, Email }));
            }
            catch (HttpRequestException)
            {
                _toastService.ShowError(ServiceError.Standard.Reason);
                return;
            }

            if (response.IsSuccessStatusCode)
            {
                _modalService.Close(ModalResult.Cancel());
                _toastService.ShowSuccess($"Email sent to user {Email} to confirm their account");
                Email = string.Empty;
                Id    = Guid.Empty;
                return;
            }
            else if (response.StatusCode == System.Net.HttpStatusCode.BadRequest)
            {
                var error = await ServiceError.Deserialize(response);

                _toastService.ShowError(error.Reason);
            }
        }
Exemplo n.º 3
0
        private async void CancelModals(object sender, LocationChangedEventArgs e)
        {
            foreach (var modalReference in Modals)
            {
                modalReference.Dismiss(ModalResult.Cancel());
            }

            Modals.Clear();
            await InvokeAsync(StateHasChanged);
        }
Exemplo n.º 4
0
        public async Task SubmitAsync()
        {
            var res = await _businessService.UpdateContactAsync(new HeadContact { FirstName = FirstName, SecondName = SecondName, Email = Email, ContactNumber = ContactNumber }, BusinessId);

            if (res)
            {
                _modalService.Close(ModalResult.Cancel());
                await _pubSubService.Publish <UpdateBusinessProfile>();
            }
        }
        public async Task SubmitAsync()
        {
            var result = await _businessService.UpdateOfficeAsync(new HeadOffice { PostCode = PostCode, AddressLine1 = AddressLine1, AddressLine2 = AddressLine2 }, BusinessId);

            if (result)
            {
                await _pubSubService.Publish <UpdateBusinessProfile>();

                _modalService.Close(ModalResult.Cancel());
            }
        }
Exemplo n.º 6
0
 public void Close(bool state)
 {
     if (state)
     {
         this.Parent.Close(ModalResult.Exit());
     }
     else
     {
         this.Parent.Close(ModalResult.Cancel());
     }
 }
Exemplo n.º 7
0
 public void Cancel()
 {
     if (IsModal)
     {
         this.ModalParent.Close(ModalResult.Cancel());
     }
     else
     {
         this.ViewManager.LoadViewAsync(this.ViewManager.LastViewData);
     }
 }
Exemplo n.º 8
0
        public async Task SubmitAsync()
        {
            var result = await _businessService.UpdateDetails(Id, Name, TradingName, WebAddress);

            if (result)
            {
                await _pubSubService.Publish <UpdateBusinessProfile>();

                _modalService.Close(ModalResult.Cancel());
            }
        }
Exemplo n.º 9
0
        private async void CancelModals(object sender, LocationChangedEventArgs e)
        {
            foreach (var modalReference in Modals.ToList())
            {
                await JSRuntime.InvokeVoidAsync("BlazoredModal.deactivateFocusTrap", modalReference.Id, modalReference.ModalInstanceRef.Options.DisableBodyReposition);

                modalReference.Dismiss(ModalResult.Cancel());
            }

            Modals.Clear();
            await InvokeAsync(StateHasChanged);
        }
Exemplo n.º 10
0
        public async Task SubmitAsync()
        {
            var res = await _siteService.CreateSiteResource(SiteId, Name, Identifier);

            if (res)
            {
                _modalService.Close(ModalResult.Cancel());
                Name       = string.Empty;
                Identifier = string.Empty;
                SiteId     = Guid.Empty;
            }
        }
Exemplo n.º 11
0
 internal async Task CancelInstance(Guid Id)
 {
     await DismissInstance(Id, ModalResult.Cancel());
 }
 void CancelClicked()
 {
     BlazoredModal.Close(ModalResult.Cancel());
 }
 /// <summary>
 /// Closes the modal and returns a cancelled ModalResult.
 /// </summary>
 public async Task Cancel()
 {
     await Close(ModalResult.Cancel());
 }
Exemplo n.º 14
0
 internal void CancelInstance(Guid Id)
 {
     DismissInstance(Id, ModalResult.Cancel());
 }
 protected async Task ModalCancel()
 {
     await Modal.CloseAsync(ModalResult.Cancel());
 }
Exemplo n.º 16
0
        internal void CancelInstance(Guid Id)
        {
            var reference = GetModalReference(Id);

            CloseInstance(reference, ModalResult.Cancel());
        }
Exemplo n.º 17
0
 public void Close()
 {
     Close(ModalResult.Cancel());
 }
Exemplo n.º 18
0
 void Cancel()
 {
     Modal.Close(ModalResult.Cancel());
 }
Exemplo n.º 19
0
 void Cancel()
 {
     ShowForm = false;
     ModalService.Close(ModalResult.Cancel());
 }
Exemplo n.º 20
0
 public void Close(object result = null)
 {
     lastResult = result;
     ModalService.Close(ModalResult.Cancel());
 }
Exemplo n.º 21
0
 public void Cancel()
 {
     CloseModal?.Invoke();
     OnClose?.Invoke(ModalResult.Cancel(this._modalType));
 }