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)); }
private void MyBind() { M_User_Plat upMod = upBll.SelByNameAndPwd(uname, upwd, true); if (upMod == null) { function.WriteErrMsg("您没有权限下载该用户的时间线记录!"); } GroupDT = groupBll.SelByCompID(upMod.CompID); int pageCount = 0; DataTable dt = msgBll.SelByPid(50000, 1, out pageCount, 0, upMod, upMod.Gid, 0, Filter, MsgType, Skey, upMod.UserID.ToString(), DateStr, Mid); //-------------------针对时间线进行处理 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"; } } MsgRepeater.DataSource = dt; MsgRepeater.DataBind(); }
private void MyBind() { M_User_Plat upMod = B_User_Plat.GetLogin(); GroupDT = groupBll.SelByCompID(upMod.CompID); //-----------------权限校验 if (CurProID > 0) { if (!proBll.HasAuth(upMod.UserID, CurProID)) { function.WriteErrMsg("你没有权限访问该项目!!"); } } 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"; } } } MsgRepeater.DataSource = dt; MsgRepeater.DataBind(); }
public void MyBind() { pid = Convert.ToInt32(Request.QueryString["Pid"]); pageSize = 20;// Convert.ToInt32(Request.QueryString["PageSize"]); pageIndex = Convert.ToInt32(Request.QueryString["PageIndex"]); int pageCount = 0; //不限,内部分 DataTable dt = msgBll.SelByPid(1000, pageIndex, out pageCount, pid); dt.DefaultView.RowFilter = "Source='bar'"; DataTable barDT = dt.DefaultView.ToTable(); dt.DefaultView.RowFilter = "Source='plat'"; dt.DefaultView.Sort = "CDate asc"; DataTable platDT = dt.DefaultView.ToTable(); PagedDataSource ds = (PagedDataSource)PageHelper.GetPageDT(pageSize, pageIndex, platDT, out pageCount); if (barDT.Rows.Count > 0) { bar_div.Visible = true; Bar_RPT.DataSource = barDT; Bar_RPT.DataBind(); } if (pageCount > 1) { Literal pageHtml = new Literal(); pageHtml.EnableViewState = false; pageHtml.Text = CreatePageHtml(pageCount, pageIndex); ReplyList_RPT.DataSource = ds; ReplyList_RPT.DataBind(); ReplyList_RPT.Items[(ReplyList_RPT.Items.Count - 1)].Controls.Add(pageHtml); } else { ReplyList_RPT.DataSource = ds; ReplyList_RPT.DataBind(); } }
private void MyBind() { if (Mid < 0) { Response.Redirect("/PItem?ID=" + (-Mid)); return; } M_Blog_Msg msgMod = msgBll.SelReturnModel(Mid); M_User_Plat user = B_User_Plat.GetLogin(); //if (user.CompID != msgModel.CompID){function.WriteErrMsg("此文章您没有权限访问!");} CDate_L.Text = msgMod.CDate.ToString("yyyy年MM月dd日 hh:mm"); Read_L.Text = "<span title='阅读量'> <i class='fa fa-eye'></i>" + msgMod.ReadNumber + "</span>"; Content_Lit.Text = msgMod.MsgContent; ids_Hid.Value = msgMod.LikeIDS; Attach_Lit.Text = GetAttach(msgMod.Attach); if (msgMod.MsgType == 2) { LoadVote(); } //--------------------------------- DataTable dt = null; int pageCount = 0; dt = likeBll.SelLikeUsers(Mid, "plat"); //Like_RPT.DataSource = dt; //Like_RPT.DataBind(); Empty_Span_Like.Visible = dt.Rows.Count <= 0; dt = msgBll.SelByPid(5, CPage, out pageCount, Mid); MsgRepeater.DataSource = dt; MsgRepeater.DataBind(); Empty_Span_Comm.Visible = dt.Rows.Count <= 0; commCount_L.Text = msgBll.GetSumCount(Mid).ToString(); UserInfo_Hid.Value = user.TrueName + ":" + user.UserFace; likeCount_L.Text = msgMod.LikeIDS.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).Length.ToString(); MsgPage_L.Text = PageCommon.CreatePageHtml(pageCount, CPage); }