コード例 #1
0
        public IActionResult AddArticleCategory()
        {
            //获取上级栏目
            IList <ArticleCategory> list = ArticleCategory.GetListTree(0, -1, true, true);

            ViewBag.ListTree = list;
            //获取模板 模板规则,以Index_开头的,为栏目列表,以Detial_开头的为文章详情
            List <string> listTpls = new List <string>();
            var           asms     = AppDomain.CurrentDomain.GetAssemblies();

            foreach (var asmItem in asms)
            {
                string fullName = asmItem.GetName().ToString();
                if (fullName.IndexOf("COMCMS.Web.Views") > -1)
                {
                    var types = asmItem.GetTypes().Where(e => e.Name.StartsWith("Views_Article")).ToList();
                    if (types.Count == 0)
                    {
                        continue;
                    }
                    foreach (var type in types)
                    {
                        string viewName = type.Name.Replace("Views_Article_", "") + ".cshtml";
                        listTpls.Add(viewName);
                    }
                }
            }
            ViewBag.ListTpl = listTpls;
            Core.Admin.WriteLogActions("查看添加文章栏目页面;");
            return(View());
        }
コード例 #2
0
        public IActionResult ArticleCategoryList()
        {
            IList <ArticleCategory> list = ArticleCategory.GetListTree(0, -1, false, true);

            Core.Admin.WriteLogActions("查看文章栏目列表页面;");
            return(View(list));
        }
コード例 #3
0
        public IActionResult EditArticleCategory(int id)
        {
            ArticleCategory entity = ArticleCategory.Find(ArticleCategory._.Id == id);

            if (entity == null)
            {
                return(EchoTipPage("系统找不到本记录!"));
            }
            //获取上级栏目
            IList <ArticleCategory> list = ArticleCategory.GetListTree(0, -1, true, false);

            ViewBag.ListTree = list;

            //获取模板 模板规则,以Index_开头的,为栏目列表,以Detial_开头的为文章详情
            List <string> listTpls = new List <string>();
            var           asms     = AppDomain.CurrentDomain.GetAssemblies();

            foreach (var asmItem in asms)
            {
                var types = asmItem.GetTypes().Where(e => e.Name.StartsWith("Views_Article")).ToList();
                if (types.Count == 0)
                {
                    continue;
                }
                foreach (var type in types)
                {
                    string viewName = type.Name.Replace("Views_Article_", "") + ".cshtml";
                    listTpls.Add(viewName);
                }
            }
            ViewBag.ListTpl = listTpls;
            Core.Admin.WriteLogActions("查看/编辑文章栏目(id:" + id + ")页面;");
            return(View(entity));
        }
コード例 #4
0
        public IActionResult MoveArticle()
        {
            //获取上级栏目
            IList <ArticleCategory> list = ArticleCategory.GetListTree(0, -1, true, false);

            ViewBag.ListKinds = list;
            return(View());
        }
コード例 #5
0
        public IActionResult ArticleList()
        {
            //获取上级栏目
            IList <ArticleCategory> list = ArticleCategory.GetListTree(0, -1, true, true);

            ViewBag.ListKinds = list;
            Core.Admin.WriteLogActions("查看文章列表;");
            return(View());
        }
コード例 #6
0
        public IActionResult AddArticleCategory()
        {
            //获取上级栏目
            IList <ArticleCategory> list = ArticleCategory.GetListTree(0, -1, true, false);

            ViewBag.ListTree = list;
            //获取模板
            Core.Admin.WriteLogActions("查看添加文章栏目页面;");
            return(View());
        }
コード例 #7
0
        public IActionResult AddArticle()
        {
            IList <ArticleCategory> list = ArticleCategory.GetListTree(0, -1, true, true);

            ViewBag.ListKinds = list;
            string lastkid = SessionHelper.GetSession("com_add_article_kid").ToString();

            ViewBag.lastkid = lastkid;
            Core.Admin.WriteLogActions("查看添加文章页面;");
            return(View());
        }
コード例 #8
0
        public IActionResult EditArticle(int id)
        {
            IList <ArticleCategory> list = ArticleCategory.GetListTree(0, -1, true, true);

            ViewBag.ListKinds = list;

            Article entity = Article.Find(Article._.Id == id);

            if (entity == null)
            {
                return(EchoTipPage("系统找不到本记录!"));
            }

            Core.Admin.WriteLogActions("查看文章(" + id + ");");

            return(View(entity));
        }
コード例 #9
0
        public IActionResult EditArticleCategory(int id)
        {
            ArticleCategory entity = ArticleCategory.Find(ArticleCategory._.Id == id);

            if (entity == null)
            {
                return(EchoTipPage("系统找不到本记录!"));
            }
            //获取上级栏目
            IList <ArticleCategory> list = ArticleCategory.GetListTree(0, -1, true, false);

            ViewBag.ListTree = list;
            //获取模板
            //List<string> listtpl = COMCMS.Common.IOHelper.GetDirFiles(new DirectoryInfo(Server.MapPath("~/Views/article")));
            //ViewBag.ListTpl = listtpl;
            Core.Admin.WriteLogActions("查看/编辑文章栏目(id:" + id + ")页面;");
            return(View(entity));
        }
コード例 #10
0
        public IActionResult AddAdminRole()
        {
            //获取所有的菜单列表
            IList <AdminMenu> list = AdminMenu.GetListTree(0, -1, false, false);

            ViewBag.MenuList = list;
            //获取所有文章 商品栏目
            IList <ArticleCategory> aclist = ArticleCategory.GetListTree(0, -1, true, true);

            ViewBag.aclist = aclist;

            IList <Category> pclist = Category.GetListTree(0, -1, true, true);

            ViewBag.pclist = pclist;

            Core.Admin.WriteLogActions("查看添加管理组页面;");
            return(View());
        }
コード例 #11
0
        public IActionResult EditAdminRole(int id)
        {
            AdminRoles entity = AdminRoles.Find(AdminRoles._.Id == id);

            if (entity == null)
            {
                return(EchoTipPage("系统找不到本记录!", 0, true, ""));
            }
            if (string.IsNullOrEmpty(entity.Powers))
            {
                entity.Powers = "[]";
            }
            if (string.IsNullOrEmpty(entity.Menus))
            {
                entity.Menus = "[]";
            }
            if (string.IsNullOrEmpty(entity.AuthorizedArticleCagegory))
            {
                entity.AuthorizedArticleCagegory = "[]";
            }
            if (string.IsNullOrEmpty(entity.AuthorizedCagegory))
            {
                entity.AuthorizedCagegory = "[]";
            }
            //获取所有的菜单列表
            IList <AdminMenu> list = AdminMenu.GetListTree(0, -1, false, false);

            //获取所有文章 商品栏目
            IList <ArticleCategory> aclist = ArticleCategory.GetListTree(0, -1, true, true);

            ViewBag.aclist = aclist;

            IList <Category> pclist = Category.GetListTree(0, -1, true, true);

            ViewBag.pclist = pclist;

            ViewBag.MenuList = list;
            Core.Admin.WriteLogActions($"查看管理组({id})详情;");
            return(View(entity));
        }