Exemplo n.º 1
0
        public ActionResult NewsManage()
        {
            #region 访问权限
            var           user                = (Maticsoft.Model.User_Info)ViewBag.curentUser;
            var           curentUser          = _iuserService.getUserByID(user.Id);
            var           ManagePermission    = curentUser.UserGroup.ManagePermission;
            List <string> managePermissionstr = new List <string>(ManagePermission.Split(','));
            var           managePermission    = managePermissionstr.Select(x => Convert.ToInt32(x)).ToList();

            if (curentUser.UserGroupID != 1)
            {
                if (!managePermission.Contains((int)SortEnum.sortClass.newsManage))
                {
                    return(new RedirectResult("/Home/deny"));
                }
            }
            #endregion



            var model = new NewsModelList();

            #region 栏目权限
            //var user = (Maticsoft.Model.User_Info)ViewBag.curentUser;
            //var curentUser = _iuserService.getUserByID(user.Id);
            var sectionPermission = curentUser.UserGroup.SectionPermission;
            try
            {
                List <string> sectionIDstr = new List <string>(sectionPermission.Split(','));
                var           sectionIDs   = sectionIDstr.Select(x => Convert.ToInt32(x)).ToList();
                ViewBag.DefaultSectionID = sectionIDs.FirstOrDefault();
            }
            catch
            {
                ViewBag.DefaultSectionID = 0;
            }
            ViewBag.markID = user.Id;
            #endregion

            //var sections = _isectionService.getAllSection().SectionLists.Where(x => x.ParentID == 0).ToList();
            //ViewBag.sections = sections;

            return(View(model));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 回收站
        /// </summary>
        /// <returns></returns>
        public ActionResult recycle()
        {
            #region 访问权限
            var           user                = (Maticsoft.Model.User_Info)ViewBag.curentUser;
            var           curentUser          = _iuserService.getUserByID(user.Id);
            var           ManagePermission    = curentUser.UserGroup.ManagePermission;
            List <string> managePermissionstr = new List <string>(ManagePermission.Split(','));
            var           managePermission    = managePermissionstr.Select(x => Convert.ToInt32(x)).ToList();

            if (curentUser.UserGroupID != 1)
            {
                if (!managePermission.Contains((int)SortEnum.sortClass.recycle))
                {
                    return(new RedirectResult("/Home/deny"));
                }
            }
            #endregion

            var model = new NewsModelList();
            return(View(model));
        }