コード例 #1
0
        public ActionResult New(CategoryModel model)
        {
            if (ModelState.IsValid)
            {
                var pCategory = new ProductCategory();
                pCategory.Name      = model.Name;
                pCategory.SortIndex = model.Sort;
                pCategory.Alias     = model.Alias;
                pCategory.Status    = 1;

                var id = jlService.AddProductCategory(pCategory);
                model.Id = id;

                return(Json(ResultObject <CategoryModel> .Succeed(model)));
            }

            return(Json(ModelState));
        }