public ResultObject Edit(SystemRes m) { if (string.IsNullOrEmpty(m.Name)) { return(new ResultObject("名称不能为空")); } if (m.Id > 0) { var flag = systemResDao.Update(m); return(new ResultObject(flag)); } else { var flag = systemResDao.Insert(m); return(new ResultObject(flag)); } }
public IActionResult Edit(long id = 0, long parentId = 0) { var m = systemResBusiness.SingleById(id); if (m == null) { m = new SystemRes(); m.Status = 1; m.Type = 1; m.Operations = "查看"; ViewBag.parent = systemResBusiness.SingleById(parentId); } else { ViewBag.parent = systemResBusiness.SingleById(m.ParentId); } ViewBag.m = m; return(View()); }
public IActionResult DoEdit(SystemRes m) { var ro = systemResBusiness.Edit(m); return(Json(ro)); }