/// <summary> /// 删除分类 /// add by lpl /// 2019-1-9 /// </summary> /// <returns></returns> public string LawTypeDel() { try { string Id = Request["Id"].ToString(); LawMangerEntity entity = new LawMangerBll().Single(Id); entity.Rowsatus = 0; //先判断是否存在字节点,存在则不让直接删除 if (new LawMangerBll().PersistUpdatedItem(entity)) { return("1"); } return("0"); } catch (Exception e) { return("0"); } }
/// <summary> /// 编辑分类 /// </summary> /// <param name="typename"></param> /// <returns></returns> public string LawTypeEdit(string typename) { try { string Id = Request["Id"].ToString(); LawMangerEntity entity = new LawMangerBll().Single(Id); entity.Name = typename; if (new LawMangerBll().PersistUpdatedItem(entity)) { return("1"); } return("0"); } catch (Exception e) { return("0"); } }
/// <summary> /// 添加法律法规页面 /// add by lpl /// </summary> /// <returns></returns> public ActionResult LawAdd(string ParentId) { LawMangerEntity lawMangerEntity = new LawMangerBll().Single(ParentId); ViewBag.ParentName = lawMangerEntity.Name;; return(View()); }
/// <summary> /// 添加和编辑分类 /// add by lpl /// 2019-1-9 /// </summary> /// <returns></returns> public ActionResult LawEdit(string ParentId) { LawMangerEntity lawMangerEntity = new LawMangerBll().Single(ParentId); //编辑情况:1,新增情况:0 if (Request["isEdit"] == "1") { ViewBag.ParentName = new LawMangerBll().Single(lawMangerEntity.ParentId).Name; ViewBag.Name = lawMangerEntity.Name; } else { ViewBag.ParentName = lawMangerEntity.Name; } return(View()); }
/// <summary> /// 递归生成加载子节点 /// add by lpl /// 2019-1-8 /// </summary> /// <param name="Id"></param> /// <returns></returns> public List <MiniTree> CreateChild(string Id) { var listLawManger = new LawMangerBll().QueryList(new LawMangerEntity() { ParentId = Id }); List <MiniTree> listTree = new List <MiniTree>(); foreach (var list in listLawManger) { MiniTree rooTree = new MiniTree(); rooTree.id = list.Id; rooTree.ParentId = list.ParentId; rooTree.text = list.Name; rooTree.children = CreateChild(rooTree.id); listTree.Add(rooTree); } return(listTree); }
public ActionResult LawDetial(string id) { LawMangerEntity model = new LawMangerBll().Single(id); return(View(model)); }