protected async Task ShowCreateSubcategoryModal(CategoryModel parentCategory) { SetModalParameters(new CategoryModel(), async(c) => { await CategoryService.CreateSubcategoryAsync(parentCategory.CategoryId, c); }); Parameters.Add(nameof(CreateSubcategoryModal.ParentCategory), parentCategory); await ShowModalWindow <CreateSubcategoryModal>(Resource.CreateSubcategoryTitle); }
protected async Task ShowDeleteModal(CategoryModel category) { SetModalParameters(category, async(c) => { await CategoryService.DeleteCategoryAsync(c.CategoryId); }); var modalTitle = string.Format(Resource.DeleteTitle, category.Name); await ShowModalWindow <DeleteCategoryModal>(modalTitle); }
protected async Task ShowEditModal(CategoryModel category) { var categoryCopy = new CategoryModel(); Mapper.Map(category, categoryCopy); SetModalParameters(categoryCopy, async(c) => { await CategoryService.UpdateCategoryAsync(c); }); var modalTitle = string.Format(Resource.EditTitle, category.Name); await ShowModalWindow <EditCategoryModal>(modalTitle); }