示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }