public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/json"; string _action = MyCommFun.QueryString("myact"); string openid = MyCommFun.RequestOpenid(); //得到微信用户的openid if (_action == "jingcai") { try { #region 提交竞猜信息 int bisaiId = MyCommFun.RequestInt("bisaiId");//比赛表id int jcRetType = MyCommFun.RequestInt("jcRetType");//选择类型 int wid = MyCommFun.RequestInt("wid"); if (wid == 0 || bisaiId == 0 || jcRetType == 0) { context.Response.Write("{\"msg\":\"提交出现异常!!\",\"success\":\"0\"}"); return; } BLL.wx_sjb_users uBll = new BLL.wx_sjb_users(); Model.wx_sjb_users user = new Model.wx_sjb_users(); int uid = 0; if (!uBll.ExistsByOpenid(openid, wid)) { //不存在 user.openid = openid; user.wid = wid; user.succTimes = 0; user.failTimes = 0; uid = uBll.Add(user); } else { //存在 user = uBll.GetModelList("openid='" + openid + "'")[0]; uid = user.id; } BLL.wx_sjb_jcDetail dBll = new BLL.wx_sjb_jcDetail(); Model.wx_sjb_jcDetail detail = new Model.wx_sjb_jcDetail(); detail.uid = uid; detail.bsId = bisaiId; detail.jcRetType = jcRetType; detail.createDate = DateTime.Now; dBll.Add(detail); context.Response.Write("{\"msg\":\"提交成功!\",\"success\":\"1\"}"); return; #endregion } catch { context.Response.Write("{\"msg\":\"提交出现异常!!\",\"success\":\"0\"}"); return; } } }
protected void save_qiudui_Click(object sender, EventArgs e) { //结果 if (this.resultType.SelectedValue == null || this.resultType.SelectedValue.Trim().Length <= 0) { JscriptMsg("必须选择一个结果!", "back", "Error"); return; } int resultType = Convert.ToInt32( this.resultType.SelectedValue); bisai = bisaibll.GetModel(bisaiid); if (bisai.resultType != null && bisai.resultType.ToString().Length > 0) { return; } bisaibll.Updatejg(bisaiid, resultType); //修改wx_sjb_jcDetail BLL.wx_sjb_jcDetail yonghu = new BLL.wx_sjb_jcDetail(); yonghu.UpdateDetail(richengid, bisaiid, resultType); //修改wx_sjb_users BLL.wx_sjb_users uerbll = new BLL.wx_sjb_users(); uerbll.UpdateField(bisaiid,resultType);//成功个数 uerbll.UpdateField1(bisaiid, resultType);//成功个数 //修改wx_sjb_qiudui bisai = bisaibll.GetModel(bisaiid); //修改球队的基本表 BLL.wx_sjb_qiudui qdBll = new BLL.wx_sjb_qiudui(); if (resultType == 1) { //修改球队1的胜利次数 qdBll.UpdateField(bisai.qd1Id.Value, " succTimes =isnull(succTimes,0)+1"); } else if (resultType == 2) { qdBll.UpdateField(bisai.qd2Id.Value, " succTimes =isnull(succTimes,0)+1"); } else if (resultType == 3) { qdBll.UpdateField(bisai.qd1Id.Value, " succTimes =isnull(succTimes,0)+1"); qdBll.UpdateField(bisai.qd2Id.Value, " succTimes =isnull(succTimes,0)+1"); } AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改球队设置,主键为" + bisaiid); //记录日志 JscriptMsg("修改成功!", "bisai_list.aspx?id=" + richengid, "Success"); }
protected void save_qiudui_Click(object sender, EventArgs e) { //结果 if (this.resultType.SelectedValue == null || this.resultType.SelectedValue.Trim().Length <= 0) { JscriptMsg("必须选择一个结果!", "back", "Error"); return; } int resultType = Convert.ToInt32(this.resultType.SelectedValue); bisai = bisaibll.GetModel(bisaiid); if (bisai.resultType != null && bisai.resultType.ToString().Length > 0) { return; } bisaibll.Updatejg(bisaiid, resultType); //修改wx_sjb_jcDetail BLL.wx_sjb_jcDetail yonghu = new BLL.wx_sjb_jcDetail(); yonghu.UpdateDetail(richengid, bisaiid, resultType); //修改wx_sjb_users BLL.wx_sjb_users uerbll = new BLL.wx_sjb_users(); uerbll.UpdateField(bisaiid, resultType); //成功个数 uerbll.UpdateField1(bisaiid, resultType); //成功个数 //修改wx_sjb_qiudui bisai = bisaibll.GetModel(bisaiid); //修改球队的基本表 BLL.wx_sjb_qiudui qdBll = new BLL.wx_sjb_qiudui(); if (resultType == 1) { //修改球队1的胜利次数 qdBll.UpdateField(bisai.qd1Id.Value, " succTimes =isnull(succTimes,0)+1"); } else if (resultType == 2) { qdBll.UpdateField(bisai.qd2Id.Value, " succTimes =isnull(succTimes,0)+1"); } else if (resultType == 3) { qdBll.UpdateField(bisai.qd1Id.Value, " succTimes =isnull(succTimes,0)+1"); qdBll.UpdateField(bisai.qd2Id.Value, " succTimes =isnull(succTimes,0)+1"); } AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "修改球队设置,主键为" + bisaiid); //记录日志 JscriptMsg("修改成功!", "bisai_list.aspx?id=" + richengid, "Success"); }
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]; litRightTimes.Text = user.succTimes.ToString(); litErrTimes.Text = user.failTimes.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]; litRightTimes.Text = user.succTimes.ToString(); litErrTimes.Text = user.failTimes.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 + ")"); 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(); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/json"; string _action = MyCommFun.QueryString("myact"); string openid = MyCommFun.RequestOpenid(); //得到微信用户的openid if (_action == "jingcai") { try { #region 提交竞猜信息 int bisaiId = MyCommFun.RequestInt("bisaiId"); //比赛表id int jcRetType = MyCommFun.RequestInt("jcRetType"); //选择类型 int wid = MyCommFun.RequestInt("wid"); if (wid == 0 || bisaiId == 0 || jcRetType == 0) { context.Response.Write("{\"msg\":\"提交出现异常!!\",\"success\":\"0\"}"); return; } BLL.wx_sjb_users uBll = new BLL.wx_sjb_users(); Model.wx_sjb_users user = new Model.wx_sjb_users(); int uid = 0; if (!uBll.ExistsByOpenid(openid, wid)) { //不存在 user.openid = openid; user.wid = wid; user.succTimes = 0; user.failTimes = 0; uid = uBll.Add(user); } else { //存在 user = uBll.GetModelList("openid='" + openid + "'")[0]; uid = user.id; } BLL.wx_sjb_jcDetail dBll = new BLL.wx_sjb_jcDetail(); Model.wx_sjb_jcDetail detail = new Model.wx_sjb_jcDetail(); detail.uid = uid; detail.bsId = bisaiId; detail.jcRetType = jcRetType; detail.createDate = DateTime.Now; dBll.Add(detail); context.Response.Write("{\"msg\":\"提交成功!\",\"success\":\"1\"}"); return; #endregion } catch { context.Response.Write("{\"msg\":\"提交出现异常!!\",\"success\":\"0\"}"); return; } } }