Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }