예제 #1
0
        public ActionResult AttrAdd(Attr attr)
        {
            ResultInfo resultInfo = new ResultInfo(1, "验证不通过");

            if (ModelState.IsValid)
            {
                resultInfo = _attrService.Add(attr);
            }

            return Json(resultInfo);
        }
예제 #2
0
        public ActionResult AttrEdit(Attr attr)
        {
            ResultInfo resultInfo = new ResultInfo(1, "验证不通过");

            if (ModelState.IsValid)
            {
                Attr oldAttr = _attrService.GetById(attr.AttrId);
                oldAttr.AttrName = attr.AttrName;
                oldAttr.Oid = attr.Oid;
                resultInfo = _attrService.Edit(oldAttr);
            }

            return Json(resultInfo);
        }
예제 #3
0
 public ResultInfo Edit(Attr attr)
 {
     _attrRepository.Update(attr);
     return new ResultInfo("添加成功");
 }
예제 #4
0
 public ResultInfo Add(Attr attr)
 {
     _attrRepository.Add(attr);
     return new ResultInfo("添加成功");
 }