private void RptBind(string _strWhere, string _orderby) { Model.wx_userweixin weixin = GetWeiXinCode(); //判断是否已经设置了微留言基本信息 BLL.wx_sjb_bisai sbll = new BLL.wx_sjb_bisai(); BLL.wx_sjb_qiudui qdBll = new BLL.wx_sjb_qiudui(); string qdName = ""; _strWhere = "rcId=" + richengid + " " + _strWhere; this.page = MXRequest.GetQueryInt("page", 1); txtKeywords.Text = this.keywords; DataSet ds = gbll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); // DataSet ds = gbll.GetList( _strWhere); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { DataRow dr; DateTime begin = new DateTime(); DateTime end = new DateTime(); int count = ds.Tables[0].Rows.Count; for (int i = 0; i < count; i++) { dr = ds.Tables[0].Rows[i]; dr["qd1Name"] = qdBll.GetQuiDuiName(MyCommFun.Obj2Int(dr["qd1Id"])); dr["qd2Name"] = qdBll.GetQuiDuiName(MyCommFun.Obj2Int(dr["qd2Id"])); begin = MyCommFun.Obj2DateTime(dr["beginDate"]); end = MyCommFun.Obj2DateTime(dr["endDate"]); if (begin > DateTime.Now) { dr["status_s"] = "<span class=\"act_before\">未开始</span>"; } else if (end <= DateTime.Now) { dr["status_s"] = "<span class=\"act_end\">已结束</span>"; } else { dr["status_s"] = "<span class=\"act_in\">进行中</span>"; } } ds.AcceptChanges(); } this.rptList.DataSource = ds; this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("bisai_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private void RptBind(string _strWhere, string _orderby) { Model.wx_userweixin weixin = GetWeiXinCode(); //判断是否已经设置了微留言基本信息 BLL.wx_sjb_bisai sbll = new BLL.wx_sjb_bisai(); BLL.wx_sjb_qiudui qdBll = new BLL.wx_sjb_qiudui(); string qdName = ""; _strWhere = "rcId=" + richengid + " " + _strWhere; this.page = MXRequest.GetQueryInt("page", 1); txtKeywords.Text = this.keywords; DataSet ds = gbll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); // DataSet ds = gbll.GetList( _strWhere); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { DataRow dr; DateTime begin = new DateTime(); DateTime end = new DateTime(); int count = ds.Tables[0].Rows.Count; for (int i = 0; i < count; i++) { dr = ds.Tables[0].Rows[i]; dr["qd1Name"] = qdBll.GetQuiDuiName(MyCommFun.Obj2Int(dr["qd1Id"])); dr["qd2Name"] = qdBll.GetQuiDuiName(MyCommFun.Obj2Int(dr["qd2Id"])); begin = MyCommFun.Obj2DateTime(dr["beginDate"]); end = MyCommFun.Obj2DateTime(dr["endDate"]); if (begin > DateTime.Now) { dr["status_s"] = "<span class=\"act_before\">未开始</span>"; } else if (end <= DateTime.Now) { dr["status_s"] = "<span class=\"act_end\">已结束</span>"; } else { dr["status_s"] = "<span class=\"act_in\">进行中</span>"; } } ds.AcceptChanges(); } this.rptList.DataSource = ds; this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("bisai_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
public void BindData() { //用户的基本信息 BLL.wx_sjb_users uBll = new BLL.wx_sjb_users(); Model.wx_sjb_users user = new Model.wx_sjb_users(); int uid = 0; int jcRetType = 0; if (!uBll.ExistsByOpenid(openid, wid)) { //不存在 } else { //存在 user = uBll.GetModelList("openid='" + openid + "'")[0]; uid = user.id; } BLL.wx_sjb_jcDetail dBll = new BLL.wx_sjb_jcDetail(); BLL.wx_sjb_bisai bsBll = new BLL.wx_sjb_bisai(); DateTime now = DateTime.Now; IList <Model.wx_sjb_bisai> bslist = bsBll.GetModelList("jcBeginDate<='" + now.ToString() + "' and jcEndDate>'" + now.ToString() + "' and rcId in (select id from wx_sjb_richeng where wid=" + wid + ")"); if (bslist == null || bslist.Count() <= 0) { return; } BLL.wx_sjb_qiudui qdBll = new BLL.wx_sjb_qiudui(); Model.wx_sjb_qiudui qiudui = new Model.wx_sjb_qiudui(); Model.wx_sjb_qiudui qiudui2 = new Model.wx_sjb_qiudui(); Model.wx_sjb_bisai bisai = new Model.wx_sjb_bisai(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < bslist.Count; i++) { bisai = bslist[i]; if (uid > 0) { jcRetType = dBll.GetjcRetType(bisai.id, uid); } qiudui = qdBll.GetModel(bisai.qd1Id.Value); qiudui2 = qdBll.GetModel(bisai.qd2Id.Value); sb.Append(" <div class=\"jc_content\">"); //展示 sb.Append(" <div class=\"jc_main\">"); sb.Append(" <div class=\"jc_qiudui\">"); sb.Append(" <img src=\"" + qiudui.qdPic + "\" />"); sb.Append(" <div class=\"jc_wenzi\">" + qiudui.qdName + "</div>"); sb.Append(" </div>"); sb.Append(" <div class=\"jc_vs\"> VS </div>"); sb.Append(" <div class=\"jc_qiudui\">"); sb.Append(" <img src=\"" + qiudui2.qdPic + "\" />"); sb.Append(" <div class=\"jc_wenzi\">" + qiudui2.qdName + "</div>"); sb.Append(" </div>"); sb.Append(" </div>");//jc_main //end:展示 sb.Append(" <div class=\"jc_clear\"></div>"); //form sb.Append("<div class=\"jc_form\">"); if (jcRetType == 1) { sb.Append(" <input id=\"radQd_" + bisai.id + "_1\" type=\"radio\" name=\"jingcai" + bisai.id + "\" value=\"1\" checked=\"checkde\" /><label for=\"radQd_" + bisai.id + "_1\">" + qiudui.qdName + "胜</label>"); } else { sb.Append(" <input id=\"radQd_" + bisai.id + "_1\" type=\"radio\" name=\"jingcai" + bisai.id + "\" value=\"1\" /><label for=\"radQd_" + bisai.id + "_1\">" + qiudui.qdName + "胜</label>"); } if (jcRetType == 3) { sb.Append(" <input id=\"radQd_" + bisai.id + "_3\" type=\"radio\" name=\"jingcai" + bisai.id + "\" value=\"3\" checked=\"checkde\" /><label for=\"radQd_" + bisai.id + "_3\">平局</label>"); } else { sb.Append(" <input id=\"radQd_" + bisai.id + "_3\" type=\"radio\" name=\"jingcai" + bisai.id + "\" value=\"3\" /><label for=\"radQd_" + bisai.id + "_3\">平局</label>"); } if (jcRetType == 2) { sb.Append(" <input id=\"radQd_" + bisai.id + "_2\" type=\"radio\" name=\"jingcai" + bisai.id + "\" value=\"2\" checked=\"checkde\" /><label for=\"radQd_" + bisai.id + "_2\">" + qiudui2.qdName + "胜</label>"); } else { sb.Append(" <input id=\"radQd_" + bisai.id + "_2\" type=\"radio\" name=\"jingcai" + bisai.id + "\" value=\"2\" /><label for=\"radQd_" + bisai.id + "_2\">" + qiudui2.qdName + "胜</label>"); } if (jcRetType <= 0) { sb.Append(" <input id=\"btnJS1\" class=\"btnJs\" type=\"button\" value=\"提交\" group=\"jingcai" + bisai.id + "\" bisaiid=\"" + bisai.id + "\" />"); } sb.Append("</div>"); //end:form sb.Append(" </div>"); }//end:for litJcStr.Text = sb.ToString(); }
public void BindData() { //用户的基本信息 BLL.wx_sjb_users uBll = new BLL.wx_sjb_users(); Model.wx_sjb_users user = new Model.wx_sjb_users(); int uid = 0; int jcRetType = 0; if (!uBll.ExistsByOpenid(openid, wid)) { //不存在 } else { //存在 user = uBll.GetModelList("openid='" + openid + "'")[0]; uid = user.id; } BLL.wx_sjb_jcDetail dBll = new BLL.wx_sjb_jcDetail(); BLL.wx_sjb_bisai bsBll = new BLL.wx_sjb_bisai(); DateTime now = DateTime.Now; IList<Model.wx_sjb_bisai> bslist = bsBll.GetModelList("jcBeginDate<='" + now.ToString() + "' and jcEndDate>'" + now.ToString() + "' and rcId in (select id from wx_sjb_richeng where wid=" + wid + ") order by beginDate asc"); if (bslist == null || bslist.Count() <= 0) { return; } BLL.wx_sjb_qiudui qdBll = new BLL.wx_sjb_qiudui(); Model.wx_sjb_qiudui qiudui = new Model.wx_sjb_qiudui(); Model.wx_sjb_qiudui qiudui2 = new Model.wx_sjb_qiudui(); Model.wx_sjb_bisai bisai = new Model.wx_sjb_bisai(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < bslist.Count; i++) { bisai = bslist[i]; if (uid > 0) { jcRetType = dBll.GetjcRetType(bisai.id, uid); } qiudui = qdBll.GetModel(bisai.qd1Id.Value); qiudui2 = qdBll.GetModel(bisai.qd2Id.Value); sb.Append(" <div class=\"jc_content\">"); //展示 sb.Append(" <div class=\"jc_main\">"); ; sb.Append(" <div class=\"jc_qiudui\">"); sb.Append(" <img src=\"" + qiudui.qdPic+ "\" />"); sb.Append(" <div class=\"jc_wenzi\">" + qiudui.qdName+ "</div>"); sb.Append(" </div>"); sb.Append(" <div class=\"jc_vs\"> VS </div>"); sb.Append(" <div class=\"jc_qiudui\">"); sb.Append(" <img src=\""+qiudui2.qdPic+"\" />"); sb.Append(" <div class=\"jc_wenzi\">"+qiudui2.qdName+"</div>"); sb.Append(" </div>"); sb.Append(" </div>");//jc_main //end:展示 sb.Append(" <div class=\"jc_clear\"></div>"); //form sb.Append("<div class=\"jc_form\">"); sb.Append("<div>"); if (jcRetType == 1) { sb.Append(" <input id=\"radQd_" + bisai.id + "_1\" type=\"radio\" name=\"jingcai" + bisai.id + "\" value=\"1\" checked=\"checkde\" /><label for=\"radQd_" + bisai.id + "_1\">" + qiudui.qdName + "胜</label>"); } else { sb.Append(" <input id=\"radQd_" + bisai.id + "_1\" type=\"radio\" name=\"jingcai" + bisai.id + "\" value=\"1\" /><label for=\"radQd_" + bisai.id + "_1\">" + qiudui.qdName + "胜</label>"); } sb.Append("</div>"); sb.Append("<div>"); if (jcRetType == 3) { sb.Append(" <input id=\"radQd_" + bisai.id + "_3\" type=\"radio\" name=\"jingcai" + bisai.id + "\" value=\"3\" checked=\"checkde\" /><label for=\"radQd_" + bisai.id + "_3\">平局</label>"); } else { sb.Append(" <input id=\"radQd_" + bisai.id + "_3\" type=\"radio\" name=\"jingcai" + bisai.id + "\" value=\"3\" /><label for=\"radQd_" + bisai.id + "_3\">平局</label>"); } sb.Append("</div>"); sb.Append("<div>"); if (jcRetType == 2) { sb.Append(" <input id=\"radQd_" + bisai.id + "_2\" type=\"radio\" name=\"jingcai" + bisai.id + "\" value=\"2\" checked=\"checkde\" /><label for=\"radQd_" + bisai.id + "_2\">" + qiudui2.qdName + "胜</label>"); } else { sb.Append(" <input id=\"radQd_" + bisai.id + "_2\" type=\"radio\" name=\"jingcai" + bisai.id + "\" value=\"2\" /><label for=\"radQd_" + bisai.id + "_2\">" + qiudui2.qdName + "胜</label>"); } sb.Append("</div>"); sb.Append("<div class='divbtn'>"); if (jcRetType <= 0) { sb.Append(" <input id=\"btnJS1\" class=\"btnJs\" type=\"button\" value=\"提交\" group=\"jingcai" + bisai.id + "\" bisaiid=\"" + bisai.id + "\" />"); } sb.Append("</div>"); sb.Append("</div>"); //end:form sb.Append(" </div>"); }//end:for litJcStr.Text = sb.ToString(); }