Example #1
0
        public async Task <IActionResult> Index()
        {
            PageInfo pageinfo = new PageInfo {
                IsPaging = false
            };

            (List <ArticleType> list, long count)datas = await ArticleTypeDAL.QueryAsync(q => q.Status == 1, null, pageinfo);

            ViewBag.ArticleTreeDatas = (from p in datas.list where (p.UpID == 0 || p.UpID == null)select new ArticleTypeTreeNode(datas.list, p)
            {
            }).ToList();
            return(View());
        }
Example #2
0
        public async Task <ActionResult> CreateModule(string id)
        {
            (List <ArticleType> list, long count)articles = await ArticleTypeDAL.QueryAsync(w => w.Status == 1);

            ViewBag.ArticleTypeList = articles.list.Select(s => new SelectListItem {
                Text = s.TypeName, Value = s.Id.ToString()
            }).ToList();
            ArticleContent model = new ArticleContent()
            {
                OriginType = 0
            };

            if (!string.IsNullOrEmpty(id))
            {
                model.TypeID = Convert.ToInt32(id);
            }
            return(View(model));
        }