예제 #1
0
        public IActionResult MsgListBody()
        {
            //权限校验
            //if (CurProID > 0)
            //{
            //    if (!proBll.HasAuth(upMod.UserID, CurProID)) { return WriteErr("你没有权限访问该项目!!"); }
            //}
            DataTable LikesDt   = new DataTable();
            int       pageCount = 0;
            DataTable dt        = msgBll.SelByPid(PSize, CPage, out pageCount, 0, upMod, upMod.Gid, CurProID, Filter, MsgType, Skey, Uids, DateStr, Mid);
            //LikesDt
            string msgids = "";

            foreach (DataRow dr in dt.Rows)
            {
                msgids += dr["ID"].ToString().Trim('-') + ",";
            }
            if (!string.IsNullOrEmpty(msgids))
            {
                LikesDt = likeBll.SelByMsgIDS(msgids.Trim(','), "plat");
            }
            if (Filter.Contains("atuser"))//移除@
            {
                upBll.RemoveAtCount(upMod.UserID);
            }
            //-------------------针对时间线进行处理
            if (LView.Equals("timeline") || LView.Equals("tomht"))
            {
                //if (CPage > 1) { Page.FindControl("ttitle_div").Visible = false; }
                DateTime TimeLine = DateTime.MinValue;
                dt.Columns.Add("timeline", typeof(string));
                foreach (DataRow dr in dt.Rows)
                {
                    if (TimeLine == DateTime.MinValue || DateHelper.IsMoreThanOne(TimeLine, Convert.ToDateTime(dr["cdate"])))
                    {
                        TimeLine       = Convert.ToDateTime(dr["cdate"]);
                        dr["timeline"] = "date";
                    }
                    else
                    {
                        dr["timeline"] = "time";
                    }
                }
            }
            ViewBag.LikesDt = LikesDt;
            ViewBag.CPage   = CPage;
            ViewBag.UserID  = mu.UserID;
            return(PartialView("MsgListBody", dt));
        }