/// <summary> /// 绑定信息列表 /// </summary> public void ListInfoBind() { if (!string.IsNullOrEmpty(Request.QueryString["page"]))//分页 { pageIndex = int.Parse(Request.QueryString["page"]); } //string sstxt = this.scbar_txt.Value;//搜索 string type = Request.QueryString["type_pb"]; string typecid = Request.QueryString["typecid"]; string fk = Request.QueryString["fk"]; string ss = Request.QueryString["ss"]; string px = Request.QueryString["px"]; string st = Request.QueryString["st"]; string orderBy = string.Empty; if (!string.IsNullOrEmpty(st)) { switch (st) { case "0": break; case "1": To_Posts.ReleaseTime = DateTime.Now.AddDays(-1); break; case "2": To_Posts.ReleaseTime = DateTime.Now.AddDays(-2); break; case "7": To_Posts.ReleaseTime = DateTime.Now.AddDays(-7); break; case "30": To_Posts.ReleaseTime = DateTime.Now.AddMonths(-1); break; case "60": To_Posts.ReleaseTime = DateTime.Now.AddMonths(-2); break; } } if (!string.IsNullOrEmpty(px)) { switch (px) { case "1": //发帖时间 orderBy = "p.ReleaseTime desc"; break; case "2": //回复数 orderBy = " p.ReCount desc"; break; case "3": orderBy = " p.LookCount desc"; break; case "4": //最后发表时间 orderBy = " p.LastTime desc"; break; case "5": orderBy = " p.LookCount desc"; break; } } if (!string.IsNullOrEmpty(type)) //热点问题 { if (type == "hot") //热点问题 { To_Posts.HotCount = BBsConfig.HotCount; } if (type == "back")//已反馈 { To_Posts.isback = "1"; } if (type == "noback")//未反馈 { To_Posts.isback = "0"; } if (type == "myself")//我自己的问题 { To_Posts.ReleaseUser = UserInfo.LoginName; } } if (!string.IsNullOrEmpty(typecid))//导航 { int cid = 0; if (int.TryParse(typecid, out cid)) { To_Posts.CID = cid; } } if (!string.IsNullOrEmpty(ss)) { To_Posts.Title = ss; } if (!string.IsNullOrEmpty(fk)) { To_Posts.isFeedback = 1; } DataTable dt = BLL_Post.GetPostsList(To_Posts, pageIndex, pageSize, orderBy, out totalpage); if (dt.Rows.Count > 0) { Re_InfoList.DataSource = dt; Re_InfoList.DataBind(); } strtt = DividePage.Pager(pageSize, totalpage, pageIndex, url);//分页 }
protected void Page_Load(object sender, EventArgs e) { if (UserInfo.IsFeedback) { sn = "<input type=\"radio\" name=\"isAnonymity\" value=\"0\" checked=\"checked\" />实名"; } else { sn = "<input type=\"radio\" name=\"isAnonymity\" value=\"1\" />匿名<input type=\"radio\" name=\"isAnonymity\" value=\"0\" checked=\"checked\" />实名"; } if (UserInfo != null) { userName = UserInfo.LoginName; if (UserInfo.IsADUser) { intIsADUser = 1; } loginname = UserInfo.LoginName; } if (!IsPostBack) { listAllPost = pBll.GetPostsList(); if (!string.IsNullOrEmpty(Request.QueryString["fatherID"])) { fatherID = Convert.ToInt32(Request.QueryString["fatherID"].ToString()); } if (!string.IsNullOrEmpty(Request.QueryString["pageIndex"])) { pageIndex = int.Parse(Request.QueryString["pageIndex"]); } if (!string.IsNullOrEmpty(Request.QueryString["content"])) { content = Request.QueryString["content"].ToString().Trim().Replace(" ", ""); } //增加浏览次数 PostsBLL postBll = new PostsBLL(); postModel = postBll.GetPostsEntity(fatherID); postModel.LookCount += 1; postBll.UpdatePosts(postModel); cID = Convert.ToInt32(postModel.CID); //导航 CategoryBLL catBll = new CategoryBLL(); List <Category> listCat = catBll.GetCategoryList().Where(c => c.ID == cID).ToList(); if (listCat.Count > 0) { Category catModel = listCat[0]; catName = catModel.Name; catId = catModel.ID.ToString(); } title = "意见与反馈 - " + catName; //绑定回复数据 if (content == "请输入搜索内容") { content = ""; } repTo.Content = content; repTo.FatherID = fatherID; string orderBy = " isReFeedback desc,ReDatetime asc"; dtReposts = repBll.GetRePostsList(repTo, pageIndex, pageSize, orderBy, out rowCount); //分页 string url = "detail.aspx?pageIndex={0}&fatherID=" + fatherID; strtt = DividePage.Pager(pageSize, rowCount, pageIndex, url); //获取当前页 if (rowCount % pageSize == 0) { pageNum = rowCount / pageSize; } else { pageNum = (rowCount / pageSize) + 1; } } }