示例#1
0
        /// <summary>
        /// 后台公告分布视图
        /// </summary>
        /// <returns></returns>
        public ActionResult BackNoticePartial(int?pageindex, int?LookType)
        {
            int index = LookType ?? 0;
            List <NoticeTable> list = new List <NoticeTable>();

            if (index == 0)
            {
                list = NoticeBll.SelectAllNotice().Where(p => p.UserID == null).ToList();
            }
            else
            {
                list = NoticeBll.SelectAllNotice().Where(p => p.UserID != null).ToList();
            }
            if (list != null && list.Count() > 0)
            {
                Session["noticecount"] = list.Count();
            }
            else
            {
                Session["noticecount"] = 0;
            }
            ViewBag.LookType           = index;
            ViewBag.pageindex          = pageindex ?? 1;
            Session["noticepagecount"] = Math.Ceiling(list.Count() / 10.0);
            Session["allnotice"]       = list.Skip(((pageindex ?? 1) - 1) * 10).Take(10).ToList();
            return(PartialView("BackNoticePartial"));
        }
示例#2
0
        /// <summary>
        /// 后台公告界面
        /// </summary>
        /// <returns></returns>
        public ActionResult BackNoticeIndex()
        {
            Session["li_1"] = 4;
            Session["li_2"] = 0;
            //查询所有反馈
            List <NoticeTable> list = NoticeBll.SelectAllNotice().Where(p => p.UserID == null).ToList();

            if (list != null && list.Count() > 0)
            {
                Session["noticecount"] = list.Count();
            }
            else
            {
                Session["noticecount"] = 0;
            }
            ViewBag.IsDealwith         = 2;
            Session["noticepagecount"] = Math.Ceiling(list.Count() / 10.0);
            Session["allnotice"]       = list.Take(10).ToList();
            Session["noticeuserlist"]  = UserInfoBll.SelectAllUser();
            return(View());
        }
 // GET: Notice
 public ActionResult NoticeIndex()
 {
     return(View(NoticeBll.SelectAllNotice().Where(p => p.UserID == null).ToList()));
 }