Esempio n. 1
0
 public ActionResult GetCurrentUser()
 {
     if (currentUser == null)
     {
         return(Content("No"));
     }
     else
     {
         YSWL.MALL.BLL.Members.SiteMessage msgBll = new BLL.Members.SiteMessage();
         YSWL.MALL.BLL.SNS.ReferUsers      refBll = new YSWL.MALL.BLL.SNS.ReferUsers();
         int    syscount     = msgBll.GetSystemMsgNotReadCount(currentUser.UserID, -1, currentUser.UserType);
         int    privatecount = msgBll.GetReceiveMsgNotReadCount(currentUser.UserID, -1);
         int    referecount  = refBll.GetReferNotReadCountByType(currentUser.UserID, (int)YSWL.MALL.Model.SNS.EnumHelper.ReferType.Post);
         string name         = String.IsNullOrWhiteSpace(currentUser.NickName) ? currentUser.UserName : currentUser.NickName;
         return(Content(name + "|" + currentUser.UserID + "|" + syscount + "|" + privatecount + "|" + referecount));
     }
 }
Esempio n. 2
0
        /// <summary>
        /// 网站头部的分部视图
        /// </summary>
        /// <returns></returns>
        public ActionResult Header()
        {
            BLL.SysManage.WebSiteSet webSiteSet = new BLL.SysManage.WebSiteSet(Model.SysManage.ApplicationKeyType.SNS);
            ViewBag.Logo    = webSiteSet.LogoPath;
            ViewBag.WebName = webSiteSet.WebName;
            ViewBag.Domain  = webSiteSet.WebSite_Domain;

            if (currentUser != null)
            {
                int syscount = 0;
                List <YSWL.MALL.Model.SNS.MsgTip> list   = new List <Model.SNS.MsgTip>();
                YSWL.MALL.BLL.Members.SiteMessage msgBll = new BLL.Members.SiteMessage();
                YSWL.MALL.BLL.SNS.ReferUsers      refBll = new YSWL.MALL.BLL.SNS.ReferUsers();
                syscount = msgBll.GetSystemMsgNotReadCount(currentUser.UserID, -1, currentUser.UserType);
                if (syscount > 0)
                {
                    YSWL.MALL.Model.SNS.MsgTip sysmodel = new Model.SNS.MsgTip();
                    sysmodel.Count    = syscount;
                    sysmodel._MsgType = (int)YSWL.MALL.Model.SNS.EnumHelper.MsgType.System;
                    list.Add(sysmodel);
                }
                int privatecount = 0;
                privatecount = msgBll.GetReceiveMsgNotReadCount(currentUser.UserID, -1);
                if (privatecount > 0)
                {
                    YSWL.MALL.Model.SNS.MsgTip privatemodel = new Model.SNS.MsgTip();
                    privatemodel.Count    = privatecount;
                    privatemodel._MsgType = (int)YSWL.MALL.Model.SNS.EnumHelper.MsgType.Private;
                    list.Add(privatemodel);
                }
                int referecount = 0;
                referecount = refBll.GetReferNotReadCountByType(currentUser.UserID, (int)YSWL.MALL.Model.SNS.EnumHelper.ReferType.Post);
                if (referecount > 0)
                {
                    YSWL.MALL.Model.SNS.MsgTip refermodel = new Model.SNS.MsgTip();
                    refermodel.Count    = referecount;
                    refermodel._MsgType = (int)YSWL.MALL.Model.SNS.EnumHelper.MsgType.Refer;
                    list.Add(refermodel);
                }
                ViewBag.Current   = currentUser;
                ViewBag.Pointer   = Common.Globals.SafeInt(Request.QueryString["pointer"], 0);
                ViewBag.RankScore = Common.Globals.SafeInt(Request.QueryString["rankscore"], 0);
                // return View("_UserHeader", list);
            }
            return(View("_Header"));
        }