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(); }
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); }
public void MyBind() { int pageCount = 0; DataTable dt = new DataTable(); barMod = barBll.SelReturnModel(Pid); if (barMod == null) { function.WriteErrMsg("该贴子不存在!!"); } M_GuestBookCate cateMod = bookBll.GetCate(barMod.CateID); M_UserInfo mu = tpuserBll.GetLogin();//barBll.GetUser(); if (barMod.Status != (int)ZLEnum.ConStatus.Audited && cateMod.Status != 1) { function.WriteErrMsg("该贴子需要审核通过才能浏览!"); } if (cateMod.IsBarOwner(mu.UserID))//吧主 { barowner_div.Visible = true; IsBarOwner = true; } else { if (!authBll.AuthCheck(cateMod, mu)) { function.WriteErrMsg("你没有访问权限或未登录,请<a href='/User/Login.aspx?Returnurl=/" + B_Guest_Bar.CreateUrl(2, Pid, CPage) + "'>登录</a>后查看"); //if (cateMod.NeedLog == 1 && mu.UserID == 0) function.WriteErrMsg("该栏目必须<a href='/User/Login.aspx?returnUrl=/Post" + Pid + "/Default_1.aspx'>登录</a>后才能访问"); } if ((!authBll.AuthCheck(cateMod, mu, "send"))) { send_div.Visible = false; noauth_div.Visible = true; } } dt = barBll.SelByID(Pid); barBll.AddHitCount(Pid); hitcount_span.InnerText = (barMod.HitCount + 1).ToString(); dt.Columns.Add("Layer", typeof(int)); for (int i = 0; i < dt.Rows.Count; i++) { dt.Rows[i]["Layer"] = (i + 1); } if (Filter.Contains("OnlyLayer")) { dt.DefaultView.RowFilter = "CUser = "******"该帖子已删除!!", "/" + B_Guest_Bar.CreateUrl(1, Cid)); } function.Script(this, "SetImg('" + cateMod.BarImage + "');"); ReturnBar_a.Text = "<i class='fa fa-arrow-circle-left'></i>返回" + cateMod.CateName; ReturnBar_a.NavigateUrl = "/" + CreateUrl(1, Cid); int mcount = 0, rcount = 0; barBll.GetCount(Cid, out mcount, out rcount); if (!barMod.LikeIDS.Contains("," + mu.UserID + ",")) { LikeBtn_Li.Text = string.Format("<input type='button' value='收藏' id='liketie' onclick='LikeTie(this,{0})'class='btn btn-xs btn-primary' />", Pid); } else { LikeBtn_Li.Text = "<input type='button' value='取消收藏' id='liketie' onclick='LikeTie(this," + Pid + ")'class='btn btn-xs btn-primary liked' />"; } //判断是否显示编辑按钮 if (UserID == barMod.CUser) { EditBtn_DIV.Visible = true; } }