public ActionResult DocTypeEditModule(string id, bool ischildren) { ViewBag.DocumentTypeList = DocumentTypeDAL.Query(w => w.Status == 1).list.Select(s => new SelectListItem { Text = s.TypeName, Value = s.ID.ToString() }).ToList(); DocumentType model = new DocumentType(); if (ischildren) { if (!string.IsNullOrEmpty(id)) { model.UpID = Convert.ToInt32(id); } } else { if (!string.IsNullOrEmpty(id)) { int _id = Convert.ToInt32(id); model = DocumentTypeDAL.GetByOne(w => w.ID == _id); } } return(View(model)); }
public IActionResult DocTypeList(string searchContent, string seniorQueryJson, int page = 1, int limit = 10) { DocumentType model = null; if (!string.IsNullOrWhiteSpace(seniorQueryJson)) { model = Newtonsoft.Json.JsonConvert.DeserializeObject <DocumentType>(seniorQueryJson); } Expression <Func <DocumentType, bool> > predicate = i => 1 == 0; var searchPredicate = PredicateExtensions.True <DocumentType>(); if (model != null) { searchPredicate = searchPredicate.And(u => u.Status == 1); } var contents = DocumentTypeDAL.Query(searchPredicate); return(Json(new DataPage <DocumentType> { code = "0", msg = "", count = contents.count, data = contents.list })); }
// GET: Documents public IActionResult Index(int id = 1) { var typeList = DocumentTypeDAL.Query(d => d.ID != 0).list; var contentlist = DocumentContentDAL.Query(d => d.Status == 1).list; //适应两层结构即可 var query = (from p in typeList where p.UpID == null || p.UpID == 0 select new TreeData(p, typeList).AddChildrens(GetContentTreeData(p.ID, contentlist), (tid) => GetContentTreeData(tid, contentlist))).ToList(); ViewBag.DocumentList = query; ViewBag.DocID = id; return(View()); }
public IActionResult DocType() { DocumentType model = new DocumentType(); ViewBag.TypeList = DocumentTypeDAL.Query(w => w.Status == 1).list.Select(s => new DocumentTypeTreeNode { id = s.ID.ToString(), pid = (s.UpID ?? 0).ToString(), title = s.TypeName, tag = s.Tag, createdt = s.CreateDt }).ToList(); return(View(model)); }
public ActionResult DocContentEditModule(string id) { ViewBag.DocumentTypeList = DocumentTypeDAL.Query(w => w.Status == 1).list.Select(s => new SelectListItem { Text = s.TypeName, Value = s.ID.ToString() }).ToList(); DocumentContent model = new DocumentContent() { OriginType = 0 }; if (!string.IsNullOrEmpty(id) && id != "0") { int _id = Convert.ToInt32(id); model = DocumentContentDAL.GetByOne(w => w.ID == _id); } return(View(model)); }