protected void rptCommentForeList_ItemDataBound(object sender, RepeaterItemEventArgs e) { DataRowView view = e.Item.DataItem as DataRowView;//定义一个DataRowView的实例 int id = Convert.ToInt32(view["id"]); this.lbInfoTitle.Text = view["title"].ToString(); Tz888.BLL.LeaveMsg msgBll = new Tz888.BLL.LeaveMsg(); Tz888.Model.LeaveMsg msg = new Tz888.Model.LeaveMsg(); Tz888.Model.LeaveMsg resMsg = new Tz888.Model.LeaveMsg(); string result = ""; Label lb = new Label(); LinkButton btn = new LinkButton(); msg = msgBll.GetComment(id, 0); if (msg != null) { //if (msg.IsResponse == 1) { Tz888.BLL.Conn dal = new Tz888.BLL.Conn(); string strWhere = ""; strWhere = "fatherId=" + id + ""; long i = 0; long j = 0; long k = 0; DataTable dt = dal.GetList("infocommentTab", "id", "commentContent", strWhere, "id", ref i, k, ref j); System.Web.UI.HtmlControls.HtmlContainerControl divOnline = (HtmlContainerControl)e.Item.FindControl("aReply"); if (dt != null && dt.Rows.Count > 0) { result = dt.Rows[0][0].ToString(); if (divOnline != null) { divOnline.Style.Add("display", "none"); } btn = (LinkButton)e.Item.FindControl("btnRes"); lb = (Label)e.Item.FindControl("ResView"); lb.Text = result; } else { if (divOnline != null) { divOnline.Style.Add("display", "block"); } } } } if (view["infoOwner"].ToString().Trim() != Page.User.Identity.Name) { System.Web.UI.HtmlControls.HtmlGenericControl divRes = (System.Web.UI.HtmlControls.HtmlGenericControl)e.Item.FindControl("aReply"); divRes.Style.Add("display", "none"); } }
protected void rptCommentReceive_ItemDataBound(object sender, RepeaterItemEventArgs e) { DataRowView view = e.Item.DataItem as DataRowView;//定义一个DataRowView的实例 int id = Convert.ToInt32(view["id"]); Tz888.BLL.LeaveMsg msgBll = new Tz888.BLL.LeaveMsg(); Tz888.Model.LeaveMsg msg = new Tz888.Model.LeaveMsg(); Tz888.Model.LeaveMsg resMsg = new Tz888.Model.LeaveMsg(); string result = ""; Label lb = new Label(); LinkButton btn = new LinkButton(); msg = msgBll.GetComment(id, 0); if (msgBll != null) { if (msg.IsResponse == 1) { Tz888.BLL.Conn dal = new Tz888.BLL.Conn(); string strWhere = ""; strWhere = "fatherId='" + id + "'"; long i = 1; long j = 1; long k = 1; DataTable dt = dal.GetList("infocommentTab", "id", "commentContent", strWhere, "id", ref i, k, ref j); if (dt != null && dt.Rows.Count > 0) { result = dt.Rows[0][0].ToString(); } System.Web.UI.HtmlControls.HtmlGenericControl divOnline = (HtmlGenericControl)e.Item.FindControl("divResView"); if (divOnline != null) { divOnline.Style.Add("display", "block"); } btn = (LinkButton)e.Item.FindControl("btnRes"); btn.Enabled = false; } else { System.Web.UI.HtmlControls.HtmlGenericControl divOnline = (HtmlGenericControl)e.Item.FindControl("divResView"); if (divOnline != null) { divOnline.Style.Add("display", "none"); } } } lb = (Label)e.Item.FindControl("ResView"); lb.Text = result; //return result; }