示例#1
0
 public ActionResult Header()
 {
     WebSiteSet set = new WebSiteSet(ApplicationKeyType.SNS);
     ((dynamic) base.ViewBag).Logo = set.LogoPath;
     ((dynamic) base.ViewBag).WebName = set.WebName;
     ((dynamic) base.ViewBag).Domain = set.WebSite_Domain;
     if (base.currentUser == null)
     {
         return base.View("_Header");
     }
     int num = 0;
     List<MsgTip> model = new List<MsgTip>();
     Maticsoft.BLL.Members.SiteMessage message = new Maticsoft.BLL.Members.SiteMessage();
     Maticsoft.BLL.SNS.ReferUsers users = new Maticsoft.BLL.SNS.ReferUsers();
     num = message.GetSystemMsgNotReadCount(base.currentUser.UserID, -1, base.currentUser.UserType);
     if (num > 0)
     {
         MsgTip item = new MsgTip {
             Count = num,
             _MsgType = 0
         };
         model.Add(item);
     }
     int receiveMsgNotReadCount = 0;
     receiveMsgNotReadCount = message.GetReceiveMsgNotReadCount(base.currentUser.UserID, -1);
     if (receiveMsgNotReadCount > 0)
     {
         MsgTip tip2 = new MsgTip {
             Count = receiveMsgNotReadCount,
             _MsgType = 1
         };
         model.Add(tip2);
     }
     int referNotReadCountByType = 0;
     referNotReadCountByType = users.GetReferNotReadCountByType(base.currentUser.UserID, 0);
     if (referNotReadCountByType > 0)
     {
         MsgTip tip3 = new MsgTip {
             Count = referNotReadCountByType,
             _MsgType = 2
         };
         model.Add(tip3);
     }
     ((dynamic) base.ViewBag).Current = base.currentUser;
     ((dynamic) base.ViewBag).Pointer = Globals.SafeInt(base.Request.QueryString["pointer"], 0);
     return base.View("_UserHeader", model);
 }
示例#2
0
 public ActionResult GetCurrentUser()
 {
     if (base.currentUser == null)
     {
         return base.Content("No");
     }
     Maticsoft.BLL.Members.SiteMessage message = new Maticsoft.BLL.Members.SiteMessage();
     Maticsoft.BLL.SNS.ReferUsers users = new Maticsoft.BLL.SNS.ReferUsers();
     int num = message.GetSystemMsgNotReadCount(base.currentUser.UserID, -1, base.currentUser.UserType);
     int receiveMsgNotReadCount = message.GetReceiveMsgNotReadCount(base.currentUser.UserID, -1);
     int referNotReadCountByType = users.GetReferNotReadCountByType(base.currentUser.UserID, 0);
     string str = string.IsNullOrWhiteSpace(base.currentUser.NickName) ? base.currentUser.UserName : base.currentUser.NickName;
     return base.Content(string.Concat(new object[] { str, "|", base.currentUser.UserID, "|", num, "|", receiveMsgNotReadCount, "|", referNotReadCountByType }));
 }