public ActionResult RightCreateRootNode(RightCreateRootNode model) { if (!ModelState.IsValid) { return View(model); } string sql = "exec SP_RightCreate @RightID,@RightCode,@RightName,@ControllerName,@ActionName,@ParentID,@SortID,@RightProperty,@Remark,@isLeaf"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@RightID", model.ParentID), new SqlParameter("@RightCode", model.RightCode), new SqlParameter("@RightName", model.RightName), new SqlParameter("@ControllerName", model.ControllerName), new SqlParameter("@ActionName", model.ActionName), new SqlParameter("@ParentID", model.ParentID), new SqlParameter("@SortID", model.SortID), new SqlParameter("@RightProperty", model.RightProperty), new SqlParameter("@Remark", model.Remark), new SqlParameter("@isLeaf", false), }; var result = bRight.Add(sql, param); if (result.RightID > 0) return RedirectToAction("RightList"); else return View(model); }
/// <summary> /// 添加跟节点 /// </summary> /// <returns></returns> public ActionResult RightCreateRootNode() { var model = new RightCreateRootNode(); model.SortID = 0; @ViewBag.RightProperty = DicUtil.Instance.RightProperties(0); return View(model); }