// Create new Subcategory
        public IActionResult CreateSubcategory(MainPageViewModel vm)
        {
            if (vm.AttributeGroupName != null)
            {
                var AttrGroupId = attributeGroupRepo.CreateAttributeGroup(vm);

                productAttributeRepo.CreateProductAttribute(vm, AttrGroupId);

                var SubCatId = subcategoryRepo.CreateSubcategory(vm);

                subcategoryAttributeGroupRepo.CreateSubcategoryAttributeGroup(AttrGroupId, SubCatId);
            }
            return(RedirectToAction("Index"));
        }
Exemple #2
0
        public HttpStatusCode CreateAttributeGroup(CreateAttributeGroupDto createAttributeGroupDto)
        {
            var response = _attributeGroupRepository.CreateAttributeGroup(createAttributeGroupDto);

            switch (response)
            {
            case HttpStatusCode.OK:
                return(HttpStatusCode.OK);

            case HttpStatusCode.InternalServerError:
                return(HttpStatusCode.InternalServerError);

            default:
                return(HttpStatusCode.NotFound);
            }
        }