public ActionResult Create(SKU_AttributesModel model)
        {
            if (ModelState.IsValid)
            {
                ResultModel resultModel = null;
                if (model.AttributeId == 0)
                {
                    model.CreateBy = UserInfo.CurrentUserName;
                    model.CreateDT = DateTime.Now;
                    model.UpdateBy = model.CreateBy;
                    model.UpdateDT = model.CreateDT;
                    model.IsSKU    = 1;

                    resultModel = _SkuAttributesService.AddStandardSKU_Attributes(model);
                }
                else
                {
                    model.UpdateBy = UserInfo.CurrentUserName;
                    model.UpdateDT = DateTime.Now;
                    model.IsSKU    = 1;
                    resultModel    = _SkuAttributesService.UpdateStandardSKU_Attributes(model);
                }
                return(Json(resultModel, JsonRequestBehavior.AllowGet));
            }
            return(PartialView(model));
        }
        public void AddSKU_Attributes_Test()
        {
            SKU_AttributesModel model = new SKU_AttributesModel()
            {
                AttributeName             = "网络格式",
                AttributeType             = 0,
                CreateBy                  = "admin",
                CreateDT                  = DateTime.Now,
                IsSearch                  = 0,
                IsSKU                     = 1,
                Remark                    = "手机",
                RowStatus                 = 0,
                UsageMode                 = 0,
                UpdateBy                  = "admin",
                UpdateDT                  = DateTime.Now,
                SKU_AttributeValuesModels = new List <SKU_AttributeValuesModel>()
                {
                    new SKU_AttributeValuesModel()
                    {
                        DisplaySequence = 1,
                        ImageUrl        = "",
                        ValuesGroup     = "",
                        ValueStr        = "移动"
                    },
                    new SKU_AttributeValuesModel()
                    {
                        DisplaySequence = 1,
                        ImageUrl        = "",
                        ValuesGroup     = "",
                        ValueStr        = "联通"
                    }
                }
            };
            ResultModel result = _SKU_AttributesService.AddStandardSKU_Attributes(model);

            Assert.IsTrue(result.IsValid);
        }