/// <summary> /// 我的消息分布视图 /// </summary> /// <returns></returns> public ActionResult MyNotice() { List <NoticeTable> list = NoticeBll.SelectUserNotice(Convert.ToInt32(Session["userid"])); if (list != null && list.Count() > 0) { list = list.OrderByDescending(p => p.NoticeID).ToList(); } //修改用户未查看的消息为已经查看 NoticeBll.UpdateUserNotice(Convert.ToInt32(Session["userid"])); return(PartialView("MyNotice", list)); }
// GET: User public ActionResult UserIndex() { //查询用户的订单 Session["userorder"] = OrderBll.SelectUserOrder(Convert.ToInt32(Session["userid"])); //获取所有图片 Session["goodphotos"] = GoodsPhotoBll.SelectAllGoodsPhoto(); //获得用户未查看的消息 try { ViewBag.nolook = NoticeBll.SelectUserNotice(Convert.ToInt32(Session["userid"])).Where(p => p.IsLook == 0).ToList(); } catch (Exception) { ViewBag.nolook = null; } return(View(UserInfoBll.SelectUser(Convert.ToInt32(Session["userid"])))); }