Exemplo n.º 1
0
        public ActionResult Create(string name)
        {
            try
            {
                if (string.IsNullOrWhiteSpace(name))
                {
                    return(Json(new ResultMsg()
                    {
                        Code = -1, CodeText = "请输入名称"
                    }));
                }

                var model = new fz_CommodityCategorys();
                model.name       = name;
                model.submitTime = DateTime.Now;
                if (ICommodityCategorysService.Insert(model) > 0)
                {
                    return(Json(new ResultMsg()
                    {
                        Code = 0
                    }));
                }
                return(Json(new ResultMsg()
                {
                    Code = -1, CodeText = "添加失败"
                }));
            }
            catch (Exception ex)
            {
                return(Json(new ResultMsg()
                {
                    Code = -1, CodeText = "系统错误,联系管理员"
                }));
            }
        }
Exemplo n.º 2
0
 public ListCommodityCategory(fz_CommodityCategorys item)
 {
     commodityCategoryId = item.commodityCategoryId;
     Name = item.name;
 }