コード例 #1
0
        public ActionResult Add(int choice, long?Id)
        {
            //  bool? color, bool? size,long? sizeCategoryId
            AddProductVM product = new AddProductVM();

            product.SizeCategoryId = Id;
            product.Colors         = _productManagerService.GetAllColors();
            product.Sizes          = _productManagerService.GetSizesOfCat(Id);
            product.Designers      = _DesignerService.GetAllDesigners(CurrentLanguage);

            //product.BaseCategories = _productManagerService.GetSubCategories((long)CurrentWebsite, CurrentLanguage);
            product.BaseCategories = _categoryService.GetAllPathsByWebsite(CurrentWebsite, CurrentLanguage);
            // List<DesignerDTO> designers = _DesignerService.GetAllDesigners(CurrentLanguage);
            // product.Designers = designers;

            List <AttributeGroupDTO> attribueGroups = _attributeGroupService.GetAllAttributeGroups(CurrentLanguage);

            product.AttributesGroups = attribueGroups;
            if (choice == 1 || choice == 3)
            {
                product.HasColor = true;
            }
            else
            {
                product.HasColor = false;
            }

            if (choice == 2 || choice == 3)
            {
                product.HasSize = true;
            }
            else
            {
                product.HasSize = false;
            }
            if (product.HasSize)
            {
                product.AllSizeAttributes = _manageSizeAttributesService.GetSizeAttributesBySizeCaategoryId(Id.Value, CurrentLanguage);
            }
            return(View(product));
        }