Beispiel #1
0
        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;
                }
            }
        }
Beispiel #2
0
 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();
     }
 }
Beispiel #3
0
        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();
            }
        }
Beispiel #4
0
        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();
        }
Beispiel #5
0
        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();
        }
Beispiel #6
0
        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;
                }
            }
        }