protected void EditSubscription(MobileSubscription sub) { var parameters = new ModalParameters(); parameters.Add("MobileSubscription", sub); parameters.Add("Account", sub.MobileAccount); parameters.Add("ADUser", _user); ModalService.Show <AddSubscription>("Edit abonnement", parameters); }
protected async Task ShowConfirmationDelete(MobileSubscription sub) { var modal = ModalService.Show <Confirmation>("Verwijder abonnement"); var res = await modal.Result; if (!res.Cancelled) { DeleteSubscription(sub); } }
private void ShowNoteModal(DateTime timeCreated, DateTime timeArchived, string title, string content) { var parameters = new ModalParameters(); parameters.Add(nameof(NoteLogItemComponent.OriginallyCreated), timeCreated); parameters.Add(nameof(NoteLogItemComponent.Archived), timeArchived); parameters.Add(nameof(NoteLogItemComponent.Content), content); ModalService.Show <NoteLogItemComponent>(title, parameters); }
protected void ConfirmDelete(Contact contact) { ModalService.Closed += ConfirmDeleteModalClosed; ModalParameters parameters = new ModalParameters(); parameters.Add("ToDelete", contact); ModalService.Show <DeleteContactConfirmation>("Supprimer le contact?", parameters); }
protected async Task AddTemplate() { var modal = ModalService.Show <AddMailTemplate>("Nieuwe template"); var res = await modal.Result; if (!res.Cancelled) { _templates.Add((MailTemplate)res.Data); } }
protected async Task ShowConfirmationReturnOne(Item item) { var modal = ModalService.Show <Confirmation>("Retourneer item"); var res = await modal.Result; if (!res.Cancelled) { ReturnItem(item); } }
protected async Task ShowConfirmation(Item item) { var modal = ModalService.Show <Confirmation>("Verwijder item"); var res = await modal.Result; if (!res.Cancelled) { DeleteItem(item); } }
protected async Task ShowConfirmationDisassociate(Item item) { var modal = ModalService.Show <Confirmation>("Item uitsluiten"); var res = await modal.Result; if (!res.Cancelled) { DisassociateItem(item); } }
protected async Task ShowConfirmationReturnAll() { var modal = ModalService.Show <Confirmation>("Retourneer alles"); var res = await modal.Result; if (!res.Cancelled) { ReturnAll(); } }
protected async Task ShowConfirmation(Product product) { var modal = ModalService.Show <Confirmation>("Delete Confirm"); var res = await modal.Result; if (!res.Cancelled) { DeleteProduct(product); } }
protected void Update(Contact contact) { ModalService.Closed += UpdateModalClosed; ModalParameters parameters = new ModalParameters(); parameters.Add("ToUpdate", contact); ModalService.Show <ContactUpdate>("Modifier le contact", parameters); }
protected async Task LogOut() { var resultModal = ModalService.Show <LogOut>("Log Out"); var result = await resultModal.Result; if (!result.Cancelled) { await OnChange.InvokeAsync("Logout"); } }
protected async Task ShowSignIn() { var resultModal = ModalService.Show <SignIn>("Sign In"); var result = await resultModal.Result; if (!result.Cancelled) { await OnChange.InvokeAsync("SignIn"); } }
protected async Task ShowDeleteConfirm() { var modal = ModalService.Show <Confirmation>("Verwijder mailtemplate"); var res = await modal.Result; if (!res.Cancelled) { var template = _templates.FirstOrDefault(t => t.Id == _selectedTemplate); DeleteTemplate(template); } }
private async Task Delete(long jobsId) { var deleteModal = ModalService.Show <DeleteModal>("Confirm delete operation"); var deleteResult = await deleteModal.Result; if (!deleteResult.Cancelled) { await JobService.Delete(jobsId.ToString()); Jobs.Remove(Jobs.First(jobs => jobs.Id.Equals(jobsId))); } }
private async Task DeleteUser(string login) { var deleteModal = ModalService.Show <DeleteModal>("Confirm delete operation"); var deleteResult = await deleteModal.Result; if (!deleteResult.Cancelled) { await UserService.Delete(login); UserModels.Remove(UserModels.First(user => user.Login.Equals(login))); } }
private async Task Delete(long regionsId) { var deleteModal = ModalService.Show <DeleteModal>("Confirm delete operation"); var deleteResult = await deleteModal.Result; if (!deleteResult.Cancelled) { await RegionService.Delete(regionsId.ToString()); Regions.Remove(Regions.First(regions => regions.Id.Equals(regionsId))); } }
private async Task Delete(long countryId) { var deleteModal = ModalService.Show <DeleteModal>("Confirm delete operation"); var deleteResult = await deleteModal.Result; if (!deleteResult.Cancelled) { await CountryService.Delete(countryId.ToString()); Countries.Remove(Countries.First(country => country.Id.Equals(countryId))); } }
protected void RowExpand(ItemUser iu) { var parameters = new ModalParameters(); parameters.Add("ItemUser", iu); var opts = new ModalOptions() { HideHeader = true }; ModalService.Show <ItemHistoryComponent>("History", parameters, opts); }
protected async void ShowLogin() { var resultModal = ModalService.Show <LogIn>("Log in"); var result = await resultModal.Result; if (!result.Cancelled) { Balance = await AccountService.GetBalance(); await OnChange.InvokeAsync("Login"); } }
private async Task Delete(long employeesId) { var deleteModal = ModalService.Show <DeleteModal>("Confirm delete operation"); var deleteResult = await deleteModal.Result; if (!deleteResult.Cancelled) { await EmployeeService.Delete(employeesId.ToString()); Employees.Remove(Employees.First(employees => employees.Id.Equals(employeesId))); } }
private async Task Delete(long pieceofworksId) { var deleteModal = ModalService.Show <DeleteModal>("Confirm delete operation"); var deleteResult = await deleteModal.Result; if (!deleteResult.Cancelled) { await PieceOfWorkService.Delete(pieceofworksId.ToString()); PieceOfWorks.Remove(PieceOfWorks.First(pieceofworks => pieceofworks.Id.Equals(pieceofworksId))); } }
private async Task Delete(long departmentsId) { var deleteModal = ModalService.Show <DeleteModal>("Confirm delete operation"); var deleteResult = await deleteModal.Result; if (!deleteResult.Cancelled) { await DepartmentService.Delete(departmentsId.ToString()); Departments.Remove(Departments.First(departments => departments.Id.Equals(departmentsId))); } }
protected async Task AddSubscription() { var parameters = new ModalParameters(); parameters.Add("ADUser", _user); var modal = ModalService.Show <AddSubscription>("Nieuw abonnement", parameters); var res = await modal.Result; if (!res.Cancelled) { _user.AddSubscription((MobileSubscription)res.Data); } }
protected async Task AddIncludedItem() { var parameters = new ModalParameters(); parameters.Add("ParentItem", _item); var modal = ModalService.Show <AddIncludedItem>("Inbegrepen item", parameters); var res = await modal.Result; if (!res.Cancelled) { _item.AddItem((Item)res.Data); } }
public static async Task WrapApiCallWithValidationModalAsync( Func <Task> function, ModalService modalService) { try { await function.Invoke(); } catch (ServerValidationException ex) { modalService.Show( "Please fix the following issues:", typeof(ErrorMessageDictionary), ex.ErrorDictionary); throw; } }
protected async Task MarkReady() { var formModal = ModalService.Show <JoinTable>("Join table"); var result = await formModal.Result; if (result.Cancelled) { return; } await _hubConnection.SendAsync("MarkReady", result.Data); StateService.CallRequestRefresh(); await Task.Delay(500); StateService.CallRequestRefresh(); }
private async Task GenerateReport() { if (!editContext.Validate()) { return; } DataDto = await anonymousClient.GenerateReport(Dto); var parameters = new Blazored.Modal.ModalParameters(); parameters.Add(nameof(ShowReport.DataDtos), DataDto); parameters.Add(nameof(ShowReport.Dto), Dto); var modalReference = ModalService.Show <ShowReport>(Dto.Name, parameters, new ModalOptions() { }); var modalResult = await modalReference.Result; }
private async Task DeleteBook() { var confirmParams = new ModalParameters(); confirmParams.Add(nameof(Confirm.ConfirmationMessage), $"آیا از حذف کتاب {BookDto.Title} مطمئن میباشید؟"); var confirmModal = ModalService.Show <Confirm>("تایید حذف", confirmParams); var result = await confirmModal.Result; if (!result.Cancelled && (bool)result.Data) { await BookWebService.DeleteBook(BookDto.Id); ToastService.ShowSuccess("حذف کتاب با موفقیت انجام شد"); await StateChangeRequest.InvokeAsync(); } }
protected async Task EditTemplate() { var template = _templates.FirstOrDefault(t => t.Id == _selectedTemplate); var parameters = new ModalParameters(); parameters.Add("MailTemplate", template); var modal = ModalService.Show <AddMailTemplate>("Edit template", parameters); var res = await modal.Result; if (!res.Cancelled) { template = (MailTemplate)res.Data; if (template != null) { string[] result = template.BuildMail(aduser.FullName, stockUser.FullName, stockUser.OfficeRole, _items); _subject = result[0]; _body = result[1]; FireStringChange(); } } }