public ActionResult AttrAdd(Attr attr) { ResultInfo resultInfo = new ResultInfo(1, "验证不通过"); if (ModelState.IsValid) { resultInfo = _attrService.Add(attr); } return Json(resultInfo); }
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); }
public ResultInfo Edit(Attr attr) { _attrRepository.Update(attr); return new ResultInfo("添加成功"); }
public ResultInfo Add(Attr attr) { _attrRepository.Add(attr); return new ResultInfo("添加成功"); }