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); } }
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()); } }
public async Task SubmitAsync() { var result = await _businessService.UpdateDetails(Id, Name, TradingName, WebAddress); if (result) { await _pubSubService.Publish <UpdateBusinessProfile>(); _modalService.Close(ModalResult.Cancel()); } }
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; } }
public void Close(object result = null) { lastResult = result; ModalService.Close(ModalResult.Cancel()); }