Ejemplo n.º 1
0
    private void AnalysisPage(int gid)
    {
        #region 赛事分析 点击 析 字的操作 有抓取
        //获得实体
        TPR2.BLL.guess.BaList   bll   = new TPR2.BLL.guess.BaList();
        TPR2.Model.guess.BaList model = bll.GetModel(gid);
        Master.Title = "赛事分析";
        builder.Append(Out.Tab("<div class=\"title\">即时赛事分析</div>", ""));
        builder.Append(Out.Tab("<div>", ""));
        string strAnal = string.Empty;
        //类型为1 是足球
        if (model.p_type == 1)
        {
            //获取分析数据 进入8bo抓取【足球】数据
            strAnal = new TPR2.Collec.Analysis().GetAnalysisFoot(0, Convert.ToInt32(model.p_id), gid);
            if (strAnal == "暂无数据。")
            {
                strAnal = new TPR2.Collec.Analysis().GetAnalysisFoot(1, Convert.ToInt32(model.p_id), gid);
            }
        }
        else
        {
            //获取分析数据 进入8bo抓取【篮球】数据
            strAnal = new TPR2.Collec.Analysis().GetAnalysisBasket(0, Convert.ToInt32(model.p_id), gid);

            if (strAnal == "暂无数据。")
            {
                strAnal = new TPR2.Collec.Analysis().GetAnalysisBasket(1, Convert.ToInt32(model.p_id), gid);
            }
        }
        if (strAnal != "")
        {
            builder.Append("" + strAnal + "");
        }
        else
        {
            builder.Append("暂无记录..");
        }
        builder.Append(Out.Tab("</div>", Out.Hr()));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append(Out.waplink(Utils.getPage("showGuess.aspx?gid=" + gid + ""), "返回上级") + "");
        builder.Append(Out.Tab("</div>", ""));
        #endregion
    }
Ejemplo n.º 2
0
    public void GetFootbz()
    {
        int recordCount = 0;
        IList <TPR2.Model.guess.BaList> listFootbz = new TPR2.Collec.Foot().GetFootbz(out recordCount);

        if (listFootbz != null)
        {
            if (listFootbz.Count > 0)
            {
                foreach (TPR2.Model.guess.BaList n in listFootbz)
                {
                    //builder.AppendFormat("赛事ID:{0}<br />", n.p_id);
                    //builder.AppendFormat("赛事时间:{0}<br />", n.p_TPRtime);
                    //builder.AppendFormat("标准主胜:{0}<br />", n.p_bzs_lu);
                    //builder.AppendFormat("标准平手:{0}<br />", n.p_bzp_lu);
                    //builder.AppendFormat("标准客胜:{0}<br />", n.p_bzx_lu);
                    //builder.Append("<br />----------<br />");
                    //写入数据
                    if (Convert.ToDateTime(n.p_TPRtime) <= DateTime.Now.AddHours(Convert.ToDouble(ub.GetSub("SiteJcTime", xmlPath))))
                    {
                        if (n.p_bzs_lu != 0)
                        {
                            TPR2.Model.guess.BaList model = new TPR2.Model.guess.BaList();
                            model.p_id     = n.p_id;
                            model.p_bzs_lu = n.p_bzs_lu;
                            model.p_bzp_lu = n.p_bzp_lu;
                            model.p_bzx_lu = n.p_bzx_lu;

                            TPR2.BLL.guess.BaList bll = new TPR2.BLL.guess.BaList();
                            if (bll.ExistsByp_id(Convert.ToInt32(n.p_id)) && !bll.ExistsBZ(Convert.ToInt32(n.p_id)))
                            {
                                bll.FootbzUpdate(model);
                            }
                        }
                    }
                }
                binddata();
            }
        }
    }
Ejemplo n.º 3
0
    public void GetFootdx()
    {
        int recordCount = 0;
        IList <TPR2.Model.guess.BaList> listFootdx = new TPR2.Collec.Foot().GetFootdx(out recordCount);

        if (listFootdx != null)
        {
            if (listFootdx.Count > 0)
            {
                foreach (TPR2.Model.guess.BaList n in listFootdx)
                {
                    //builder.AppendFormat("赛事ID:{0}<br />", n.p_id);
                    //builder.AppendFormat("赛事时间:{0}<br />", n.p_TPRtime);
                    //builder.AppendFormat("大小球盘口:{0}<br />", n.p_dx_pk);
                    //builder.AppendFormat("大球赔率:{0}<br />", n.p_big_lu);
                    //builder.AppendFormat("小球赔率:{0}<br />", n.p_small_lu);
                    //builder.Append("<br />----------<br />");
                    //写入数据
                    if (Convert.ToDateTime(n.p_TPRtime) <= DateTime.Now.AddHours(Convert.ToDouble(ub.GetSub("SiteJcTime", xmlPath))))
                    {
                        if (n.p_big_lu != 0)
                        {
                            TPR2.Model.guess.BaList model = new TPR2.Model.guess.BaList();
                            model.p_id       = n.p_id;
                            model.p_dx_pk    = GCK.getDxPkNum(Convert.ToString(n.p_dx_pk));
                            model.p_big_lu   = n.p_big_lu + 1;
                            model.p_small_lu = n.p_small_lu + 1;

                            TPR2.BLL.guess.BaList bll = new TPR2.BLL.guess.BaList();
                            if (bll.ExistsByp_id(Convert.ToInt32(n.p_id)) && !bll.ExistsDX(Convert.ToInt32(n.p_id)))
                            {
                                bll.FootdxUpdate(model);
                            }
                        }
                    }
                }
                binddata();
            }
        }
    }
Ejemplo n.º 4
0
    private void LoadPage(int gid, string bo, TPR2.Model.guess.BaList model)
    {
        #region 默认显示球赛内容

        //根据会员本身的ID取会员实体
        int meid = new BCW.User.Users().GetUsId();
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        long gold = new BCW.BLL.User().GetGold(meid);
        builder.Append("您现在有" + Utils.ConvertGold(gold) + "" + ub.Get("SiteBz") + "");
        builder.Append(Out.Tab("</div>", "<br />"));
        builder.Append(Out.Tab("<div>", ""));
        string OnceText = "@";
        if (model.p_ison == 1)
        {
            OnceText = "@" + ub.Get("SiteGqText") + "";
        }

        builder.Append("<a href=\"" + Utils.getUrl("default.aspx?showtype=1&amp;ptype=4&amp;fly=" + model.p_title + "") + "\">" + model.p_title + "</a> " + OnceText + " " + DT.FormatDate(Convert.ToDateTime(model.p_TPRtime), 1));
        //是否有波胆,显示波胆连接
        if (!string.IsNullOrEmpty(model.p_score))
        {
            builder.Append("" + Out.waplink(Utils.getUrl("showGuess.aspx?act=score&amp;gid=" + model.ID + ""), "[波胆]"));
        }

        //是否已完场
        if (model.p_result_one != null && model.p_result_two != null)
        {
            builder.Append("<br />完场比分:" + model.p_result_one + ":" + model.p_result_two + "");
        }
        else
        {
            if (model.p_TPRtime > DateTime.Now)
            {
                builder.Append("<br />比赛状态:未");
            }
            else
            {
                builder.Append("<br />比赛状态:" + Convertp_once(model.p_once) + "");
            }

            builder.Append(Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + ""), "[刷新]") + "");
            builder.Append("<br />即时比分:" + model.p_result_temp1 + ":" + model.p_result_temp2 + "");
        }
        //分析按钮
        builder.Append("" + Out.waplink(Utils.getUrl("showGuess.aspx?act=analysis&amp;gid=" + model.ID + ""), "[析]"));

        builder.Append(Out.Tab("</div>", "<br />"));

        #region 处理封盘状态
        int Min = 0;
        try
        {
            Min = Convert.ToInt32(model.p_once.ToString().Replace("'", "").Replace("+", ""));
        }
        catch
        {
        }
        if (model.p_type == 1)
        {
            if (Min > 41 && Min < 46 || Min > 87 || (model.p_once == "中" && model.p_basketve == 9))
            {
                model.p_isluck = 1;
            }
        }
        #endregion

        #region 红牌显示
        string hp_one = "";
        string hp_two = "";
        if (model.p_type == 1)
        {
            if (model.p_hp_one > 0)
            {
                hp_one = "<img src=\"/Files/sys/guess/redcard" + model.p_hp_one + ".gif\" alt=\"红" + model.p_hp_one + "\"/>";
            }

            if (model.p_hp_two > 0)
            {
                hp_two = "<img src=\"/Files/sys/guess/redcard" + model.p_hp_two + ".gif\" alt=\"红" + model.p_hp_two + "\"/>";
            }
        }
        #endregion

        #region 让球盘
        builder.Append(Out.Tab("<div>", ""));
        builder.Append("〓让球盘〓");
        if (model.p_basketve == 0)
        {
            builder.Append("" + Out.waplink(Utils.getUrl("showGuess.aspx?act=Oddhistory&amp;t=1&amp;gid=" + model.ID + ""), "[析]"));
        }
        else if (model.p_basketve == 9)
        {
            builder.Append("" + Out.waplink(Utils.getUrl("showGuess.aspx?act=Oddhistory&amp;t=4&amp;gid=" + model.ID + ""), "[析]"));
        }
        bool rqp = false;
        //主队
        if (((model.p_ison == 1 && model.p_isluckone == 1) || model.p_isluck == 1) && model.p_active == 0)
        {
            builder.Append("<b>(封)</b>");
            rqp = true;
        }
        else if (model.p_oncetime < DateTime.Now)
        {
            builder.Append("<b>(封)</b>");
            rqp = true;
        }
        else if (bo == "")
        {
            builder.Append("<b>(封)</b>");
            rqp = true;
        }
        if (rqp)
        {
            builder.Append("<br />" + model.p_one + "" + hp_one + "(" + Convert.ToDouble(model.p_one_lu) + ")");
        }
        else
        {
            builder.Append("<br />" + Out.waplink(Utils.getUrl("payGuess.aspx?gid=" + model.ID + "&amp;p=1"), model.p_one + "" + hp_one + "(" + Convert.ToDouble(model.p_one_lu) + ")"));
        }
        //=====================

        //让球
        if (model.p_type == 1)
        {
            builder.Append("<br />" + GCK.getZqPn(Convert.ToInt32(model.p_pn)) + "" + GCK.getPkName(Convert.ToInt32(model.p_pk)) + "");
        }
        else
        {
            builder.Append("<br />" + Convert.ToDouble(model.p_pk) + "");
        }
        //=====================

        //客队
        if (rqp)
        {
            builder.Append("<br />" + model.p_two + "" + hp_two + "(" + Convert.ToDouble(model.p_two_lu) + ")");
        }
        else
        {
            builder.Append("<br />" + Out.waplink(Utils.getUrl("payGuess.aspx?gid=" + model.ID + "&amp;p=2"), model.p_two + "" + hp_two + "(" + Convert.ToDouble(model.p_two_lu) + ")"));
        }
        //=====================
        #endregion

        #region 大小盘
        if (model.p_big_lu != 0 && model.p_big_lu != -1 && model.p_dx_pk != 0)
        {
            bool dxp = false;
            builder.Append("<br />〓大小盘〓");
            if (model.p_basketve == 0)
            {
                builder.Append("" + Out.waplink(Utils.getUrl("showGuess.aspx?act=Oddhistory&amp;t=2&amp;gid=" + model.ID + ""), "[析]"));
            }
            else if (model.p_basketve == 9)
            {
                builder.Append("" + Out.waplink(Utils.getUrl("showGuess.aspx?act=Oddhistory&amp;t=5&amp;gid=" + model.ID + ""), "[析]"));
            }
            if (((model.p_ison == 1 && model.p_islucktwo == 1) || model.p_isluck == 1) && model.p_active == 0)
            {
                builder.Append("<b>(封)</b>");
                dxp = true;
            }
            else if (model.p_oncetime < DateTime.Now)
            {
                builder.Append("<b>(封)</b>");
                dxp = true;
            }
            else if (bo == "")
            {
                builder.Append("<b>(封)</b>");
                dxp = true;
            }
            if (dxp)
            {
                builder.Append("<br />" + "大(" + Convert.ToDouble(model.p_big_lu) + ")");
            }
            else
            {
                builder.Append("<br />" + Out.waplink(Utils.getUrl("payGuess.aspx?gid=" + model.ID + "&amp;p=3"), "大(" + Convert.ToDouble(model.p_big_lu) + ")"));
            }

            if (model.p_type == 1)
            {
                builder.Append(GCK.getDxPkName(Convert.ToInt32(model.p_dx_pk)));
            }
            else
            {
                builder.Append(Convert.ToDouble(model.p_dx_pk));
            }
            if (dxp)
            {
                builder.Append("小(" + Convert.ToDouble(model.p_small_lu) + ")");
            }
            else
            {
                builder.Append(Out.waplink(Utils.getUrl("payGuess.aspx?gid=" + model.ID + "&amp;p=4"), "小(" + Convert.ToDouble(model.p_small_lu) + ")"));
            }
        }
        #endregion

        #region 标准盘
        if (ub.GetSub("SiteIsbz", "/Controls/guess2.xml") != "1")
        {
            if (model.p_bzs_lu != 0 && model.p_bzs_lu != -1)
            {
                bool bzp = false;

                builder.Append("<br />〓标准盘〓");
                if (model.p_basketve == 0)
                {
                    builder.Append("" + Out.waplink(Utils.getUrl("showGuess.aspx?act=Oddhistory&amp;t=3&amp;gid=" + model.ID + ""), "[析]"));
                }
                else if (model.p_basketve == 9)
                {
                    builder.Append("" + Out.waplink(Utils.getUrl("showGuess.aspx?act=Oddhistory&amp;t=6&amp;gid=" + model.ID + ""), "[析]"));
                }
                if (((model.p_ison == 1 && model.p_isluckthr == 1) || model.p_isluck == 1) && model.p_active == 0)
                {
                    builder.Append("<b>(封)</b>");
                    bzp = true;
                }
                else if (model.p_oncetime < DateTime.Now)
                {
                    builder.Append("<b>(封)</b>");
                    bzp = true;
                }
                else if (bo == "")
                {
                    builder.Append("<b>(封)</b>");
                    bzp = true;
                }
                if (bzp)
                {
                    builder.Append("<br />" + "主胜(" + Convert.ToDouble(model.p_bzs_lu) + ")");
                    builder.Append("<br />" + "平手(" + Convert.ToDouble(model.p_bzp_lu) + ")");
                    builder.Append("<br />" + "客胜(" + Convert.ToDouble(model.p_bzx_lu) + ")");
                }
                else
                {
                    builder.Append("<br />" + Out.waplink(Utils.getUrl("payGuess.aspx?gid=" + model.ID + "&amp;p=5"), "主胜(" + Convert.ToDouble(model.p_bzs_lu) + ")"));
                    builder.Append("<br />" + Out.waplink(Utils.getUrl("payGuess.aspx?gid=" + model.ID + "&amp;p=6"), "平手(" + Convert.ToDouble(model.p_bzp_lu) + ")"));
                    builder.Append("<br />" + Out.waplink(Utils.getUrl("payGuess.aspx?gid=" + model.ID + "&amp;p=7"), "客胜(" + Convert.ToDouble(model.p_bzx_lu) + ")"));
                }
            }
        }
        #endregion

        builder.Append(Out.Tab("</div>", Out.Hr()));

        string purl    = "[url=/bbs/guess2/showguess.aspx?gid=" + gid + "]" + model.p_title + ":" + model.p_one + "VS" + model.p_two + "[/url]";
        string strName = "purl,act,backurl";
        string strValu = "" + purl + "'recommend'" + Utils.PostPage(1) + "";
        string strOthe = "分享给好友,/bbs/guest.aspx,post,1,red";
        builder.Append(Out.wapform(strName, strValu, strOthe));

        //builder.Append("系统在" + second + "秒前更新了数据");

        if (model.p_ison == 1)
        {
            builder.Append(Out.Tab("<div>", Out.Hr()));
            //修改显示内容

            builder.Append("提示:比赛开始后仍可下注的称为" + ub.Get("SiteGqText") + " " + Out.waplink(Utils.getUrl("help.aspx"), "球彩规则") + "");
            if (model.p_type == 1)
            {
                builder.Append("<br />比赛状态时间仅供参考,与分析里的时间有可能不一致");
            }
            else
            {
                builder.Append("<br />比分仅供参考,即时比分与直播比分(或8波、比分网)有可能不一致");
            }
            builder.Append(Out.Tab("</div>", ""));
        }
        #endregion
    }
Ejemplo n.º 5
0
 /// <summary>
 /// 更新一条数据(单节使用)
 /// </summary>
 public void BasketUpdateOdds(TPR2.Model.guess.BaList model)
 {
     dal.BasketUpdateOdds(model);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 更新即时比分(滚球使用)
 /// </summary>
 public void FootOnceUpdate(TPR2.Model.guess.BaList model)
 {
     dal.FootOnceUpdate(model);
 }
Ejemplo n.º 7
0
    private void ReloadPage()
    {
        int    gid = Utils.ParseInt(Utils.GetRequest("gid", "get", 2, @"^[0-9]\d*$", "竞猜ID无效"));
        int    p   = Utils.ParseInt(Utils.GetRequest("p", "get", 2, @"^[1-7]*$|^100$", "选择无效"));
        string ok  = Utils.GetRequest("ok", "all", 1, "", "");

        TPR2.BLL.guess.BaList bll = new TPR2.BLL.guess.BaList();

        if (bll.GetModel(gid) == null)
        {
            Utils.Error("不存在的记录", "");
        }
        TPR2.Model.guess.BaList model = bll.GetModel(gid);

        #region 确认下注
        if (ok == "sure")
        {
            int id = Utils.ParseInt(Utils.GetRequest("id", "get", 1, @"^[0-9]\d*$", "ID无效"));
            TPR2.Model.guess.BaPay bpmodel = new TPR2.BLL.guess.BaPay().GetModelIsCase(id);
            if (bpmodel != null)
            {
                new TPR2.BLL.guess.BaPay().UpdateSure(id);
            }
        }
        #endregion

        Master.Title = model.p_one + "VS" + model.p_two;

        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append(model.p_one + "VS" + model.p_two);
        builder.Append(Out.Tab("</div>", "<br />"));
        builder.Append(Out.Tab("<div class=\"text\">", ""));
        if (p == 1)
        {
            builder.Append("让球盘:<b>上盘</b>下注列表");
        }
        else if (p == 2)
        {
            builder.Append("让球盘:<b>下盘</b>下注列表");
        }
        else if (p == 3)
        {
            builder.Append("大小盘:<b>大</b>下注列表");
        }
        else if (p == 4)
        {
            builder.Append("大小盘:<b>小</b>下注列表");
        }
        else if (p == 5)
        {
            builder.Append("标准盘:<b>主胜</b>下注列表");
        }
        else if (p == 6)
        {
            builder.Append("标准盘:<b>平手</b>下注列表");
        }
        else if (p == 7)
        {
            builder.Append("标准盘:<b>客胜</b>下注列表");
        }
        else if (p == 100)
        {
            builder.Append("波胆盘:下注列表");
        }

        builder.Append(Out.Tab("</div>", "<br />"));
        int      pageSize = 10;
        int      pageIndex;
        int      recordCount;
        string[] pageValUrl = { "gid", "p" };
        pageIndex = Utils.ParseInt(Request.QueryString["page"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }

        //组合条件
        string strWhere = "";
        if (p < 100)
        {
            strWhere += "itypes=0 and bcid=" + gid + " and PayType=" + p + "";
        }
        else
        {
            strWhere += "itypes=0 and bcid=" + gid + " and PayType>100";
        }

        // 开始读取竞猜
        IList <TPR2.Model.guess.BaPay> listBaPay = new TPR2.BLL.guess.BaPay().GetBaPays(pageIndex, pageSize, strWhere, out recordCount);
        if (listBaPay.Count > 0)
        {
            int k = 1;
            foreach (TPR2.Model.guess.BaPay n in listBaPay)
            {
                if (k % 2 == 0)
                {
                    builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
                }
                else
                {
                    if (k == 1)
                    {
                        builder.Append(Out.Tab("<div>", ""));
                    }
                    else
                    {
                        builder.Append(Out.Tab("<div>", "<br />"));
                    }
                }
                string bzType = string.Empty;
                if (n.Types == 0)
                {
                    bzType = ub.Get("SiteBz");
                }
                else
                {
                    bzType = ub.Get("SiteBz2");
                }


                builder.AppendFormat(Out.waplink(Utils.getUrl("../uinfo.aspx?uid={1}&amp;backurl=" + Utils.PostPage(1) + ""), "{0}({1})[" + n.ID + "]") + ":{2}[{3}]", n.payusname, n.payusid, Out.SysUBB(n.payview).Replace("/bbs/guess2/", ""), n.paytimes);
                builder.Append(Out.waplink(Utils.getUrl("plguess.aspx?act=back&amp;id=" + n.ID + "&amp;gid=" + gid + "&amp;backurl=" + Utils.PostPage(1) + ""), "[退]"));

                #region  注状态
                //确定下注
                if (n.state > 0)
                {
                    if (n.sure == 1)
                    {
                        builder.Append(Out.waplink(Utils.getUrl("plguess.aspx?ok=sure&amp;p=" + p + "&amp;id=" + n.ID + "&amp;gid=" + gid + "&amp;backurl=" + Utils.PostPage(1) + ""), "[确]"));
                    }
                    else
                    {
                        builder.Append("[待]");
                    }
                }
                if (n.state == 0)
                {
                    builder.Append("[成]");
                }
                #endregion

                builder.Append(Out.Tab("</div>", ""));
                k++;
            }

            // 分页
            builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0));
        }
        else
        {
            builder.Append(Out.Div("div", "没有相关记录.."));
        }

        builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append(Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + ""), "返回上一级"));
        builder.Append(Out.Tab("</div>", ""));
        builder.Append(Out.Tab("<div class=\"title\">", "<br />"));
        builder.Append("<a href=\"" + Utils.getUrl("../default.aspx") + "\">返回管理中心</a>");
        builder.Append(Out.Tab("</div>", "<br />"));
    }
Ejemplo n.º 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int    ManageId = new BCW.User.Manage().IsManageLogin();
        int    gid      = Utils.ParseInt(Utils.GetRequest("gid", "all", 2, @"^[0-9]*$", "竞猜ID无效"));
        string act      = Utils.GetRequest("act", "all", 1, "", "");
        ///抓取更新标记
        string jc = Utils.GetRequest("jc", "get", 1, "", "");
        ///开奖状态更新标记
        string dr = Utils.GetRequest("dr", "get", 1, "", "");

        TPR2.BLL.guess.BaList   bll = new TPR2.BLL.guess.BaList();
        TPR2.Model.guess.BaList st  = bll.GetModel(gid);
        if (st == null)
        {
            Utils.Error("不存在的记录", "");
        }

        #region 立即更新水位 访问8bo

        string bo = "";
        //-----------------------------立即更新水位---------------------------------
        if (st.p_active == 0)
        {
            //读取SiteViewStatus 等于0时采用即时刷新,其他值时,通过刷新机刷新
            //黄国军 20160223
            if (ub.GetSub("SiteUpdateOpen", "/Controls/guess2.xml") == "" || ub.GetSub("SiteUpdateOpen", "/Controls/guess2.xml") == "0")
            {
                #region 进入旧版更新
                if (st.p_basketve == 0)
                {
                    if (st.p_type == 1)
                    {
                        if (st.p_ison == 1)
                        {
                            bo = new TPR2.Collec.Footbo().GetBoView_kb_old(Convert.ToInt32(st.p_id), true);
                        }
                        else
                        {
                            bo = new TPR2.Collec.Footbo().GetBoView_kb_old(Convert.ToInt32(st.p_id), false);
                            //进行波胆更新
                            if (st.p_score != "")
                            {
                                bo = new TPR2.Collec.Footbd().FootbdPageHtml_kb_old(Convert.ToInt32(st.p_id));
                            }
                        }
                    }
                    else
                    {
                        if (st.p_ison == 1)
                        {
                            bo = new TPR2.Collec.Basketbo().GetBoView_kb_old(Convert.ToInt32(st.p_id), true);
                        }
                        else
                        {
                            bo = new TPR2.Collec.Basketbo().GetBoView_kb_old(Convert.ToInt32(st.p_id), false);
                        }
                    }
                }
                else if (st.p_basketve == 9)
                {
                    //载入页面更新足球上半场
                    if (st.p_type == 1)
                    {
                        string s = "";
                        if (st.p_ison == 1)
                        {
                            bo = new TPR2.Collec.Footbo().GetBoView_kb_old(Convert.ToInt32(st.p_id), true);
                            bo = new TPR2.Collec.FootFalf().FootFalfPageHtml_kb_old(Convert.ToInt32(st.p_id), true, ref s);
                        }
                        else
                        {
                            bo = new TPR2.Collec.FootFalf().FootFalfPageHtml_kb_old(Convert.ToInt32(st.p_id), false, ref s);
                        }
                    }
                }
                #endregion
            }
            else
            {
                #region 进入新版更新
                if (st.p_basketve == 0)
                {
                    if (st.p_type == 1)
                    {
                        if (st.p_ison == 1)
                        {
                            bo = new TPR2.Collec.Footbo().GetBoView1(Convert.ToInt32(st.p_id), true);
                        }
                        else
                        {
                            bo = new TPR2.Collec.Footbo().GetBoView1(Convert.ToInt32(st.p_id), false);
                            //进行波胆更新
                            if (st.p_score != "")
                            {
                                new TPR2.Collec.Footbd().FootbdPageHtml(Convert.ToInt32(st.p_id));
                            }
                        }
                    }
                    else
                    {
                        if (st.p_ison == 1)
                        {
                            bo = new TPR2.Collec.Basketbo().GetBoView1(Convert.ToInt32(st.p_id), true);
                        }
                        else
                        {
                            bo = new TPR2.Collec.Basketbo().GetBoView1(Convert.ToInt32(st.p_id), false);
                        }
                    }
                }
                else if (st.p_basketve == 9)
                {
                    //载入页面更新足球上半场
                    if (st.p_type == 1)
                    {
                        string s = "";
                        if (st.p_ison == 1)
                        {
                            bo = new TPR2.Collec.FootFalf().FootFalfPageHtml1(Convert.ToInt32(st.p_id), true, ref s);
                        }
                        else
                        {
                            bo = new TPR2.Collec.FootFalf().FootFalfPageHtml1(Convert.ToInt32(st.p_id), false, ref s);
                        }
                    }
                }

                #endregion
            }
            //篮球半场和单节
            if (st.p_basketve == 1 || st.p_basketve == 3)
            {
                bo = "1";
            }
        }
        #endregion

        //更新封盘不封盘

        if (act == "luck1")
        {
            new TPR2.BLL.guess.BaList().Updatep_isluck2(gid, 1, 1);
        }
        else if (act == "luck2")
        {
            new TPR2.BLL.guess.BaList().Updatep_isluck2(gid, 1, 2);
        }
        else if (act == "luck3")
        {
            new TPR2.BLL.guess.BaList().Updatep_isluck2(gid, 1, 3);
        }
        else if (act == "noluck1")
        {
            new TPR2.BLL.guess.BaList().Updatep_isluck2(gid, 0, 1);
        }
        else if (act == "noluck2")
        {
            new TPR2.BLL.guess.BaList().Updatep_isluck2(gid, 0, 2);
        }
        else if (act == "noluck3")
        {
            new TPR2.BLL.guess.BaList().Updatep_isluck2(gid, 0, 3);
        }


        TPR2.Model.guess.BaList model = bll.GetModel(gid);

        Master.Title = model.p_one + "VS" + model.p_two;

        #region 更新隐藏与显示
        //更新隐藏与显示
        if (act == "yes")
        {
            //游戏日志记录
            string[] p_pageArr = { "act", "gid" };
            BCW.User.GameLog.GameLogGetPage(1, Utils.getPageUrl(), p_pageArr, "后台管理员" + ManageId + "号将赛事" + model.p_one + "VS" + model.p_two + "(" + gid + ")开放显示", gid);
            model.p_del = 0;
            new TPR2.BLL.guess.BaList().Updatep_del(model);
        }
        else if (act == "no")
        {
            //游戏日志记录
            string[] p_pageArr = { "act", "gid" };
            BCW.User.GameLog.GameLogGetPage(1, Utils.getPageUrl(), p_pageArr, "后台管理员" + ManageId + "号将赛事" + model.p_one + "VS" + model.p_two + "(" + gid + ")隐藏显示", gid);
            model.p_del = 1;
            new TPR2.BLL.guess.BaList().Updatep_del(model);
        }
        #endregion

        #region 更新抓取与不抓取
        //更新抓取与不抓取
        if (jc == "yes")
        {
            //游戏日志记录
            string[] p_pageArr = { "jc", "gid" };
            BCW.User.GameLog.GameLogGetPage(1, Utils.getPageUrl(), p_pageArr, "后台管理员" + ManageId + "号将赛事" + model.p_one + "VS" + model.p_two + "(" + gid + ")开启抓取", gid);
            model.p_jc = 0;
            new TPR2.BLL.guess.BaList().Updatep_jc(model);
        }
        else if (jc == "no")
        {
            //游戏日志记录
            string[] p_pageArr = { "jc", "gid" };
            BCW.User.GameLog.GameLogGetPage(1, Utils.getPageUrl(), p_pageArr, "后台管理员" + ManageId + "号将赛事" + model.p_one + "VS" + model.p_two + "(" + gid + ")关闭抓取", gid);
            model.p_jc = 1;
            new TPR2.BLL.guess.BaList().Updatep_jc(model);
        }
        #endregion

        #region 更新开奖方式:自动或人工
        //更新抓取与不抓取
        if (dr == "0")
        {
            //游戏日志记录
            string[] p_pageArr = { "dr", "gid" };
            BCW.User.GameLog.GameLogGetPage(1, Utils.getPageUrl(), p_pageArr, "后台管理员" + ManageId + "号将赛事" + model.p_one + "VS" + model.p_two + "(" + gid + ")设置为自动开奖", gid);
            model.p_dr = 0;
            new TPR2.BLL.guess.BaList().Updatep_dr(model);
        }
        else if (dr == "1")
        {
            //游戏日志记录
            string[] p_pageArr = { "dr", "gid" };
            BCW.User.GameLog.GameLogGetPage(1, Utils.getPageUrl(), p_pageArr, "后台管理员" + ManageId + "号将赛事" + model.p_one + "VS" + model.p_two + "(" + gid + ")设置为人工开奖", gid);
            model.p_dr = 1;
            new TPR2.BLL.guess.BaList().Updatep_dr(model);
        }
        #endregion

        #region  除赛事
        //删除赛事
        if (act == "del" || act == "delok1" || act == "delok2")
        {
            if (act == "del")
            {
                builder.Append(Out.Tab("<div class=\"title\">", ""));
                builder.Append("确定删除此赛事吗");
                builder.Append(Out.Tab("</div>", "<br />"));
                builder.Append(Out.Tab("<div>", ""));
                builder.Append(Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + "&amp;act=delok1"), "删除,不包含下注记录") + "<br />");
                builder.Append(Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + "&amp;act=delok2"), "删除,包含下注记录") + "<br />");
                builder.Append(Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + ""), "先留着吧.."));
                builder.Append(Out.Tab("</div>", "<br />"));
            }
            else
            {
                //游戏日志记录
                string[] p_pageArr = { "act", "gid" };
                BCW.User.GameLog.GameLogGetPage(1, Utils.getPageUrl(), p_pageArr, "后台管理员" + ManageId + "号删除赛事" + model.p_one + "VS" + model.p_two + "(" + gid + ")", gid);

                new TPR2.BLL.guess.BaList().Delete(gid);
                if (act == "delok2")
                {
                    TPR2.BLL.guess.BaPay bll2 = new TPR2.BLL.guess.BaPay();
                    new TPR2.BLL.guess.BaPay().Deletebcid(gid);
                }
                Utils.Success("删除赛事", "删除赛事成功..", Utils.getUrl("default.aspx"), "1");
            }
        }
        #endregion

        #region 转换成滚球模式
        //转换成" + ub.Get("SiteGqText") + "模式
        else if (act == "once" || act == "onceok")
        {
            if (act == "once")
            {
                string p_oncetime = string.Empty;
                if (string.IsNullOrEmpty(model.p_oncetime.ToString()))
                {
                    p_oncetime = DT.FormatDate(Convert.ToDateTime(model.p_TPRtime).AddMinutes(130), 0);
                }
                else
                {
                    p_oncetime = DT.FormatDate(Convert.ToDateTime(model.p_oncetime), 0);
                }

                builder.Append(Out.Tab("<div class=\"title\">", ""));
                builder.Append("确定要转换成" + ub.Get("SiteGqText") + "下注模式吗");
                builder.Append(Out.Tab("</div>", ""));
                string strText = "封盘时间,,";
                string strName = "oncetime,gid,act";
                string strType = "date,hidden,hidden";
                string strValu = "" + p_oncetime + "'" + gid + "'onceok";
                string strEmpt = "false,false,false";
                string strIdea = "/";
                string strOthe = "转换,showGuess.aspx,post,1,red";
                builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));

                builder.Append(Out.Tab("<div>", " "));
                builder.Append(Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + ""), "取消"));
                builder.Append(Out.Tab("</div>", "<br />"));
            }
            else
            {
                DateTime oncetime = Utils.ParseTime(Utils.GetRequest("oncetime", "all", 2, DT.RegexTime, "请正确填写封盘时间"));

                if (Convert.ToDateTime(model.p_TPRtime) > oncetime)
                {
                    Utils.Error("封盘时间应大于开赛时间", "");
                }
                //游戏日志记录
                string[] p_pageArr = { "oncetime", "act", "gid" };
                BCW.User.GameLog.GameLogGetPage(1, Utils.getPageUrl(), p_pageArr, "后台管理员" + ManageId + "号编辑赛事" + model.p_one + "VS" + model.p_two + "(" + gid + ")成为" + ub.Get("SiteGqText") + "", gid);

                new TPR2.BLL.guess.BaList().FootOnceType(gid, oncetime);
                Utils.Success("转换" + ub.Get("SiteGqText") + "", "转换成功..", Utils.getUrl("showguess.aspx?gid=" + gid + ""), "1");
            }
        }
        #endregion

        #region 赛事分析
        else if (act == "analysis")
        {
            Master.Title = "赛事分析";
            builder.Append(Out.Tab("<div class=\"title\">即时赛事分析</div>", ""));
            builder.Append(Out.Tab("<div>", ""));
            string strAnal = string.Empty;
            if (model.p_type == 1)
            {
                strAnal = new TPR2.Collec.Analysis().GetAnalysisFoot(0, Convert.ToInt32(model.p_id), gid);

                if (strAnal == "暂无数据。")
                {
                    strAnal = new TPR2.Collec.Analysis().GetAnalysisFoot(1, Convert.ToInt32(model.p_id), gid);
                }
            }
            else
            {
                strAnal = new TPR2.Collec.Analysis().GetAnalysisBasket(0, Convert.ToInt32(model.p_id), gid);

                if (strAnal == "暂无数据。")
                {
                    strAnal = new TPR2.Collec.Analysis().GetAnalysisBasket(1, Convert.ToInt32(model.p_id), gid);
                }
            }
            if (strAnal != "")
            {
                builder.Append("" + strAnal + "");
            }
            else
            {
                builder.Append("暂无记录..");
            }
            builder.Append(Out.Tab("</div>", Out.Hr()));
            builder.Append(Out.Tab("<div>", ""));
            builder.Append(Out.waplink(Utils.getPage("showGuess.aspx?gid=" + gid + ""), "返回上级") + "");
            builder.Append(Out.Tab("</div>", "<br />"));
        }
        #endregion

        #region 波胆设置
        else if (act == "score")
        {
            Master.Title = "波胆盘设置";

            builder.Append(Out.Tab("<div class=\"title\">", ""));
            builder.Append(model.p_title + ":" + model.p_one + "VS" + model.p_two);
            builder.Append(Out.Tab("</div>", "<br />"));
            builder.Append(Out.Tab("<div>", ""));
            builder.Append("〓波胆盘〓<br />");
            builder.Append("主胜↔客胜↔打和");
            builder.Append(Out.Tab("</div>", "<br />"));


            string strText = "1:0,0:1,0:0,/,2:0,0:2,1:1,/,3:0,0:3,2:2,/,4:0,0:4,3:3,/,2:1,1:2,4:4,/,3:1,1:3,/,4:1,1:4,/,3:2,2:3,/,4:2,2:4,/,4:3,3:4,/,主净胜5球或以上,/,客净胜5球或以上,/,其他胆,,,,,,";
            string strName = "score10,score01,score00,,score20,score02,score11,,score30,score03,score22,,score40,score04,score33,,score21,score12,score44,,score31,score13,,score41,score14,,score32,score23,,score42,score24,,score43,score34,,score5z,,score5k,,scoreot,gid,act";
            string strType = "small,small,small,hr,small,small,small,hr,small,small,small,hr,small,small,small,hr,small,small,small,hr,small,small,hr,small,small,hr,small,small,hr,small,small,hr,small,small,hr,small,hr,small,hr,small,hidden,hidden";

            string strValu = "";
            if (!string.IsNullOrEmpty(model.p_score))
            {
                string[] score = model.p_score.Split(',');
                string   other = "15";
                if (score.Length > 27)
                {
                    other = score[27].Split('|')[1];
                }
                strValu = "" + score[0].Split('|')[1] + "'" + score[1].Split('|')[1] + "'" + score[2].Split('|')[1] + "''" + score[3].Split('|')[1] + "'" + score[4].Split('|')[1] + "'" + score[5].Split('|')[1] + "''" + score[6].Split('|')[1] + "'" + score[7].Split('|')[1] + "'" + score[8].Split('|')[1] + "''" + score[9].Split('|')[1] + "'" + score[10].Split('|')[1] + "'" + score[11].Split('|')[1] + "''" + score[12].Split('|')[1] + "'" + score[13].Split('|')[1] + "'" + score[14].Split('|')[1] + "''" + score[15].Split('|')[1] + "'" + score[16].Split('|')[1] + "''" + score[17].Split('|')[1] + "'" + score[18].Split('|')[1] + "''" + score[19].Split('|')[1] + "'" + score[20].Split('|')[1] + "''" + score[21].Split('|')[1] + "'" + score[22].Split('|')[1] + "''" + score[23].Split('|')[1] + "'" + score[24].Split('|')[1] + "''" + score[25].Split('|')[1] + "''" + score[26].Split('|')[1] + "''" + other + "'" + gid + "'scoreok";
            }
            else
            {
                strValu = "''''''''''''''''''''''''''''''''''''''''" + gid + "'scoreok";
            }
            string strEmpt = "true,true,true,,true,true,true,,true,true,true,,true,true,true,,true,true,true,,true,true,,true,true,,true,true,,true,true,,true,true,,true,,true,true,true,true,true,true,false,false";
            string strIdea = "倍 '倍 '倍 ''倍 '倍 '倍 ''倍 '倍 '倍 ''倍 '倍 '倍 ''倍 '倍 '倍 ''倍 '倍 ''倍 '倍 ''倍 '倍 ''倍 '倍 ''倍 '倍 ''倍 ''倍 '''倍 ''倍 '倍 ''倍 ''倍 '''倍 ''倍 '倍 ''倍 ''倍 '''倍 ''倍 '倍 ''倍 ''倍 ''|/";
            string strOthe = "确定编辑,showGuess.aspx,post,3,red";
            builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
            builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
            builder.Append(Out.Tab("<div>", ""));
            builder.Append("温馨提示:当某项不开放投注或无赔率时,请填写-1<br />");
            builder.Append(Out.waplink(Utils.getUrl("showGuess.aspx?act=scoreok2&amp;gid=" + gid + ""), "[取消本场波胆]") + "<br />");
            builder.Append(Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + ""), "返回上级") + "");
            builder.Append(Out.Tab("</div>", "<br />"));
            builder.Append(Out.Tab("<div class=\"title\">", ""));
            builder.Append("<a href=\"" + Utils.getUrl("../default.aspx") + "\">返回管理中心</a>");
            builder.Append(Out.Tab("</div>", "<br />"));
        }
        #endregion

        #region 游戏日志记录
        else if (act == "scoreok")
        {
            //游戏日志记录
            string[] p_pageArr = { "act", "gid", "score10", "score01", "score00", "score20", "score02", "score11", "score30", "score03", "score22", "score40", "score04", "score33", "score21", "score12", "score44", "score31", "score13", "score41", "score14", "score32", "score23", "score42", "score24", "score43", "score34", "score5z", "score5k", "scoreot" };
            BCW.User.GameLog.GameLogPage(1, Utils.getPageUrl(), p_pageArr, "后台管理员" + ManageId + "号将赛事编辑波胆" + model.p_one + "VS" + model.p_two + "(" + gid + ")", gid);

            decimal score10 = Convert.ToDecimal(Utils.GetRequest("score10", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写1赔率,小数点后保留1-2位"));
            decimal score01 = Convert.ToDecimal(Utils.GetRequest("score01", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写2赔率,小数点后保留1-2位"));
            decimal score00 = Convert.ToDecimal(Utils.GetRequest("score00", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写3赔率,小数点后保留1-2位"));
            decimal score20 = Convert.ToDecimal(Utils.GetRequest("score20", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写4赔率,小数点后保留1-2位"));
            decimal score02 = Convert.ToDecimal(Utils.GetRequest("score02", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写5赔率,小数点后保留1-2位"));
            decimal score11 = Convert.ToDecimal(Utils.GetRequest("score11", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写6赔率,小数点后保留1-2位"));
            decimal score30 = Convert.ToDecimal(Utils.GetRequest("score30", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写7赔率,小数点后保留1-2位"));
            decimal score03 = Convert.ToDecimal(Utils.GetRequest("score03", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写8赔率,小数点后保留1-2位"));
            decimal score22 = Convert.ToDecimal(Utils.GetRequest("score22", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写9赔率,小数点后保留1-2位"));
            decimal score40 = Convert.ToDecimal(Utils.GetRequest("score40", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写10赔率,小数点后保留1-2位"));
            decimal score04 = Convert.ToDecimal(Utils.GetRequest("score04", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写11赔率,小数点后保留1-2位"));
            decimal score33 = Convert.ToDecimal(Utils.GetRequest("score33", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写12赔率,小数点后保留1-2位"));
            decimal score21 = Convert.ToDecimal(Utils.GetRequest("score21", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写13赔率,小数点后保留1-2位"));
            decimal score12 = Convert.ToDecimal(Utils.GetRequest("score12", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写14赔率,小数点后保留1-2位"));
            decimal score44 = Convert.ToDecimal(Utils.GetRequest("score44", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写15赔率,小数点后保留1-2位"));
            decimal score31 = Convert.ToDecimal(Utils.GetRequest("score31", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写16赔率,小数点后保留1-2位"));
            decimal score13 = Convert.ToDecimal(Utils.GetRequest("score13", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写17赔率,小数点后保留1-2位"));
            decimal score41 = Convert.ToDecimal(Utils.GetRequest("score41", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写18赔率,小数点后保留1-2位"));
            decimal score14 = Convert.ToDecimal(Utils.GetRequest("score14", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写19赔率,小数点后保留1-2位"));
            decimal score32 = Convert.ToDecimal(Utils.GetRequest("score32", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写20赔率,小数点后保留1-2位"));
            decimal score23 = Convert.ToDecimal(Utils.GetRequest("score23", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写21赔率,小数点后保留1-2位"));
            decimal score42 = Convert.ToDecimal(Utils.GetRequest("score42", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写22赔率,小数点后保留1-2位"));
            decimal score24 = Convert.ToDecimal(Utils.GetRequest("score24", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写23赔率,小数点后保留1-2位"));
            decimal score43 = Convert.ToDecimal(Utils.GetRequest("score43", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写24赔率,小数点后保留1-2位"));
            decimal score34 = Convert.ToDecimal(Utils.GetRequest("score34", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写25赔率,小数点后保留1-2位"));
            decimal score5z = Convert.ToDecimal(Utils.GetRequest("score5z", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写26赔率,小数点后保留1-2位"));
            decimal score5k = Convert.ToDecimal(Utils.GetRequest("score5k", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写27赔率,小数点后保留1-2位"));
            decimal scoreot = Convert.ToDecimal(Utils.GetRequest("scoreot", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写27赔率,小数点后保留1-2位"));

            string score = "";
            score += "1:0|" + score10 + ",0:1|" + score01 + ",0:0|" + score00 + ",2:0|" + score20 + ",0:2|" + score02 + ",1:1|" + score11 + ",3:0|" + score30 + ",0:3|" + score03 + ",2:2|" + score22 + "";
            score += ",4:0|" + score40 + ",0:4|" + score04 + ",3:3|" + score33 + ",2:1|" + score21 + ",1:2|" + score12 + ",4:4|" + score44 + "";
            score += ",3:1|" + score31 + ",1:3|" + score13 + ",4:1|" + score41 + ",1:4|" + score14 + ",3:2|" + score32 + ",2:3|" + score23 + ",4:2|" + score42 + ",2:4|" + score24 + ",4:3|" + score43 + ",3:4|" + score34 + ",5z|" + score5z + ",5k|" + score5k + ",ot|" + scoreot;

            new TPR2.BLL.guess.BaList().Updatep_score(gid, score);
            Utils.Success("波胆设置", "波胆设置成功..", Utils.getUrl("showguess.aspx?act=score&amp;gid=" + gid + ""), "1");
        }
        #endregion

        #region 清空波胆
        else if (act == "scoreok2")
        {
            //游戏日志记录
            string[] p_pageArr = { "act", "gid" };
            BCW.User.GameLog.GameLogGetPage(1, Utils.getPageUrl(), p_pageArr, "后台管理员" + ManageId + "号将赛事清空波胆" + model.p_one + "VS" + model.p_two + "(" + gid + ")", gid);

            new TPR2.BLL.guess.BaList().Updatep_score(gid, "");
            Utils.Success("清空波胆", "清空波胆成功..", Utils.getUrl("showguess.aspx?act=score&amp;gid=" + gid + ""), "1");
        }
        #endregion

        #region  注受限设置
        else if (act == "xz")
        {
            Master.Title = "下注受限设置";

            builder.Append(Out.Tab("<div class=\"title\">", ""));
            builder.Append("下注受限设置");
            builder.Append(Out.Tab("</div>", ""));
            string strText = "全场受限ID(全局设置|用#分隔):/,上盘受限ID(用#分隔):/,下盘受限ID(用#分隔):/,大盘受限(用#分隔):/,小盘受限(用#分隔):/,,";
            string strName = "ID0,ID1,ID2,ID3,ID4,gid,act";
            string strType = "text,text,text,text,text,hidden,hidden";
            string strValu = "" + model.xID0 + "'" + model.xID1 + "'" + model.xID2 + "'" + model.xID3 + "'" + model.xID4 + "'" + gid + "'xzok";
            string strEmpt = "true,true,true,true,true,false,false";
            string strIdea = "/";
            string strOthe = "确定编辑,showGuess.aspx,post,1,red";
            builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
            builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
            builder.Append(Out.Tab("<div>", ""));
            builder.Append(Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + ""), "返回上级") + "");
            builder.Append(Out.Tab("</div>", "<br />"));
            builder.Append(Out.Tab("<div class=\"title\">", ""));
            builder.Append("<a href=\"" + Utils.getUrl("../default.aspx") + "\">返回管理中心</a>");
            builder.Append(Out.Tab("</div>", "<br />"));
        }
        #endregion

        #region 设置受限ID
        else if (act == "xzok")
        {
            //游戏日志记录
            string[] p_pageArr = { "act", "gid", "ID0", "ID1", "ID2", "ID3", "ID4" };
            BCW.User.GameLog.GameLogPage(1, Utils.getPageUrl(), p_pageArr, "后台管理员" + ManageId + "号将赛事设置受限ID" + model.p_one + "VS" + model.p_two + "(" + gid + ")", gid);

            string ID0 = Utils.GetRequest("ID0", "post", 3, @"^[^\#]{1,50}(?:\#[^\#]{1,50}){0,500}$", "填写错误");
            string ID1 = Utils.GetRequest("ID1", "post", 3, @"^[^\#]{1,50}(?:\#[^\#]{1,50}){0,500}$", "填写错误");
            string ID2 = Utils.GetRequest("ID2", "post", 3, @"^[^\#]{1,50}(?:\#[^\#]{1,50}){0,500}$", "填写错误");
            string ID3 = Utils.GetRequest("ID3", "post", 3, @"^[^\#]{1,50}(?:\#[^\#]{1,50}){0,500}$", "填写错误");
            string ID4 = Utils.GetRequest("ID4", "post", 3, @"^[^\#]{1,50}(?:\#[^\#]{1,50}){0,500}$", "填写错误");

            new TPR2.BLL.guess.BaList().UpdatexID(gid, ID0, 0);
            new TPR2.BLL.guess.BaList().UpdatexID(gid, ID1, 1);
            new TPR2.BLL.guess.BaList().UpdatexID(gid, ID2, 2);
            new TPR2.BLL.guess.BaList().UpdatexID(gid, ID3, 3);
            new TPR2.BLL.guess.BaList().UpdatexID(gid, ID4, 4);

            Utils.Success("下注受限", "下注受限设置成功..", Utils.getUrl("showguess.aspx?act=xz&amp;gid=" + gid + ""), "1");
        }
        #endregion

        #region 全局封盘
        if (act == "luck")
        {
            //游戏日志记录
            string[] p_pageArr = { "act", "gid" };
            BCW.User.GameLog.GameLogGetPage(1, Utils.getPageUrl(), p_pageArr, "后台管理员" + ManageId + "号将赛事" + model.p_one + "VS" + model.p_two + "(" + gid + ")全局封盘", gid);

            new TPR2.BLL.guess.BaList().Updatep_isluck(gid, 1);
            Utils.Success("全局封盘", "全局封盘成功,所有会员将不能下注本场,需要手工解除封盘才可以..", Utils.getUrl("showguess.aspx?gid=" + gid + ""), "2");
        }
        #endregion

        #region 全局解封
        if (act == "noluck")
        {
            //游戏日志记录
            string[] p_pageArr = { "act", "gid" };
            BCW.User.GameLog.GameLogGetPage(1, Utils.getPageUrl(), p_pageArr, "后台管理员" + ManageId + "号将赛事" + model.p_one + "VS" + model.p_two + "(" + gid + ")全局解封", gid);

            new TPR2.BLL.guess.BaList().Updatep_isluck(gid, 0);
            Utils.Success("全局解封", "全局解封成功,所有会员可以下注了..", Utils.getUrl("showguess.aspx?gid=" + gid + ""), "2");
        }
        #endregion

        else
        {
            builder.Append(Out.Tab("<div class=\"title\">", ""));
            builder.Append(model.p_one + "VS" + model.p_two);
            builder.Append(Out.Tab("</div>", "<br />"));
            builder.Append(Out.Tab("<div>", ""));

            builder.Append(Out.waplink(Utils.getUrl("default.aspx?ptype=4&amp;fly=" + model.p_title + ""), model.p_title) + ":" + model.p_one + "VS" + model.p_two);

            #region 受限提示
            if (model.xID0 != "" || model.xID1 != "" || model.xID2 != "" || model.xID3 != "" || model.xID4 != "")
            {
                builder.Append("(有受限)");
            }
            #endregion

            #region 波胆
            builder.Append("<br />开赛:" + DT.FormatDate(Convert.ToDateTime(model.p_TPRtime), 0));
            if (model.p_type == 1)
            {
                builder.Append("" + Out.waplink(Utils.getUrl("showGuess.aspx?act=score&amp;gid=" + gid + ""), "[波胆]"));
                builder.AppendFormat("|" + Out.waplink(Utils.getUrl("plGuess.aspx?gid=" + model.ID + "&amp;p=100"), "{0}注") + "", new TPR2.BLL.guess.BaPay().GetCount(model.ID, Convert.ToInt32(model.p_type), 100));
            }

            #endregion

            #region 完场比分
            if (model.p_result_one != null && model.p_result_two != null)
            {
                builder.Append("<br />完场比分:" + model.p_result_one + ":" + model.p_result_two + "");
            }
            else
            {
                if (model.p_TPRtime > DateTime.Now)
                {
                    builder.Append("<br />比赛状态:未");
                }
                else
                {
                    builder.Append("<br />比赛状态:" + Convertp_once(model.p_once) + "");
                }

                builder.Append("<br />即时比分:" + model.p_result_temp1 + ":" + model.p_result_temp2 + "");
            }
            builder.Append("" + Out.waplink(Utils.getUrl("showGuess.aspx?act=analysis&amp;gid=" + gid + ""), "[析]"));

            builder.Append(Out.Tab("</div>", "<br />"));

            string hp_one = "";
            string hp_two = "";
            if (model.p_type == 1)
            {
                if (model.p_hp_one > 0)
                {
                    hp_one = "<img src=\"/Files/sys/guess/redcard" + model.p_hp_one + ".gif\" alt=\"红" + model.p_hp_one + "\"/>";
                }

                if (model.p_hp_two > 0)
                {
                    hp_two = "<img src=\"/Files/sys/guess/redcard" + model.p_hp_two + ".gif\" alt=\"红" + model.p_hp_two + "\"/>";
                }
            }
            #endregion

            #region 处理封盘状态
            int Min = 0;
            try
            {
                Min = Convert.ToInt32(model.p_once.ToString().Replace("'", "").Replace("+", ""));
            }
            catch
            {
            }
            if (model.p_type == 1)
            {
                if (Min > 41 && Min < 46 || Min > 87 || (model.p_once == "中" && model.p_basketve == 9))
                {
                    model.p_isluck = 1;
                }
            }
            #endregion

            #region 让球盘
            builder.Append(Out.Tab("<div class=\"text\">", ""));
            builder.Append("〓让球盘〓");

            if (model.p_ison == 1)
            {
                if (model.p_isluckone == 0)
                {
                    builder.Append("" + Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + "&amp;act=luck1"), "封"));
                }
                else
                {
                    builder.Append("" + Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + "&amp;act=noluck1"), "解封"));
                }
            }
            if (((model.p_ison == 1 && model.p_isluckone == 1) || model.p_isluck == 1) && model.p_active == 0)
            {
                builder.Append("<b>(封)</b>");
            }
            else if (bo == "")
            {
                builder.Append("<b>(停)</b>");
            }

            builder.AppendFormat("<br />{0}" + Out.waplink(Utils.getUrl("plGuess.aspx?gid=" + model.ID + "&amp;p=1"), "{1}注"), model.p_one + "" + hp_one + "(" + Convert.ToDouble(model.p_one_lu) + ")", new TPR2.BLL.guess.BaPay().GetCount(model.ID, Convert.ToInt32(model.p_type), 1));

            if (model.p_type == 1)
            {
                builder.Append("<br />" + GCK.getZqPn(Convert.ToInt32(model.p_pn)) + "" + GCK.getPkName(Convert.ToInt32(model.p_pk)) + "");
            }
            else
            {
                builder.Append("<br />" + Convert.ToDouble(model.p_pk) + "");
            }

            builder.AppendFormat("<br />{0}" + Out.waplink(Utils.getUrl("plGuess.aspx?gid=" + model.ID + "&amp;p=2"), "{1}注"), model.p_two + "" + hp_two + "(" + Convert.ToDouble(model.p_two_lu) + ")", new TPR2.BLL.guess.BaPay().GetCount(model.ID, Convert.ToInt32(model.p_type), 2));
            #endregion

            #region 大小盘
            if (model.p_big_lu != 0)
            {
                builder.Append("<br />〓大小盘〓");
                if (model.p_ison == 1)
                {
                    if (model.p_islucktwo == 0)
                    {
                        builder.Append("" + Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + "&amp;act=luck2"), "封"));
                    }
                    else
                    {
                        builder.Append("" + Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + "&amp;act=noluck2"), "解封"));
                    }
                }

                if (((model.p_ison == 1 && model.p_islucktwo == 1) || model.p_isluck == 1) && model.p_active == 0)
                {
                    builder.Append("<b>(封)</b>");
                }
                else if (bo == "")
                {
                    builder.Append("<b>(停)</b>");
                }

                builder.AppendFormat("<br />" + Out.waplink(Utils.getUrl("plGuess.aspx?gid=" + model.ID + "&amp;p=3"), "{0}注") + "{1}", new TPR2.BLL.guess.BaPay().GetCount(model.ID, Convert.ToInt32(model.p_type), 3), "大(" + Convert.ToDouble(model.p_big_lu) + ")");

                if (model.p_type == 1)
                {
                    builder.Append(GCK.getDxPkName(Convert.ToInt32(model.p_dx_pk)));
                }
                else
                {
                    builder.Append(Convert.ToDouble(model.p_dx_pk));
                }

                builder.AppendFormat("{0}" + Out.waplink(Utils.getUrl("plGuess.aspx?gid=" + model.ID + "&amp;p=4"), "{1}注"), "小(" + Convert.ToDouble(model.p_small_lu) + ")", new TPR2.BLL.guess.BaPay().GetCount(model.ID, Convert.ToInt32(model.p_type), 4));
            }
            #endregion

            #region 标准盘
            if (model.p_bzs_lu != 0)
            {
                builder.Append("<br />〓标准盘〓");
                if (model.p_ison == 1)
                {
                    if (model.p_isluckthr == 0)
                    {
                        builder.Append("" + Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + "&amp;act=luck3"), "封"));
                    }
                    else
                    {
                        builder.Append("" + Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + "&amp;act=noluck3"), "解封"));
                    }
                }
                if (((model.p_ison == 1 && model.p_isluckthr == 1) || model.p_isluck == 1) && model.p_active == 0)
                {
                    builder.Append("<b>(封)</b>");
                }
                else if (bo == "")
                {
                    builder.Append("<b>(停)</b>");
                }

                builder.AppendFormat("<br />{0}" + Out.waplink(Utils.getUrl("plGuess.aspx?gid=" + model.ID + "&amp;p=5"), "{1}注"), "主胜(" + Convert.ToDouble(model.p_bzs_lu) + ")", new TPR2.BLL.guess.BaPay().GetCount(model.ID, Convert.ToInt32(model.p_type), 5));
                builder.AppendFormat("<br />{0}" + Out.waplink(Utils.getUrl("plGuess.aspx?gid=" + model.ID + "&amp;p=6"), "{1}注"), "平手(" + Convert.ToDouble(model.p_bzp_lu) + ")", new TPR2.BLL.guess.BaPay().GetCount(model.ID, Convert.ToInt32(model.p_type), 6));
                builder.AppendFormat("<br />{0}" + Out.waplink(Utils.getUrl("plGuess.aspx?gid=" + model.ID + "&amp;p=7"), "{1}注"), "客胜(" + Convert.ToDouble(model.p_bzx_lu) + ")", new TPR2.BLL.guess.BaPay().GetCount(model.ID, Convert.ToInt32(model.p_type), 7));
            }
            builder.Append(Out.Tab("</div>", "<br />"));
            builder.Append(Out.Tab("<div>", ""));
            #endregion

            #region 统计 邵广林 20160817 增加机器人盈利分析
            long PayCents       = new TPR2.BLL.guess.BaPay().GetBaPayCent(model.ID, Convert.ToInt32(model.p_type));
            long PayCents_robot = new TPR2.BLL.guess.BaPay().GetBaPayCent_robot(model.ID, Convert.ToInt32(model.p_type));
            builder.Append("" + ub.Get("SiteBz") + "统计:<br />会员总注数:" + new TPR2.BLL.guess.BaPay().GetBaPayNum(model.ID, Convert.ToInt32(model.p_type)) + "/会员下注额:" + PayCents + "");
            builder.Append("<br />机器总注数:" + new TPR2.BLL.guess.BaPay().GetBaPayNum_robot(model.ID, Convert.ToInt32(model.p_type)) + "/机器下注额:" + PayCents_robot + "");
            if (model.p_result_one != null && model.p_result_two != null)
            {
                long WinMoney       = new TPR2.BLL.guess.BaPay().GetBaPaygetMoney("bcid=" + gid + " and Types=0 and isrobot=0");
                long WinMoney_robot = new TPR2.BLL.guess.BaPay().GetBaPaygetMoney("bcid=" + gid + " and Types=0 and isrobot=1");
                builder.Append("<br />会员总返彩:" + WinMoney + "/会员盈利额:" + (PayCents - WinMoney) + "");
                builder.Append("<br />机器总返彩:" + WinMoney_robot + "/机器盈利额:" + (PayCents_robot - WinMoney_robot) + "");
            }

            #endregion

            #region 〓管理〓
            builder.Append("<br />〓管理〓");
            if (model.p_active > 0 && model.p_result_one != null && model.p_result_two != null)
            {
                builder.Append("<br />" + Out.waplink(Utils.getUrl("openGuess.aspx?gid=" + gid + ""), "重开奖"));
            }
            else
            {
                builder.Append("<br />" + Out.waplink(Utils.getUrl("openGuess.aspx?gid=" + gid + ""), "开奖"));
            }

            builder.Append(" " + Out.waplink(Utils.getUrl("editGuess.aspx?gid=" + gid + ""), "修改"));
            builder.Append(" " + Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + "&amp;act=del"), "删除"));

            builder.Append(" " + Out.waplink(Utils.getUrl("payView.aspx?gid=" + gid + ""), "记录"));

            if (model.p_del == 0)
            {
                builder.Append(" " + Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + "&amp;act=no"), "隐藏"));
            }
            else
            {
                builder.Append(" " + Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + "&amp;act=yes"), "显示"));
            }

            if (model.p_jc == 0)
            {
                builder.Append("<br />抓取状态:正常抓取<br />" + Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + "&amp;jc=no"), "关闭抓取"));
            }
            else
            {
                builder.Append("<br />抓取状态:停止抓取<br />" + Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + "&amp;jc=yes"), "开启抓取"));
            }

            if (model.p_dr == 0)
            {
                builder.Append("<br />开奖方式:自动开奖<br />" + Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + "&amp;dr=1"), "人工开奖"));
            }
            else
            {
                builder.Append("<br />开奖方式:人工开奖<br />" + Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + "&amp;dr=0"), "自动开奖"));
            }

            if (model.p_ison == 1)
            {
                builder.Append("<br />" + ub.Get("SiteGqText") + "状态:" + ub.Get("SiteGqText") + "");
            }
            else
            {
                builder.Append("<br />" + ub.Get("SiteGqText") + "状态:非" + ub.Get("SiteGqText") + "");
            }

            builder.Append("" + Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + "&amp;act=once"), "编辑"));

            builder.Append("<br />8bo:" + model.p_id + "<br />");
            if (model.p_isluck == 0)
            {
                builder.Append("" + Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + "&amp;act=luck"), "全局封盘"));
            }
            else
            {
                builder.Append("" + Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + "&amp;act=noluck"), "全局解封"));
            }

            builder.Append("<br />" + Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + "&amp;act=xz"), "本场受限ID"));
            builder.Append("<br />" + Out.waplink(Utils.getUrl("../forumlog.aspx?act=gamelog&amp;ptype=2&amp;gid=" + gid + "&amp;backurl=" + Utils.PostPage(1) + ""), "" + ub.Get("SiteGqText") + "失败日志"));
            builder.Append("<br />" + Out.waplink(Utils.getUrl("../forumlog.aspx?act=gamelog&amp;ptype=1&amp;gid=" + gid + "&amp;backurl=" + Utils.PostPage(1) + ""), "操作日志"));
            builder.Append("<br />" + Out.waplink(Utils.getUrl("../forumlog.aspx?act=gameowe&amp;ptype=1&amp;gid=" + gid + "&amp;backurl=" + Utils.PostPage(1) + ""), "欠币日志"));
            #endregion

            builder.Append(Out.Tab("</div>", ""));
            builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
            builder.Append(Out.Tab("<div>", ""));
            builder.Append(Out.waplink(Utils.getPage("default.aspx"), "返回上一级"));
            builder.Append(Out.Tab("</div>", ""));
            builder.Append(Out.Tab("<div class=\"title\">", "<br />"));
            builder.Append("<a href=\"" + Utils.getUrl("../default.aspx") + "\">返回管理中心</a>");
            builder.Append(Out.Tab("</div>", "<br />"));
        }
    }
Ejemplo n.º 9
0
 /// <summary>
 /// 得到查询的记录数
 /// </summary>
 public int GetCount(TPR2.Model.guess.BaList model)
 {
     return(dal.GetCount(model));
 }
Ejemplo n.º 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //会员身份页面取会员实体
        int meid = new BCW.User.Users().GetUsId();

        if (meid == 0)
        {
            Utils.Login();
        }

        long   gold  = new BCW.BLL.User().GetGold(meid);
        long   money = new BCW.BLL.User().GetMoney(meid);
        int    gid   = Utils.ParseInt(Utils.GetRequest("gid", "all", 2, @"^[0-9]*$", "竞猜ID无效"));
        string p     = Utils.GetRequest("p", "all", 2, @"^\d\d$|^5z$|^5k$|^ot$", "选择无效");

        TPR2.BLL.guess.BaList BaListbll = new TPR2.BLL.guess.BaList();

        TPR2.Model.guess.BaList modelBaList = BaListbll.GetModel(gid);
        if (modelBaList == null)
        {
            Utils.Error("不存在的记录", "");
        }
        if (modelBaList.p_del == 1)
        {
            Utils.Error("不存在的记录", "");
        }
        //联赛限制显示
        string Levens = "";

        if (modelBaList.p_type == 1)
        {
            Levens = "#" + ub.GetSub("SiteLeven1", xmlPath) + "#" + ub.GetSub("SiteLeven2", xmlPath) + "#" + ub.GetSub("SiteLeven3", xmlPath) + "#" + ub.GetSub("SiteLeven4", xmlPath) + "#";
        }
        else
        {
            Levens = "#" + ub.GetSub("SiteLevenb1", xmlPath) + "#" + ub.GetSub("SiteLevenb2", xmlPath) + "#" + ub.GetSub("SiteLevenb3", xmlPath) + "#" + ub.GetSub("SiteLevenb4", xmlPath) + "#";
        }

        if (!Levens.Contains("#" + modelBaList.p_title + "#"))
        {
            Utils.Error("联赛“" + modelBaList.p_title + "”尚未设置,请联系<a href=\"" + Utils.getUrl("/bbs/uinfo.aspx?uid=10086") + "\">客服</a>申诉,谢谢", "");
        }
        //--------------------------------------------------------------
        if (string.IsNullOrEmpty(modelBaList.p_score))
        {
            Utils.Error("不存在的波胆盘或已关闭波胆投注", "");
        }
        //根据P值得到比分和赔率
        string bf = "";
        string pl = "";

        string[] score = modelBaList.p_score.Split(',');
        for (int i = 0; i < score.Length; i++)
        {
            string[] Temp = score[i].Split('|');
            if (Temp[0].Replace(":", "") == p)
            {
                bf = Temp[0];
                pl = Temp[1];
                break;
            }
        }
        if (pl == "-1")
        {
            Utils.Error("此波胆暂无数据", "");
        }


        //--------------------------------------------------------------
        Master.Title = modelBaList.p_one + "VS" + modelBaList.p_two + "";
        string ac = Utils.GetRequest("ac", "post", 1, "", "");

        if (ac != "")
        {
            #region  注确认
            //判断金额是否够了
            int    types   = 0;
            int    payCent = 0;
            string BzText  = "";
            if (Utils.ToSChinese(ac) == ub.Get("SiteBz2") + "下注")
            {
                payCent = Utils.ParseInt(Utils.GetRequest("payCent", "post", 2, @"^[1-9]\d*$", "下注无效"));
                if (money < Convert.ToInt64(payCent))
                {
                    Utils.Error("你的" + ub.Get("SiteBz2") + "不够此次下注", "");
                }
                types  = 1;
                BzText = ub.Get("SiteBz2");
            }
            else
            {
                if (Utils.GetTopDomain().Contains("tuhao") || Utils.GetTopDomain().Contains("th"))
                {
                    if (Utils.ToSChinese(ac) == "50万")
                    {
                        payCent = 500000;
                    }
                    else if (Utils.ToSChinese(ac) == "100万")
                    {
                        payCent = 1000000;
                    }
                    else if (Utils.ToSChinese(ac) == "200万")
                    {
                        payCent = 2000000;
                    }
                    else if (Utils.ToSChinese(ac) == "500万")
                    {
                        payCent = 5000000;
                    }
                    else
                    {
                        payCent = Utils.ParseInt(Utils.GetRequest("payCent", "post", 2, @"^[1-9]\d*$", "下注无效"));
                    }
                }
                else
                {
                    if (Utils.ToSChinese(ac) == "100万")
                    {
                        payCent = 1000000;
                    }
                    else if (Utils.ToSChinese(ac) == "200万")
                    {
                        payCent = 2000000;
                    }
                    else if (Utils.ToSChinese(ac) == "500万")
                    {
                        payCent = 5000000;
                    }
                    else if (Utils.ToSChinese(ac) == "1000万")
                    {
                        payCent = 10000000;
                    }
                    else
                    {
                        payCent = Utils.ParseInt(Utils.GetRequest("payCent", "post", 2, @"^[1-9]\d*$", "下注无效"));
                    }
                }
                if (gold < Convert.ToInt64(payCent))
                {
                    Utils.Error("你的" + ub.Get("SiteBz") + "不够此次下注", "");
                }
                types  = 0;
                BzText = ub.Get("SiteBz");
            }

            if (modelBaList.p_TPRtime <= DateTime.Now)
            {
                Utils.Error("开赛时间已到,暂停下注", "");
            }

            if (modelBaList.p_result_temp1 != null && modelBaList.p_result_temp2 != null && modelBaList.p_result_temp1 != 0 && modelBaList.p_result_temp2 != 0)
            {
                Utils.Error("开赛时间已到,暂停下注!", "");
            }
            if (modelBaList.p_isondel == 1)
            {
                Utils.Error("已封盘,暂停下注", "");
            }
            if (types == 1)
            {
                if (payCent < Convert.ToInt64(ub.GetSub("SiteSmallPay3", xmlPath)) || payCent > Convert.ToInt64(ub.GetSub("SiteBigPay3", xmlPath)))
                {
                    Utils.Error("" + ub.Get("SiteBz2") + "金额限" + ub.GetSub("SiteSmallPay3", xmlPath) + "-" + ub.GetSub("SiteBigPay3", xmlPath) + "" + ub.Get("SiteBz2") + "", "");
                }

                //每场每ID下注额
                long setPayCents = Utils.ParseInt64(ub.GetSub("SiteIDMaxPay", xmlPath));
                if (setPayCents != 0)
                {
                    long myPayCents = new TPR2.BLL.guess.BaPay().GetBaPaypayCent("bcid=" + gid + " and pType=" + Convert.ToInt32(modelBaList.p_type) + " and payusid=" + meid + " and Types=1");
                    if (myPayCents + Convert.ToInt64(payCent) > setPayCents)
                    {
                        if (myPayCents >= setPayCents)
                        {
                            Utils.Error("系统限制本场每ID下注上限" + setPayCents + "" + ub.Get("SiteBz2") + ",欢迎在下场下注", "");
                        }
                        else
                        {
                            Utils.Error("系统限制本场每ID下注上限" + setPayCents + "" + ub.Get("SiteBz2") + ",你现在最多可以下注" + (setPayCents - myPayCents) + "" + ub.Get("SiteBz2") + "", "");
                        }
                    }
                }
            }
            if (types == 0)
            {
                //此波胆还可以下注多少
                long MaxCent = Utils.ParseInt64(ub.GetSub("SiteScore" + p + "", xmlPath));
                if (MaxCent > 0)
                {
                    int  getp = ScoreType(p);
                    long Cent = new TPR2.BLL.guess.BaPay().GetBaPayCent2(gid, Convert.ToInt32(modelBaList.p_type), getp);
                    if (Cent + Convert.ToInt64(payCent) > MaxCent)
                    {
                        if (Cent >= MaxCent)
                        {
                            Utils.Error("此波胆下注上限" + MaxCent + "" + ub.Get("SiteBz") + ",欢迎在下场下注", "");
                        }
                        else
                        {
                            Utils.Error("此波胆下注上限" + MaxCent + "" + ub.Get("SiteBz") + ",你现在最多可以下注" + (MaxCent - Cent) + "" + ub.Get("SiteBz") + "", "");
                        }
                    }
                }

                //每场每ID下注额
                long setPayCents = Utils.ParseInt64(ub.GetSub("SitePayCent", xmlPath));
                if (setPayCents != 0)
                {
                    long myPayCents = new TPR2.BLL.guess.BaPay().GetBaPayCent(gid, Convert.ToInt32(modelBaList.p_type), meid);
                    if (myPayCents + Convert.ToInt64(payCent) > setPayCents)
                    {
                        if (myPayCents >= setPayCents)
                        {
                            Utils.Error("系统限制本场每ID下注上限" + setPayCents + "" + ub.Get("SiteBz") + ",欢迎在下场下注", "");
                        }
                        else
                        {
                            Utils.Error("系统限制本场每ID下注上限" + setPayCents + "" + ub.Get("SiteBz") + ",你现在最多可以下注" + (setPayCents - myPayCents) + "" + ub.Get("SiteBz") + "", "");
                        }
                    }
                }
            }
            //组合显示串
            string payview = "";
            payview += "[url=/bbs/guess2/showguess.aspx?gid=" + gid + "]" + modelBaList.p_one + "VS" + modelBaList.p_two + "[/url]";
            payview += "压波胆" + ScoreType3(bf) + "(" + pl + "倍),投" + payCent + "" + BzText + "";


            //支付安全提示
            string[] p_pageArr = { "ac", "gid", "payCent", "p" };
            BCW.User.PaySafe.PaySafePage(meid, Utils.getPageUrl(), p_pageArr);

            //是否刷屏
            long   small   = Convert.ToInt64(ub.GetSub("SiteSmallPay", xmlPath));
            long   big     = Convert.ToInt64(ub.GetSub("SiteBigPay", xmlPath));
            string appName = "LIGHT_GUESS";
            int    Expir   = Utils.ParseInt(ub.GetSub("SiteExpir", xmlPath));

            BCW.User.Users.IsFresh(appName, Expir, Convert.ToInt64(payCent), small, big);
            //写入bapay
            string mename = new BCW.BLL.User().GetUsName(meid);
            TPR2.Model.guess.BaPay model = new TPR2.Model.guess.BaPay();
            model.Types          = types;
            model.payview        = payview;
            model.payusid        = meid;
            model.payusname      = mename;
            model.bcid           = gid;
            model.pType          = modelBaList.p_type;
            model.PayType        = ScoreType(p);
            model.payCent        = payCent;
            model.payonLuone     = Convert.ToDecimal(pl);
            model.payonLutwo     = 0;
            model.payonLuthr     = 0;
            model.p_pk           = 0;
            modelBaList.p_dx_pk  = 0;
            model.p_dx_pk        = 0;
            model.p_pn           = 0;
            model.paytimes       = DateTime.Now;
            model.p_result_temp1 = 0;
            model.p_result_temp2 = 0;
            model.itypes         = 0;
            model.state          = 0;
            model.p_TPRtime      = Convert.ToDateTime(modelBaList.p_TPRtime);
            model.p_oncetime2    = DateTime.Parse("1990-1-1");
            int pid = new TPR2.BLL.guess.BaPay().Add(model);
            //操作币
            if (types == 0)
            {
                new BCW.BLL.User().UpdateiGold(meid, -Convert.ToInt64(payCent), "球彩下注记录" + gid + "-" + pid + "|" + payview);
            }
            else
            {
                new BCW.BLL.User().UpdateiMoney(meid, -Convert.ToInt64(payCent), "球彩下注记录" + gid + "-" + pid + "|" + payview);
            }

            //   活跃抽奖入口_20160621姚志光
            try
            {
                //表中存在虚拟球类记录
                if (new BCW.BLL.tb_WinnersGame().ExistsGameName("虚拟球类"))
                {
                    //投注是否大于设定的限额,是则有抽奖机会
                    if (payCent > new BCW.BLL.tb_WinnersGame().GetPrice("虚拟球类"))
                    {
                        string TextForUbb       = (ub.GetSub("TextForUbb", "/Controls/winners.xml"));       //设置内线提示的文字
                        string WinnersGuessOpen = (ub.GetSub("WinnersGuessOpen", "/Controls/winners.xml")); //1发内线2不发内线
                        int    hit = new BCW.winners.winners().CheckActionForAll(1, pid, meid, mename, "球彩", 3);
                        if (hit == 1)
                        {
                            //内线开关 1开
                            if (WinnersGuessOpen == "1")
                            {
                                //发内线到该ID
                                new BCW.BLL.Guest().Add(0, meid, mename, TextForUbb);
                            }
                        }
                    }
                }
            }
            catch { }
            string TzMaxGuest = "#" + ub.GetSub("SiteTzMaxGuest", xmlPath) + "#";
            if (!TzMaxGuest.Contains("#" + gid + "#"))
            {
                long gidPrices = new TPR2.BLL.guess.BaPay().GetBaPayCent(gid, Convert.ToInt32(modelBaList.p_type));
                if (Utils.GetTopDomain().Contains("tuhao") || Utils.GetTopDomain().Contains("th"))
                {
                    if (gidPrices >= 5000000)
                    {
                        new BCW.BLL.Guest().Add(10086, "10086", "球赛ID:" + gid + "超5百W,请检查");

                        ub xml = new ub();
                        xml.ReloadSub(xmlPath); //加载配置
                        xml.dss["SiteTzMaxGuest"] = xml.dss["SiteTzMaxGuest"] + "#" + gid;

                        System.IO.File.WriteAllText(Server.MapPath(xmlPath), xml.Post(xml.dss), System.Text.Encoding.UTF8);
                    }
                }
                else if (Utils.GetTopDomain().Contains("kb288.net"))
                {
                    if (gidPrices >= 50000)
                    {
                        new BCW.BLL.Guest().Add(10086, "10086", "球赛ID:" + gid + "超5W,请检查");
                        new BCW.BLL.Guest().Add(1, "1", "球赛ID:" + gid + "超5W,请检查");
                        new BCW.BLL.Guest().Add(2, "2", "球赛ID:" + gid + "超5W,请检查");

                        ub xml = new ub();
                        xml.ReloadSub(xmlPath); //加载配置
                        xml.dss["SiteTzMaxGuest"] = xml.dss["SiteTzMaxGuest"] + "#" + gid;

                        System.IO.File.WriteAllText(Server.MapPath(xmlPath), xml.Post(xml.dss), System.Text.Encoding.UTF8);
                    }
                }
                else
                {
                    if (gidPrices >= 2000000)
                    {
                        //new BCW.BLL.Guest().Add(10086, "客服", "[url=/bbs/guess2/showguess.aspx?gid=" + gid + "]" + modelBaList.p_one + "VS" + modelBaList.p_two + "[/url]达200w,请检查");
                        //new BCW.BLL.Guest().Add(1010, "客服", "[url=/bbs/guess2/showguess.aspx?gid=" + gid + "]" + modelBaList.p_one + "VS" + modelBaList.p_two + "[/url]达200w,请检查");

                        new BCW.BLL.Guest().Add(10086, "10086", "球赛ID:" + gid + "超2百W,请检查");
                        //if (!Utils.GetTopDomain().Contains("tuhao") && !Utils.GetTopDomain().Contains("th"))
                        //{
                        //    new BCW.BLL.Guest().Add(1010, "1010", "球赛ID:" + gid + "超2百W,请检查");
                        //}
                        ub xml = new ub();
                        xml.ReloadSub(xmlPath); //加载配置
                        xml.dss["SiteTzMaxGuest"] = xml.dss["SiteTzMaxGuest"] + "#" + gid;

                        System.IO.File.WriteAllText(Server.MapPath(xmlPath), xml.Post(xml.dss), System.Text.Encoding.UTF8);
                    }
                }
            }
            string wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/guess2/default.aspx]球彩[/url]:[url=/bbs/guess2/showguess.aspx?gid=" + gid + "]" + modelBaList.p_one + "VS" + modelBaList.p_two + "[/url]下注**" + BzText + "";
            new BCW.BLL.Action().Add(5, 0, meid, "", wText);
            Utils.Success("下注", "恭喜,下注成功..", Utils.getUrl("showGuess.aspx?act=score&amp;gid=" + gid + ""), "1");
            #endregion
        }
        else
        {
            #region  注
            builder.Append(Out.Tab("<div class=\"title\">", ""));
            builder.Append("波胆盘" + ScoreType3(bf) + "(" + pl + "倍)含本金");
            builder.Append(Out.Tab("</div>", ""));

            string strText = "输入,,";
            string strName = "payCent,gid,p";
            string strType = "num,hidden,hidden";
            string strValu = "'" + gid + "'" + p + "";
            string strEmpt = "true,true,true";
            string strIdea = "/限" + ub.GetSub("SiteSmallPay", xmlPath) + "-" + ub.GetSub("SiteBigPay", xmlPath) + "" + ub.Get("SiteBz") + "/";
            //此波胆还可以下注多少
            long MaxCent = Utils.ParseInt64(ub.GetSub("SiteScore" + p + "", xmlPath));
            if (MaxCent > 0)
            {
                int  getp = ScoreType(p);
                long Cent = new TPR2.BLL.guess.BaPay().GetBaPayCent2(gid, Convert.ToInt32(modelBaList.p_type), getp);
                strIdea += "提示:此波胆还可以下注" + (MaxCent - Cent) + "" + ub.Get("SiteBz") + "/";
            }
            string strOthe = "" + ub.Get("SiteBz") + "下注|" + ub.Get("SiteBz2") + "下注,payGuess2.aspx,post,0,red|blue";
            builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));

            builder.Append(Out.Tab("<div>", "<br />"));
            builder.Append("=" + ub.Get("SiteBz") + "快捷下注=");
            builder.Append(Out.Tab("</div>", "<br />"));
            //快捷下注
            strText = ",,";
            strName = "gid,p";
            strType = "hidden,hidden,hidden";
            strValu = "" + gid + "'" + p + "";
            strEmpt = "true,true";
            strIdea = "";
            if (Utils.GetTopDomain().Contains("tuhao") || Utils.GetTopDomain().Contains("th"))
            {
                strOthe = "50万|100万|200万|500万,payGuess2.aspx,post,3,other|other|other|other";
            }
            else
            {
                strOthe = "100万|200万|500万|1000万,payGuess2.aspx,post,3,other|other|other|other";
            }

            builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));

            builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
            builder.Append("您现在有" + Utils.ConvertGold(gold) + "" + ub.Get("SiteBz") + "/" + Utils.ConvertGold(money) + "" + ub.Get("SiteBz2") + "<br />");
            builder.Append(Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + ""), "取消下注"));
            builder.Append(Out.Tab("</div>", ""));
            #endregion
        }
        builder.Append(Out.Tab("<div>", Out.Hr()));
        builder.Append(Out.waplink(Utils.getUrl("myGuess.aspx?ptype=1"), "未开投注") + " ");
        builder.Append(Out.waplink(Utils.getUrl("myGuess.aspx?ptype=2"), "历史投注") + "<br />");
        builder.Append(Out.waplink(Utils.getUrl("default.aspx"), "返回球彩首页") + "");
        builder.Append(Out.Tab("</div>", "<br />"));
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append(Out.waplink(Utils.getUrl("/default.aspx"), "首页") + "-");
        builder.Append(Out.waplink(Utils.getPage("default.aspx"), "上级") + "-");
        builder.Append(Out.waplink(Utils.getUrl("default.aspx"), "球彩") + "");
        builder.Append(Out.Tab("</div>", ""));
    }
Ejemplo n.º 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Master.Title = "增加赛事";
        int    ptype = Utils.ParseInt(Utils.GetRequest("ptype", "all", 1, @"^[1-2]$", "1"));
        string ac    = Utils.GetRequest("ac", "all", 1, "", "");

        if (ac == "确定添加" || ac == Utils.ToTChinese("确定添加"))
        {
            string   p_title   = Out.UBB(Utils.GetRequest("p_title", "post", 2, @"^[\u4e00-\u9fa5A-Za-z0-9]+$", "请正确填写联赛名称"));
            DateTime p_TPRtime = Utils.ParseTime(Utils.GetRequest("p_TPRtime", "post", 2, DT.RegexTime, "请正确填写联赛时间"));
            string   p_one     = Out.UBB(Utils.GetRequest("p_one", "post", 2, @"^[\u4e00-\u9fa5A-Za-z0-9]+$", "请正确填写上盘名称"));
            string   p_two     = Out.UBB(Utils.GetRequest("p_two", "post", 2, @"^[\u4e00-\u9fa5A-Za-z0-9]+$", "请正确填写下盘名称"));
            decimal  p_one_lu  = Convert.ToDecimal(Utils.GetRequest("p_one_lu", "post", 2, @"^(\d)*(\.(\d){1,2})?$", "请正确填写上盘赔率,小数点后保留1-2位"));
            decimal  p_two_lu  = Convert.ToDecimal(Utils.GetRequest("p_two_lu", "post", 2, @"^(\d)*(\.(\d){1,2})?$", "请正确填写下盘赔率,小数点后保留1-2位"));

            decimal p_big_lu   = Convert.ToDecimal(Utils.GetRequest("p_big_lu", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写大盘赔率,小数点后保留1-2位"));
            decimal p_small_lu = Convert.ToDecimal(Utils.GetRequest("p_small_lu", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写小盘赔率,小数点后保留1-2位"));

            if (p_one_lu > 4 || p_two_lu > 4 || p_big_lu > 4 || p_small_lu > 4)
            {
                Utils.Error("请检查让球、大小盘赔率,不能大于4", "");
            }

            int     p_pn     = 0;
            decimal p_pk     = 0;
            decimal p_dx_pk  = 0;
            decimal p_bzs_lu = 0;
            decimal p_bzp_lu = 0;
            decimal p_bzx_lu = 0;
            if (ptype == 1)
            {//足球特征
                p_pn    = Utils.ParseInt(Utils.GetRequest("p_pn", "post", 2, @"^[1-2]$", "请正确选择让球类型"));
                p_pk    = Convert.ToDecimal(Utils.GetRequest("p_pk", "post", 2, @"^[0-9]{1,21}$", "请正确选择让球盘口"));
                p_dx_pk = Convert.ToDecimal(Utils.GetRequest("p_dx_pk", "post", 2, @"^[0-9]{1,19}$", "请正确选择大小盘口"));
                if (Request["p_bzs_lu"] != "")
                {
                    p_bzs_lu = Convert.ToDecimal(Utils.GetRequest("p_bzs_lu", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写主胜赔率,小数点后保留1-2位"));
                    p_bzp_lu = Convert.ToDecimal(Utils.GetRequest("p_bzp_lu", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写平手赔率,小数点后保留1-2位"));
                    p_bzx_lu = Convert.ToDecimal(Utils.GetRequest("p_bzx_lu", "post", 2, @"^-1$|^(\d)*(\.(\d){1,2})?$", "请正确填写客胜赔率,小数点后保留1-2位"));
                    if (p_bzs_lu > 50 || p_bzp_lu > 50 || p_bzx_lu > 50)
                    {
                        Utils.Error("请检查标准盘赔率,不能大于50", "");
                    }
                }
                else
                {
                    p_bzs_lu = 0;
                    p_bzp_lu = 0;
                    p_bzx_lu = 0;
                }
            }
            else
            {//篮球特征
                p_pk    = Convert.ToDecimal(Utils.GetRequest("p_pk", "post", 2, @"^(-)?(\d)*(\.(\d){1})?$", "请正确填写让球盘口"));
                p_dx_pk = Convert.ToDecimal(Utils.GetRequest("p_dx_pk", "post", 2, @"^(-)?(\d)*(\.(\d){1})?$", "请正确填写大小盘口"));
            }
            int p_ison = Convert.ToInt32(Utils.GetRequest("p_ison", "post", 1, @"^[0-1]$", "0"));


            //联赛限制显示
            string xmlPath = "/Controls/guess2.xml";
            string Levens  = "";
            if (ptype == 1)
            {
                Levens = "#" + ub.GetSub("SiteLeven1", xmlPath) + "#" + ub.GetSub("SiteLeven2", xmlPath) + "#" + ub.GetSub("SiteLeven3", xmlPath) + "#" + ub.GetSub("SiteLeven4", xmlPath) + "#";
            }
            else
            {
                Levens = "#" + ub.GetSub("SiteLevenb1", xmlPath) + "#" + ub.GetSub("SiteLevenb2", xmlPath) + "#" + ub.GetSub("SiteLevenb3", xmlPath) + "#" + ub.GetSub("SiteLevenb4", xmlPath) + "#";
            }

            if (!Levens.Contains("#" + p_title + "#"))
            {
                Utils.Error("在四个联赛分级中不存在“" + p_title + "”联赛,请设置才能继续...", "");
            }


            //游戏日志记录
            int      ManageId  = new BCW.User.Manage().IsManageLogin();
            int      gid       = new TPR.BLL.guess.BaList().GetMaxId();
            string[] p_pageArr = { "ac", "p_title", "ptype", "p_one", "p_two", "p_pk", "p_dx_pk", "p_pn", "p_one_lu", "p_two_lu", "p_big_lu", "p_small_lu", "p_bzs_lu", "p_bzp_lu", "p_bzx_lu", "p_TPRtime", "p_ison" };
            BCW.User.GameLog.GameLogPage(1, Utils.getPageUrl(), p_pageArr, "后台管理员" + ManageId + "号增加赛事" + p_one + "VS" + p_two + "(" + gid + ")", gid);

            //写入数据
            TPR2.Model.guess.BaList model = new TPR2.Model.guess.BaList();
            model.p_id       = 0;
            model.p_title    = p_title;
            model.p_type     = ptype;
            model.p_one      = p_one;
            model.p_two      = p_two;
            model.p_pk       = p_pk;
            model.p_dx_pk    = p_dx_pk;
            model.p_pn       = p_pn;
            model.p_one_lu   = p_one_lu;
            model.p_two_lu   = p_two_lu;
            model.p_big_lu   = p_big_lu;
            model.p_small_lu = p_small_lu;
            model.p_bzs_lu   = p_bzs_lu;
            model.p_bzp_lu   = p_bzp_lu;
            model.p_bzx_lu   = p_bzx_lu;
            model.p_addtime  = DateTime.Now;
            model.p_TPRtime  = p_TPRtime;
            model.p_ison     = p_ison;
            model.p_del      = 0;
            new TPR2.BLL.guess.BaList().Add(model);
            Utils.Success("添加赛事", "添加赛事成功..<br />" + Out.waplink(Utils.getUrl("addGuess.aspx"), "继续添加") + "", Utils.getUrl("default.aspx"), "1");
        }
        else
        {
            builder.Append(Out.Tab("<div class=\"title\">", ""));
            builder.Append("增加赛事");
            builder.Append(Out.Tab("</div>", "<br />"));
            if (ptype == 1)
            {
                builder.Append(Out.Tab("<div class=\"text\">", ""));
                builder.Append("增加:足球赛事 " + Out.waplink(Utils.getUrl("addGuess.aspx?ptype=2"), "切换篮球"));
                builder.Append(Out.Tab("</div>", ""));
                string strText = "联赛名称,联赛时间,上盘名称,上盘赔率,下盘名称,下盘赔率,让球类型,让球盘口,大盘赔率,小盘赔率,大小盘口,主胜赔率,平手赔率,客胜赔率,是否开" + ub.Get("SiteGqText") + ",";
                string strName = "p_title,p_TPRtime,p_one,p_one_lu,p_two,p_two_lu,p_pn,p_pk,p_big_lu,p_small_lu,p_dx_pk,p_bzs_lu,p_bzp_lu,p_bzx_lu,p_ison,ptype";
                string strType = "text,date,text,text,text,text,select,select,text,text,select,text,text,text,select,hidden";
                string strValu = "'" + DT.FormatDate(DateTime.Now.AddHours(5), 0) + "'''''1'1'''1''''0'" + ptype + "";
                string strEmpt = "flase,false,false,false,false,false,1|让球|2|受让,1|平手|2|平手/半球|3|半球|4|半球/一球|5|一球|6|一球/球半|7|球半|8|球半/二球|9|二球|10|二球/二球半|11|二球半|12|二球半/三球|13|三球|14|三球/三球半|15|三球半|16|三球半/四球|17|四球|18|四球/四球半|19|四球半|20|四球半/五球|21|五球|22|五球/五球半|23|五球半|24|五球半/六球|25|六球|26|六球/六球半|27|六球半|28|六球半/七球|29|七球|30|七球/七球半|31|七球半|32|七球半/八球|33|八球,true,true,20|0.5|21|0.5/1.0|22|1.0|23|1.0/1.5|1|1.5|2|1.5/2.0|3|2.0|4|2/2.5|5|2.5|6|2.5/3.0|7|3.0|8|3/3.5|9|3.5|10|3.5/4.0|11|4.0|12|4/4.5|13|4.5|14|4.5/5.0|15|5.0|16|5/5.5|17|5.5|18|5.5/6.0|19|6.0|24|6.0/6.5|25|6.5|26|6.5/7.0|27|7.0|28|7.0/7.5|29|7.5|30|7.5/8.0|31|8.0|32|8.0/8.5|33|8.5|34|8.5/9.0|35|9.0|36|9.0/9.5|37|9.5|38|9.5/10.0|39|10.0,true,true,true,0|否|1|是,true";
                string strIdea = "/联赛时间格式:" + DT.FormatDate(DateTime.Now.AddHours(5), 0) + "/";
                string strOthe = "确定添加,addGuess.aspx,post,1,red";

                builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
                builder.Append(Out.Tab("<div>", "<br />"));
                builder.Append("大小盘赔率与标准盘填写-1可隐藏,即不可下注大小盘与标准盘!");
                builder.Append(Out.Tab("</div>", ""));
            }
            else
            {
                builder.Append(Out.Tab("<div class=\"text\">", ""));
                builder.Append("增加:足球赛事 " + Out.waplink(Utils.getUrl("addGuess.aspx?ptype=1"), "切换足球"));
                builder.Append(Out.Tab("</div>", ""));
                string strText = "联赛名称,联赛时间,上盘名称,上盘赔率,下盘名称,下盘赔率,让球盘口,大盘赔率,小盘赔率,大小盘口,是否开" + ub.Get("SiteGqText") + ",";
                string strName = "p_title,p_TPRtime,p_one,p_one_lu,p_two,p_two_lu,p_pk,p_big_lu,p_small_lu,p_dx_pk,p_ison,ptype";
                string strType = "text,date,text,text,text,text,text,text,text,text,select,hidden";
                string strValu = "'" + DateTime.Now.AddHours(5) + "'''''''''0'" + ptype + "";
                string strEmpt = "flase,false,false,false,false,false,false,true,true,true,0|否|1|是,true";
                string strIdea = "/联赛时间格式:" + DT.FormatDate(DateTime.Now.AddHours(5), 0) + "/";
                string strOthe = "确定添加,addGuess.aspx,post,1,red";

                builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));
                builder.Append(Out.Tab("<div>", "<br />"));
                builder.Append("大小盘赔率填写-1可隐藏大小盘,即不可下注大小盘!");
                builder.Append(Out.Tab("</div>", ""));
            }
        }
        builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append(Out.waplink(Utils.getUrl("default.aspx"), "返回上一级"));
        builder.Append(Out.Tab("</div>", ""));
        builder.Append(Out.Tab("<div class=\"title\">", "<br />"));
        builder.Append("<a href=\"" + Utils.getUrl("../default.aspx") + "\">返回管理中心</a>");
        builder.Append(Out.Tab("</div>", "<br />"));
    }
Ejemplo n.º 12
0
    /// <summary>
    /// 篮球比分分析
    /// </summary>
    /// <param name="p_basketve"></param>
    /// <param name="p_TPRtime"></param>
    /// <param name="ID"></param>
    /// <param name="p_id"></param>
    private void basket(int p_basketve, DateTime p_TPRtime, int ID, int p_id)
    {
        int Types = p_basketve;
        int bf1   = -1;
        int bf2   = -1;

        string p_xml = GetSourceTextByUrl("http://bf.win007.com/nba_date.aspx?time=" + p_TPRtime.ToString("yyyy-MM-dd") + "", "GB2312");

        TPR2.Model.guess.Tempbakbf n = new TPR2.Model.guess.Tempbakbf();
        using (XmlReaderExtend reader = new XmlReaderExtend(p_xml))
        {
            while (reader.ReadToFollowing("h"))
            {
                string p_str = reader.GetElementValue();

                string[] Temp  = Regex.Split(p_str, @"\^");
                int      id    = 0;
                int      state = 0;

                id    = Convert.ToInt32(Temp[0]);
                state = Convert.ToInt32(Temp[5]);//状态:0:未开赛,1:一节,2:二节,5:1'OT,以此类推,-1:完场, -2:待定,-3:中断,-4:取消,-5:推迟,50中场
                #region 获取状态
                if (id == p_id)
                {
                    if (Types == 0)
                    {
                        if (state == -1)
                        {
                            bf1 = Convert.ToInt32(Temp[11]);
                            bf2 = Convert.ToInt32(Temp[12]);
                        }
                    }
                    else if (Types == 1)
                    {
                        if (state > 1 || state == -1)
                        {
                            bf1 = Convert.ToInt32(Temp[13]);
                            bf2 = Convert.ToInt32(Temp[14]);
                        }
                    }
                    else if (Types == 2)
                    {
                        if (state > 2 || state == -1)
                        {
                            bf1 = Convert.ToInt32(Temp[15]);
                            bf2 = Convert.ToInt32(Temp[16]);
                        }
                    }
                    else if (Types == 3)
                    {
                        if (state > 2 || state == -1)
                        {
                            bf1 = Convert.ToInt32(Temp[13]) + Convert.ToInt32(Temp[15]);
                            bf2 = Convert.ToInt32(Temp[14]) + Convert.ToInt32(Temp[16]);
                        }
                    }
                    else if (Types == 4)
                    {
                        if ((state > 3 && state < 50) || state == -1)
                        {
                            bf1 = Convert.ToInt32(Temp[17]);
                            bf2 = Convert.ToInt32(Temp[18]);
                        }
                    }
                    break;
                }
                #endregion
            }
        }

        #region 开奖
        if (bf1 != -1 && bf2 != -1)
        {
            bool IsTrue = true;
            if (Types == 0 && bf1 == bf2)
            {
                IsTrue = false;
            }

            if (Types > 0 && bf1 == 0 && bf2 == 0)
            {
                IsTrue = false;
            }

            if (IsTrue)
            {
                TPR2.Model.guess.BaList model = new TPR2.Model.guess.BaList();
                model.p_id         = p_id;
                model.p_result_one = bf1;
                model.p_result_two = bf2;
                model.p_once       = "";
                model.p_active     = 1;
                model.p_basketve   = p_basketve;
                int upid = new TPR2.BLL.guess.BaList().UpdateZDResult2(model);
                if (upid > 0)
                {
                    //正常开奖
                    UpdateCase(bf1, bf2, ID, 2);
                }
            }
        }
        #endregion
    }
Ejemplo n.º 13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int ptype = int.Parse(Utils.GetRequest("ptype", "get", 1, @"^[0-9]$", "0"));
        int k     = int.Parse(Utils.GetRequest("k", "get", 1, @"^[0-9]\d*$", "1"));

        //抓取篮球数据http://3g.8bo.com的数据
        string bo = new TPR2.Collec.Basketbo().GetBasketbolist(ptype, k);

        //获取页面HTML代码
        string[] boTemp = Regex.Split(bo, @"<td class=.W1\s[\w\d]+.>");

        for (int i = 1; i < boTemp.Length; i++)
        {
            #region 取比赛状态 获得 strState值 未、点(这个是代表点球)、完、待定、腰斩、推迟(无这些选项则取的比赛进行分钟数)
            //取比赛状态
            string strState   = "";
            string strpattern = @"<td align=""center"">([\s\S]{1,10})</td>";//第N节、未、点(这个是代表点球)、完、待定、腰斩、推迟(无这些选项则取的比赛进行分钟数)
            Match  mtitle     = Regex.Match(boTemp[i], strpattern, RegexOptions.IgnoreCase);
            if (mtitle.Success)
            {
                strState = mtitle.Groups[1].Value.Trim();
            }
            #endregion

            #region 未完,大小,滚球 的数据等
            if ((strState == "未" && boTemp[i].Contains("<td>↑大小</td>")) || boTemp[i].Contains("<td>↑滾球</td>"))
            {
                #region 取联赛名称 获取title值
                //Response.Write(strState + "<br />");
                //取联赛名称
                string title = "";
                strpattern = @"([\s\S]+)</td><td class=""W2"">";
                mtitle     = Regex.Match(boTemp[i], strpattern, RegexOptions.IgnoreCase);
                if (mtitle.Success)
                {
                    title = mtitle.Groups[1].Value;
                    //Response.Write(title + "<br />");
                }
                #endregion

                #region 取p_id
                //取p_id
                int p_id = 0;
                strpattern = @"by=detail&amp;eid=(\d+).>析";
                mtitle     = Regex.Match(boTemp[i], strpattern, RegexOptions.IgnoreCase);
                if (mtitle.Success)
                {
                    p_id = Utils.ParseInt(mtitle.Groups[1].Value);
                    //Response.Write(p_id + "<br />");
                }
                #endregion

                #region  取比赛日期 获取Date
                //取比赛日期
                string Date = "";
                strpattern = @"<td class=""W2"">((\d){2}-(\d){2})</td><td class=""teamname"">";
                mtitle     = Regex.Match(boTemp[i], strpattern, RegexOptions.IgnoreCase);
                if (mtitle.Success)
                {
                    Date = mtitle.Groups[1].Value;
                    //Response.Write(Date + "<br />");
                }
                #endregion

                #region 取比赛时间 获取Time
                //取比赛时间
                string Time = "";
                strpattern = @"<td>((\d){2}:(\d){2})</td><td class=""teamname"">";
                mtitle     = Regex.Match(boTemp[i], strpattern, RegexOptions.IgnoreCase);
                if (mtitle.Success)
                {
                    Time = mtitle.Groups[1].Value;
                    //Response.Write(Time + "<br />");
                }
                DateTime p_TPRtime = DateTime.Parse(DateTime.Now.Year + "-" + Date + " " + Time);
                //Response.Write(p_TPRtime + "<br />");
                #endregion

                #region 取主队名称 获取p_one
                //取主队名称
                string p_one = "";
                strpattern = @"<td class=""teamname"">([\s\S]+)<a href=""today.aspx";
                mtitle     = Regex.Match(boTemp[i], strpattern, RegexOptions.IgnoreCase);
                if (mtitle.Success)
                {
                    p_one = mtitle.Groups[1].Value.Trim();
                    p_one = Regex.Replace(p_one, @"<small>\[[\w\d]+\]</small>", "");
                    p_one = Regex.Replace(p_one, @"<span class=""rc"">[\w\d]+</span>", "");
                    p_one = Regex.Replace(p_one, @"<.+?>", "");
                    //Response.Write(p_one + "<br />");
                }
                #endregion

                #region 取客队名称 p_two
                //取客队名称
                string p_two = "";
                strpattern = @"<td>(\d){2}:(\d){2}</td><td class=""teamname"">([\s\S]+)<small>\[[\w\d]+\]</small>";
                mtitle     = Regex.Match(boTemp[i], strpattern, RegexOptions.IgnoreCase);
                if (mtitle.Success)
                {
                    p_two = mtitle.Groups[0].Value.Trim();
                    string[] p_twoTemp = Regex.Split(p_two, @"<tr class=""alternation"">");

                    p_two = Regex.Replace(p_twoTemp[0], @"<small>\[[\w\d]+\]</small>", "");
                    p_two = Regex.Replace(p_two, @"<span class=""rc"">[\w\d]+</span>", "");
                    p_two = Regex.Replace(p_two, @"<td>(\d){2}:(\d){2}</td>", "");
                    p_two = Regex.Replace(p_two, @"<.+?>", "");
                    //Response.Write(p_two + "<br />");
                }
                else
                {
                    strpattern = @"<td>(\d){2}:(\d){2}</td><td class=""teamname"">([\s\S]+)</td></tr>";
                    mtitle     = Regex.Match(boTemp[i], strpattern, RegexOptions.IgnoreCase);
                    if (mtitle.Success)
                    {
                        p_two = mtitle.Groups[0].Value.Trim();
                        string[] p_twoTemp = Regex.Split(p_two, @"<tr class=""alternation"">");

                        p_two = Regex.Replace(p_twoTemp[0], @"<small>\[[\w\d]+\]</small>", "");
                        if (p_two.Contains("↑"))
                        {
                            p_two = Regex.Split(p_two, "↑")[0];
                        }
                        p_two = Regex.Replace(p_two, @"<td>(\d){2}:(\d){2}</td>", "");
                        p_two = Regex.Replace(p_two, @"<td colspan=""2"">\[<b class=""score"">((\d){1,}-(\d){1,})</b>\][\s\S]+", "");
                        p_two = Regex.Replace(p_two, @"<.+?>", "");
                        //Response.Write(p_two + "<br />");
                    }
                }
                #endregion

                #region 取盘口 变量定义
                //取盘口
                decimal p_one_lu   = 0;
                decimal p_two_lu   = 0;
                decimal p_pk       = 0;
                int     p_pn       = 1;
                decimal p_big_lu   = 0;
                decimal p_small_lu = 0;
                decimal p_dx_pk    = 0;
                #endregion

                #region 更新进数据库 TPR2.Model.guess.BaList 初始值
                //==================================更新进数据库====================================
                if (Convert.ToDateTime(Time) <= DateTime.Now.AddHours(Convert.ToDouble(ub.GetSub("SiteJcTime", xmlPath))))
                {
                    if (ub.GetSub("Sitelqstat", xmlPath).IndexOf(title) != -1)
                    {
                        TPR2.Model.guess.BaList model = new TPR2.Model.guess.BaList();
                        model.p_id       = p_id;
                        model.p_title    = title;
                        model.p_type     = 2;
                        model.p_one      = p_one;
                        model.p_two      = p_two;
                        model.p_pk       = p_pk;
                        model.p_dx_pk    = p_dx_pk;
                        model.p_pn       = p_pn;
                        model.p_one_lu   = p_one_lu;
                        model.p_two_lu   = p_two_lu;
                        model.p_big_lu   = p_big_lu;
                        model.p_small_lu = p_small_lu;
                        model.p_bzs_lu   = 0;
                        model.p_bzp_lu   = 0;
                        model.p_bzx_lu   = 0;
                        model.p_addtime  = DateTime.Now;
                        model.p_TPRtime  = p_TPRtime;
                        model.p_ison     = 0;
                        TPR2.BLL.guess.BaList bll = new TPR2.BLL.guess.BaList();
                        if (!bll.ExistsByp_id(Convert.ToInt32(p_id)))
                        {
                            //是否先隐藏
                            if (ub.GetSub("SiteIsyc", xmlPath) == "1")
                            {
                                model.p_del = 1;
                            }
                            else
                            {
                                model.p_del = 0;
                            }
                            bll.Add(model);
                            //Response.Write("<br />====================<br />");
                        }
                    }
                }
                //Response.Write("<br />--------------------<br />");
                //==================================更新进数据库====================================
                #endregion

                #region 更新为滚球模式
                if (boTemp[i].Contains("<td>↑滾球</td>"))
                {
                    if (ub.GetSub("Sitegqstat2", "/Controls/guess2.xml").IndexOf(title) != -1)
                    {
                        //更新为滚球模式
                        new TPR2.BLL.guess.BaList().FootOnceType2(p_id, p_TPRtime.AddMinutes(150));
                    }
                }
                #endregion

                #region 更新比赛状态
                //更新比赛状态
                if (strState != "")
                {
                    new TPR2.BLL.guess.BaList().UpdateOnce(p_id, strState);
                }
                #endregion
            }
            #endregion

            #region 完场的数据
            if (strState == "完")
            {
                //取p_id
                int p_id = 0;
                strpattern = @"by=detail&amp;eid=(\d+).>析";
                mtitle     = Regex.Match(boTemp[i], strpattern, RegexOptions.IgnoreCase);
                if (mtitle.Success)
                {
                    p_id = Utils.ParseInt(mtitle.Groups[1].Value);
                    //Response.Write(p_id + "<br />");
                }
                //这里即时完场比分
                string Result = "";
                strpattern = @"<b class=""score"">((\d){1,3}-(\d){1,3})</b>";
                mtitle     = Regex.Match(boTemp[i], strpattern, RegexOptions.IgnoreCase);
                if (mtitle.Success)
                {
                    Result = mtitle.Groups[1].Value;
                    if (Result.Contains("-"))
                    {
                        string[] p_result     = Result.Split('-');
                        int      p_result_one = Convert.ToInt32(p_result[0]);
                        int      p_result_two = Convert.ToInt32(p_result[1]);
                        new TPR2.BLL.guess.BaList().UpdateBoResult(p_id, p_result_one, p_result_two);
                    }
                }
                //更新比赛状态
                if (strState != "")
                {
                    new TPR2.BLL.guess.BaList().UpdateOnce(p_id, strState);
                }
            }
            #endregion
        }

        #region 采集篮球赛事 提示
        Master.Title = "采集篮球赛事";
        if (bo.Contains("#NEXT#"))
        {
            Master.Refresh = 10;
            Master.Gourl   = Utils.getUrl("boCollec2.aspx?k=" + (k + 1) + "");
            builder.Append("第" + k + "页采集结束,正在采集第" + (k + 1) + "页");
        }
        else
        {
            Master.Refresh = 10;
            Master.Gourl   = Utils.getUrl("boCollec2.aspx");
            builder.Append("第" + k + "页采集结束,正在循环到第1页");
        }
        #endregion
    }
Ejemplo n.º 14
0
    /// <summary>
    /// 写入数据库
    /// </summary>
    /// <param name="p_id"></param>
    /// <param name="p_pk"></param>
    /// <param name="p_dx_pk"></param>
    /// <param name="p_one_lu"></param>
    /// <param name="p_two_lu"></param>
    /// <param name="p_big_lu"></param>
    /// <param name="p_small_lu"></param>
    public void AccessData(int Types, int p_id, decimal p_pk, decimal p_dx_pk, decimal p_one_lu, decimal p_two_lu, decimal p_big_lu, decimal p_small_lu)
    {
        #region 定义Model
        TPR2.Model.guess.BaList model = new TPR2.Model.guess.BaList();
        model.p_id   = p_id;
        model.p_type = 2;

        if (p_pk < 0)
        {
            model.p_pn = 2;
        }
        else
        {
            model.p_pn = 1;
        }

        model.p_pk       = p_pk;
        model.p_dx_pk    = p_dx_pk;
        model.p_one_lu   = p_one_lu + 1;
        model.p_two_lu   = p_two_lu + 1;
        model.p_big_lu   = p_big_lu + 1;
        model.p_small_lu = p_small_lu + 1;
        model.p_bzs_lu   = 0;
        model.p_bzp_lu   = 0;
        model.p_bzx_lu   = 0;
        model.p_basketve = Types;
        #endregion

        #region 操作类 BLL
        TPR2.BLL.guess.BaList bll = new TPR2.BLL.guess.BaList();
        //检查是否存在记录
        if (!bll.ExistsByp_id(p_id, Types))
        {
            #region 是否先隐藏
            //是否先隐藏
            if (ub.GetSub("SiteIsyc", xmlPath) == "1")
            {
                model.p_del = 1;
            }
            else
            {
                model.p_del = 0;
            }
            #endregion

            #region 根据ID抓取数据 txt  http://nba.win007.com/analysis/" + p_id + ".htm
            //根据ID抓取数据
            string   txt       = new TPR2.Collec.BasketWap().GetBasketWap(p_id);
            string   p_title   = "";
            string   p_one     = "";
            string   p_two     = "";
            DateTime p_TPRtime = DateTime.Now;
            #endregion

            #region 获取队名,主队副队,时间
            string strpattern = @"[\s\S]+<strong\sstyle=[\s\S]+>([\s\S]+)</strong>[\s\S]+<strong\sstyle=[\s\S]+>([\s\S]+)</strong>[\s\S]+<b>开赛时间:</b>([\s\S]+)</font>&nbsp;&nbsp;场地:[\s\S]+target=_blank><u>([\s\S]+)";
            Match  mtitle     = Regex.Match(txt, strpattern, RegexOptions.Compiled | RegexOptions.IgnoreCase);
            if (mtitle.Success)
            {
                p_title = mtitle.Groups[4].Value;
                p_title = Regex.Replace(p_title, @"[\s\r\n]+", "");
                //builder.Append(p_title + "");

                p_one = mtitle.Groups[1].Value;
                p_one = Regex.Replace(p_one, @"[\s\r\n]+", "");
                //builder.Append(p_one + "");

                p_two = mtitle.Groups[2].Value;
                p_two = Regex.Replace(p_two, @"[\s\r\n]+", "");
                //builder.Append(p_two + "");


                string p_time = mtitle.Groups[3].Value;
                p_time    = Regex.Replace(p_time, @"[\s\r\n]+", "");
                p_time    = Regex.Replace(p_time, @"&nbsp;星期[^\^]&nbsp;", " ");
                p_TPRtime = Convert.ToDateTime(p_time);
                //builder.Append(p_TPRtime + "");
            }
            #endregion

            #region 一节 二节 上半场 三节更新
            if (Convert.ToDateTime(p_TPRtime) <= DateTime.Now.AddHours(30))
            {
                //if (ub.GetSub("Sitelqhalf", xmlPath).IndexOf(p_title) != -1 || ub.GetSub("Sitelqhalf", xmlPath) == "")
                //{
                model.p_title = p_title;
                model.p_two   = p_two;
                if (Types == 1)
                {
                    model.p_one = "(一节)" + p_one;
                }
                else if (Types == 2)
                {
                    model.p_one = "(二节)" + p_one;
                }
                else if (Types == 3)
                {
                    model.p_one = "(上半场)" + p_one;
                }
                else if (Types == 4)
                {
                    model.p_one = "(三节)" + p_one;
                }


                model.p_addtime = DateTime.Now;
                model.p_TPRtime = p_TPRtime;
                model.p_ison    = 0;
                bll.Add(model);
                //}
            }
            #endregion
        }
        else
        {
            bll.BasketUpdateOdds(model);
        }
        #endregion
    }
Ejemplo n.º 15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int    gid = Utils.ParseInt(Utils.GetRequest("gid", "all", 2, @"^[0-9]*$", "竞猜ID无效"));
        string ac  = Utils.GetRequest("ac", "all", 1, "", "");

        TPR2.BLL.guess.BaList bll = new TPR2.BLL.guess.BaList();

        if (bll.GetModel(gid) == null)
        {
            Utils.Error("不存在的记录", "");
        }
        TPR2.Model.guess.BaList model = bll.GetModel(gid);
        Master.Title = "开奖赛事" + model.p_one + "VS" + model.p_two;
        int ManageId = new BCW.User.Manage().IsManageLogin();

        //开奖限制
        if (model.p_opentime == DateTime.Parse("1990-1-1"))
        {
            if (Convert.ToDateTime(model.p_TPRtime).AddHours(8) < DateTime.Now)
            {
                if (Utils.GetTopDomain().Contains("tuhao") || Utils.GetTopDomain().Contains("th"))
                {
                    if (ManageId != 1 && ManageId != 2)
                    {
                        Utils.Error("未开奖的比赛超8小时后不能再开奖", "");
                    }
                }
                else
                {
                    if (ManageId != 1 && ManageId != 9)
                    {
                        Utils.Error("未开奖的比赛超8小时后不能再开奖", "");
                    }
                }
            }
        }
        else
        {
            if (model.p_opentime.AddHours(3) < DateTime.Now)
            {
                if (Utils.GetTopDomain().Contains("tuhao") || Utils.GetTopDomain().Contains("th"))
                {
                    if (ManageId != 1 && ManageId != 2)
                    {
                        Utils.Error("开奖后已超3小时,不能进行重新开奖", "");
                    }
                }
                else
                {
                    if (ManageId != 1 && ManageId != 9)
                    {
                        Utils.Error("开奖后已超3小时,不能进行重新开奖", "");
                    }
                }
            }
        }



        if (Utils.ToSChinese(ac) == "确定开奖" || Utils.ToSChinese(ac) == "确定重开奖")
        {
            int resultone = Utils.ParseInt(Utils.GetRequest("resultone", "post", 2, @"^[0-9]*$", "请正确输入比分"));
            int resulttwo = Utils.ParseInt(Utils.GetRequest("resulttwo", "post", 2, @"^[0-9]*$", "请正确输入比分"));
            int iType     = Utils.ParseInt(Utils.GetRequest("iType", "post", 2, @"^[1-3]*$", "请正确选择开奖模式"));

            DateTime oTime = DateTime.Now;
            string   pSms  = "";
            if (iType == 2)
            {
                oTime = Utils.ParseTime(Utils.GetRequest("oTime", "post", 2, DT.RegexTime, "请正确填写截止时间"));
                pSms  = Out.UBB(Utils.GetRequest("pSms", "post", 2, @"^[\s\S]{2,20}$", "请输入2-20字的平盘原因"));
            }
            else if (iType == 3)
            {
                pSms = Out.UBB(Utils.GetRequest("pSms", "post", 2, @"^[\s\S]{2,20}$", "请输入2-20字的平盘原因"));
            }

            string Info     = Utils.GetRequest("Info", "post", 1, "", "");
            string onceTime = Utils.GetRequest("onceTime", "post", 1, "", "");
            if (Info == "ok")
            {
                //游戏日志记录

                string[] p_pageArr = { "ac", "gid", "resultone", "resulttwo", "p_one", "iType", "oTime", "pSms", "Info", "onceTime" };
                if (model.p_result_one != null && model.p_result_two != null)
                {
                    BCW.User.GameLog.GameLogPage(1, Utils.getPageUrl(), p_pageArr, "后台管理员" + ManageId + "号重新开奖" + model.p_one + "VS" + model.p_two + "(" + gid + "),比分" + resultone + ":" + resulttwo + "", gid);
                }
                else
                {
                    BCW.User.GameLog.GameLogPage(1, Utils.getPageUrl(), p_pageArr, "后台管理员" + ManageId + "号开奖" + model.p_one + "VS" + model.p_two + "(" + gid + "),比分" + resultone + ":" + resulttwo + "", gid);
                }

                //重开奖处理:
                if (model.p_result_one != null && model.p_result_two != null)
                {
                    DataSet ds = new TPR2.BLL.guess.BaPay().GetBaPayList("pType,payview,payusid,payusname,payCent,p_getMoney,types", "bcid=" + gid + " and p_case=1 and itypes=0 ");
                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                        {
                            int    pType      = int.Parse(ds.Tables[0].Rows[i]["pType"].ToString());
                            string payview    = ds.Tables[0].Rows[i]["payview"].ToString();
                            int    payusid    = int.Parse(ds.Tables[0].Rows[i]["payusid"].ToString());
                            string payusname  = ds.Tables[0].Rows[i]["payusname"].ToString();
                            long   payCent    = Convert.ToInt64(Convert.ToDecimal(ds.Tables[0].Rows[i]["payCent"].ToString()));
                            long   p_getMoney = Convert.ToInt64(Convert.ToDecimal(ds.Tables[0].Rows[i]["p_getMoney"].ToString()));
                            int    bzType     = int.Parse(ds.Tables[0].Rows[i]["types"].ToString());
                            long   gold       = 0;
                            long   cMoney     = 0; //差多少
                            long   sMoney     = 0; //实扣
                            if (bzType == 0)
                            {
                                gold = new BCW.BLL.User().GetGold(payusid);
                            }
                            else
                            {
                                gold = new BCW.BLL.User().GetMoney(payusid);
                            }

                            if (p_getMoney > gold)
                            {
                                cMoney = p_getMoney - gold;
                                sMoney = gold;
                            }
                            else
                            {
                                sMoney = p_getMoney;
                            }

                            //重开奖的在本场没兑奖时就没显示在欠币日志,

                            //操作币并内线通知
                            if (bzType == 0)
                            {
                                new BCW.BLL.User().UpdateiGold(payusid, payusname, -sMoney, "球彩赛事ID" + gid + "重开奖,扣除已兑奖" + ub.Get("SiteBz") + "");
                                //发送内线
                                string strGuess = "球彩赛事ID" + gid + "重开奖,你欠下系统的" + p_getMoney + "" + ub.Get("SiteBz") + ".[br]根据您的帐户数额,实扣" + sMoney + "" + ub.Get("SiteBz") + ".[br]如果您的" + ub.Get("SiteBz") + "不足,系统将您帐户冻结,直到成功扣除为止。[br]" + payview + "(原开奖" + model.p_result_one + ":" + model.p_result_two + "|新开奖" + resultone + ":" + resulttwo + ")";
                                new BCW.BLL.Guest().Add(1, payusid, payusname, strGuess);
                            }
                            else
                            {
                                new BCW.BLL.User().UpdateiMoney(payusid, payusname, -sMoney, "球彩赛事ID" + gid + "重开奖,扣除已兑奖" + ub.Get("SiteBz2") + "");
                                //发送内线
                                string strGuess = "球彩赛事ID" + gid + "重开奖,你欠下系统的" + p_getMoney + "" + ub.Get("SiteBz2") + ".[br]根据您的帐户数额,实扣" + sMoney + "" + ub.Get("SiteBz2") + ".[br]如果您的" + ub.Get("SiteBz2") + "不足,系统将您帐户冻结,直到成功扣除为止。[br]" + payview + "(原开奖" + model.p_result_one + ":" + model.p_result_two + "|新开奖" + resultone + ":" + resulttwo + ")";
                                new BCW.BLL.Guest().Add(1, payusid, payusname, strGuess);
                            }
                            //如果币不够扣则记录日志并冻结IsFreeze
                            if (cMoney > 0)
                            {
                                BCW.Model.Gameowe owe = new BCW.Model.Gameowe();
                                owe.Types   = 1;
                                owe.UsID    = payusid;
                                owe.UsName  = payusname;
                                owe.Content = "" + payview + "(原开奖" + model.p_result_one + ":" + model.p_result_two + "|新开奖" + resultone + ":" + resulttwo + ")";
                                owe.OweCent = cMoney;
                                owe.BzType  = bzType;
                                owe.EnId    = gid;
                                owe.AddTime = DateTime.Now;
                                new BCW.BLL.Gameowe().Add(owe);

                                new BCW.BLL.User().UpdateIsFreeze(payusid, 1);
                            }

                            //取消得到的排行
                            TPR2.Model.guess.BaOrder objBaOrder = new TPR2.Model.guess.BaOrder();
                            objBaOrder.Orderusid   = payusid;
                            objBaOrder.Orderusname = payusname;
                            objBaOrder.Orderfanum  = 0;
                            objBaOrder.Orderjbnum  = -(p_getMoney - payCent);
                            objBaOrder.Orderbanum  = -1;
                            objBaOrder.Orderstats  = pType;
                            new TPR2.BLL.guess.BaOrder().UpdateOrder(objBaOrder);
                        }
                    }
                }

                int OnceMin = Convert.ToInt32(ub.GetSub("SiteOnce", xmlPath));//" + ub.Get("SiteGqText") + "时间限制

                //是否" + ub.Get("SiteGqText") + "赛事
                int ison = Convert.ToInt32(model.p_ison);

                //取得比分时间段

                string stronce = string.Empty;
                if (ison == 1)
                {
                    stronce = onceTime;

                    if (string.IsNullOrEmpty(stronce))
                    {
                        stronce      = footonce(Convert.ToInt32(model.p_id), Convert.ToDateTime(model.p_TPRtime));
                        model.ID     = gid;
                        model.p_once = stronce;
                        new TPR2.BLL.guess.BaList().UpdateOnce(model);
                    }
                    stronce = stronce.Replace("#", "|");
                }


                //更新比分
                model.p_result_one = resultone;
                model.p_result_two = resulttwo;

                if (iType == 3)
                {
                    model.p_active = 2;//平盘标识
                }
                else
                {
                    model.p_active = 1;
                }

                bll.UpdateResult(model);
                //更新开奖时间
                new TPR2.BLL.guess.BaList().Updatep_opentime(gid);

                int     recordCount = 0;
                int     p_intWin    = 0;
                decimal p_intDuVal  = 0;
                //组合查询条件
                string strppWhere = "";
                string strWhere   = "";
                strppWhere = "bcid=" + gid + "";
                strWhere   = "bcid=" + gid + "";
                if (iType == 2)
                {
                    strWhere   += "and paytimes<='" + oTime + "'";
                    strppWhere += "and paytimes>'" + oTime + "'";
                }


                if (iType < 3)
                {
                    TPR2.Model.guess.BaOrder objBaOrder = new TPR2.Model.guess.BaOrder();

                    // 开始查询并更新之
                    IList <TPR2.Model.guess.BaPay> listBaPay = new TPR2.BLL.guess.BaPay().GetBaPays(1, 8000, strWhere, out recordCount);
                    if (listBaPay.Count > 0)
                    {
                        foreach (TPR2.Model.guess.BaPay n in listBaPay)
                        {
                            int Iszd = 0;
                            n.p_result_one = resultone;
                            n.p_result_two = resulttwo;
                            n.p_active     = 1;
                            //币种
                            string bzTypes = string.Empty;
                            if (n.Types == 0)
                            {
                                bzTypes = ub.Get("SiteBz");
                            }
                            else
                            {
                                bzTypes = ub.Get("SiteBz2");
                            }

                            if (model.p_type == 1)
                            {
                                //是否可以平盘了
                                if (n.PayType <= 4)
                                {
                                    if (!string.IsNullOrEmpty(stronce))
                                    {
                                        string[] Sonce = stronce.Split("|".ToCharArray());

                                        for (int i = 0; i < Sonce.Length; i++)
                                        {
                                            if (Convert.ToDateTime(Sonce[i]).AddSeconds(OnceMin) > Convert.ToDateTime(n.paytimes) && Convert.ToDateTime(Sonce[i]).AddSeconds(-OnceMin) < Convert.ToDateTime(n.paytimes))
                                            {
                                                Iszd = 2;//平盘标识
                                            }
                                        }
                                    }
                                }
                                if (Iszd == 0)
                                {
                                    if (n.PayType == 1 || n.PayType == 2)
                                    {
                                        string p_strVal = string.Empty;
                                        if (ison == 1)//如果是" + ub.Get("SiteGqText") + "模式
                                        {
                                            n.p_result_one = resultone - Convert.ToInt32(n.p_result_temp1);
                                            n.p_result_two = resulttwo - Convert.ToInt32(n.p_result_temp2);
                                            p_strVal       = ZqClass.getZqsxCase(n);
                                            //重新取值
                                            n.p_result_one = resultone;
                                            n.p_result_two = resulttwo;
                                        }
                                        else
                                        {
                                            p_strVal = ZqClass.getZqsxCase(n);
                                        }
                                        new TPR2.BLL.guess.BaPay().UpdateCase(n, p_strVal, out p_intDuVal, out p_intWin);
                                        Iszd = 1;//" + ub.Get("SiteGqText") + "模式
                                    }
                                    else if (n.PayType == 3 || n.PayType == 4)
                                    {
                                        new TPR2.BLL.guess.BaPay().UpdateCase(n, ZqClass.getZqdxCase(n), out p_intDuVal, out p_intWin);
                                    }
                                    else if (n.PayType == 5 || n.PayType == 6 || n.PayType == 7)
                                    {
                                        new TPR2.BLL.guess.BaPay().UpdateCase(n, ZqClass.getZqbzCase(n), out p_intDuVal, out p_intWin);
                                    }
                                    else//波胆开奖
                                    {
                                        new TPR2.BLL.guess.BaPay().UpdateCase(n, ZqClass.getZqScoreCase(n), out p_intDuVal, out p_intWin);
                                    }
                                }
                            }
                            else
                            {
                                if (n.PayType == 1 || n.PayType == 2)
                                {
                                    new TPR2.BLL.guess.BaPay().UpdateCase(n, LqClass.getLqsxCase(n), out p_intDuVal, out p_intWin);
                                }
                                else
                                {
                                    new TPR2.BLL.guess.BaPay().UpdateCase(n, LqClass.getLqdxCase(n), out p_intDuVal, out p_intWin);
                                }
                            }
                            if (Iszd != 2)
                            {
                                if (Convert.ToInt32(n.itypes) == 0)
                                {
                                    if (p_intWin == 1)
                                    {
                                        //更新排行榜:赢

                                        objBaOrder.Orderusid   = n.payusid;
                                        objBaOrder.Orderusname = n.payusname;

                                        if (p_intDuVal == n.payCent)
                                        {
                                            objBaOrder.Orderbanum = 0;
                                            objBaOrder.Orderjbnum = 0;
                                        }
                                        else
                                        {
                                            objBaOrder.Orderbanum = 1;
                                            objBaOrder.Orderjbnum = p_intDuVal - n.payCent;
                                        }
                                        objBaOrder.Orderfanum = 0;

                                        objBaOrder.Orderstats = n.pType;
                                        new TPR2.BLL.guess.BaOrder().UpdateOrder(objBaOrder);
                                        //发送内线
                                        string strLog = string.Empty;
                                        if (Iszd == 1)  //" + ub.Get("SiteGqText") + "的内线提醒
                                        {
                                            strLog = "" + n.payview + "[br]结果:" + resultone + ":" + resulttwo + "(下注" + n.p_result_temp1 + ":" + n.p_result_temp2 + "),系统返" + Convert.ToDouble(p_intDuVal) + "" + bzTypes + "[url=/bbs/guess2/caseGuess.aspx]马上兑奖[/url]";
                                        }
                                        else
                                        {
                                            strLog = "" + n.payview + "[br]结果:" + resultone + ":" + resulttwo + ",系统返" + Convert.ToDouble(p_intDuVal) + "" + bzTypes + "[url=/bbs/guess2/caseGuess.aspx]马上兑奖[/url]";
                                        }

                                        new BCW.BLL.Guest().Add(1, Convert.ToInt32(n.payusid), n.payusname, strLog);
                                    }
                                    else
                                    {
                                        //更新排行榜:输

                                        objBaOrder.Orderusid   = n.payusid;
                                        objBaOrder.Orderusname = n.payusname;
                                        objBaOrder.Orderbanum  = 0;

                                        objBaOrder.Orderfanum = 1;

                                        objBaOrder.Orderjbnum = -n.payCent;
                                        objBaOrder.Orderbanum = 0;

                                        objBaOrder.Orderstats = n.pType;
                                        new TPR2.BLL.guess.BaOrder().UpdateOrder(objBaOrder);
                                    }
                                }
                            }
                            else
                            {
                                //平盘
                                n.p_result_one = resultone;
                                n.p_result_two = resulttwo;
                                n.p_active     = 2;
                                n.p_getMoney   = n.payCent;
                                new TPR2.BLL.guess.BaPay().UpdatePPCase(n);
                                //发送内线
                                if (Convert.ToInt32(n.itypes) == 0)
                                {
                                    //发送内线
                                    string strLog = "" + n.payview + "[br]结果平盘,原因:" + ub.Get("SiteGqText") + "赛事,系统将比分变动前后" + OnceMin + "秒钟的下注作平盘处理,返还" + Convert.ToDouble(n.payCent) + "" + bzTypes + "[url=/bbs/guess2/caseGuess.aspx]马上兑奖[/url][br]本场赛事变动时间如下:[br]" + stronce.Replace("|", "[br]") + "";
                                    new BCW.BLL.Guest().Add(1, Convert.ToInt32(n.payusid), n.payusname, strLog);
                                }
                            }
                        }
                    }
                }
                if (iType == 2 || iType == 3)
                {
                    // 平盘返还
                    IList <TPR2.Model.guess.BaPay> listBaPay = new TPR2.BLL.guess.BaPay().GetBaPays(1, 8000, strppWhere, out recordCount);
                    if (listBaPay.Count > 0)
                    {
                        foreach (TPR2.Model.guess.BaPay n in listBaPay)
                        {
                            n.p_result_one = resultone;
                            n.p_result_two = resulttwo;
                            n.p_active     = 2;
                            n.p_getMoney   = n.payCent;
                            //币种
                            string bzTypes = string.Empty;
                            if (n.Types == 0)
                            {
                                bzTypes = ub.Get("SiteBz");
                            }
                            else
                            {
                                bzTypes = ub.Get("SiteBz2");
                            }

                            new TPR2.BLL.guess.BaPay().UpdatePPCase(n);

                            //发送内线
                            if (Convert.ToInt32(n.itypes) == 0)
                            {
                                //发送内线
                                string strLog = "" + n.payview + "[br]结果平盘,原因:" + pSms + ",系统返还" + Convert.ToDouble(n.payCent) + "" + bzTypes + "[url=/bbs/guess2/caseGuess.aspx]马上兑奖[/url]";
                                new BCW.BLL.Guest().Add(1, Convert.ToInt32(n.payusid), n.payusname, strLog);
                            }
                        }
                    }
                }

                if (iType == 3)
                {
                    BCW.Data.SqlHelper.ExecuteSql("Update tb_Balist set p_id=0 where id=" + gid + "");
                    Utils.Success("开奖", "操作平盘成功..", Utils.getUrl("showGuess.aspx?gid=" + gid + ""), "1");
                }
                else
                {
                    Utils.Success("开奖", "开奖" + resultone + ":" + resulttwo + "成功..", Utils.getUrl("showGuess.aspx?gid=" + gid + ""), "1");
                }
            }
            else
            {
                builder.Append(Out.Tab("<div>", ""));
                if (iType == 1)
                {
                    builder.Append("请确认比分" + resultone + ":" + resulttwo + "");
                }
                else if (iType == 2)
                {
                    builder.Append("请确认比分" + resultone + ":" + resulttwo + "," + DT.FormatDate(oTime, 0) + "");
                }
                else
                {
                    builder.Append("请确认平盘.");
                }
                builder.Append(Out.Tab("</div>", "<br />"));
                string strName = "resultone,resulttwo,iType,oTime,pSms,onceTime,gid,Info";
                string strValu = "" + resultone + "'" + resulttwo + "'" + iType + "'" + DT.FormatDate(oTime, 0) + "'" + pSms + "'" + onceTime + "'" + gid + "'ok";
                string strOthe = "确定开奖,openGuess.aspx,post,0,red";

                builder.Append(Out.wapform(strName, strValu, strOthe));
                builder.Append(Out.Tab("<div>", "<br />"));
                builder.Append(Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + ""), "再看看吧.."));
                builder.Append(Out.Tab("</div>", "<br />"));
            }
        }
        else
        {
            builder.Append(Out.Tab("<div class=\"title\">", ""));
            builder.Append("开奖赛事" + model.p_one + "VS" + model.p_two);
            builder.Append(Out.Tab("</div>", "<br />"));

            builder.Append(Out.Tab("<div class=\"text\">", ""));
            builder.Append("开赛:" + DT.FormatDate(Convert.ToDateTime(model.p_TPRtime), 0));
            builder.Append(Out.Tab("</div>", ""));

            string strText = string.Empty;
            string strName = string.Empty;
            string strType = string.Empty;
            string strValu = string.Empty;
            string strEmpt = string.Empty;
            if (model.p_ison == 0)
            {
                strText = "*填写比分/,比/,开奖模式,截止时间,操作原因,";
                strName = "resultone,resulttwo,iType,oTime,pSms,gid";
                strType = "num,num,select,date,text,hidden";
                strValu = "0'0'1'" + DT.FormatDate(DateTime.Now.AddHours(-10), 0) + "''" + gid + "";
                strEmpt = "false,false,1|正常模式|2|截时模式|3|平盘模式,true,true,";
            }
            else
            {
                strText = "*填写比分/,比/,开奖模式,截止时间,操作原因," + ub.Get("SiteGqText") + "比分时间(格式2010-10-7 1:00:00#2010-10-7 1:20:00)/,";
                strName = "resultone,resulttwo,iType,oTime,pSms,onceTime,gid";
                strType = "num,num,select,date,text,textarea,hidden";
                strValu = "0'0'1'" + DT.FormatDate(DateTime.Now.AddHours(-10), 0) + "'''" + gid + "";
                strEmpt = "false,false,1|正常模式|2|截时模式|3|平盘模式,true,true,true,";
            }
            string strIdea = "/提示:非正常模式开奖时请输入操作原因;/当选择截时模式时,即该时间前的作正常开奖,时间后的作平盘返还;/当你选择平盘模式时,比分写成0:0即可/";
            string strOthe = "";
            if (model.p_result_one != null && model.p_result_two != null)
            {
                strOthe = "确定重开奖,openGuess.aspx,post,1,red";
            }
            else
            {
                strOthe = "确定开奖,openGuess.aspx,post,1,red";
            }

            builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe));

            if (model.p_result_one != null && model.p_result_two != null)
            {
                builder.Append(Out.Tab("<div>", "<br />"));
                builder.Append("重要:重开奖系统自动扣回已经兑奖的币并进行新一轮的开奖,如果币不够扣,即自动禁该会员的金融系统并记录<a href=\"" + Utils.getUrl("../default.aspx") + "\">欠币日志</a>");
                builder.Append(Out.Tab("</div>", ""));
            }

            builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
            builder.Append(Out.Tab("<div>", ""));
            if (Utils.GetTopDomain() == "tl88.cc" || Utils.GetTopDomain() == "168yy.cc")
            {
                string stronce = new TPR2.BLL.guess.BaList().Getp_temptimes(gid);
                if (stronce != "")
                {
                    builder.Append("" + ub.Get("SiteGqText") + "比分参考:<br />" + stronce.Replace("|", "<br />") + "");
                }
            }
            builder.Append(Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + ""), "返回上一级"));
            builder.Append(Out.Tab("</div>", ""));
            builder.Append(Out.Tab("<div class=\"title\">", "<br />"));
            builder.Append("<a href=\"" + Utils.getUrl("../default.aspx") + "\">返回管理中心</a>");
            builder.Append(Out.Tab("</div>", "<br />"));
        }
    }
Ejemplo n.º 16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int gid = Utils.ParseInt(Utils.GetRequest("gid", "get", 2, @"^[0-9]*$", "竞猜ID无效"));

        TPR2.BLL.guess.BaList   bll = new TPR2.BLL.guess.BaList();
        TPR2.Model.guess.BaList st  = bll.GetModel(gid);
        if (st == null)
        {
            Utils.Error("不存在的记录", "");
        }

        #region 立即更新水位 访问8bo
        int    second = 0;
        string bo     = "";
        //-----------------------------立即更新水位---------------------------------
        if (st.p_active == 0)
        {
            //读取SiteViewStatus 等于0时采用即时刷新,其他值时,通过刷新机刷新
            //黄国军 20160223
            if (ub.GetSub("SiteUpdateOpen", "/Controls/guess2.xml") == "" || ub.GetSub("SiteUpdateOpen", "/Controls/guess2.xml") == "0")
            {
                #region 进入旧版更新
                if (st.p_basketve == 0)
                {
                    if (st.p_type == 1)
                    {
                        if (st.p_ison == 1)
                        {
                            bo = new TPR2.Collec.Footbo().GetBoView_kb_old(Convert.ToInt32(st.p_id), true);
                        }
                        else
                        {
                            bo = new TPR2.Collec.Footbo().GetBoView_kb_old(Convert.ToInt32(st.p_id), false);
                            //进行波胆更新
                            if (st.p_score != "")
                            {
                                bo = new TPR2.Collec.Footbd().FootbdPageHtml_kb_old(Convert.ToInt32(st.p_id));
                            }
                        }
                    }
                    else
                    {
                        if (st.p_ison == 1)
                        {
                            bo = new TPR2.Collec.Basketbo().GetBoView_kb_old(Convert.ToInt32(st.p_id), true);
                        }
                        else
                        {
                            bo = new TPR2.Collec.Basketbo().GetBoView_kb_old(Convert.ToInt32(st.p_id), false);
                        }
                    }
                }
                else if (st.p_basketve == 9)
                {
                    //载入页面更新足球上半场
                    if (st.p_type == 1)
                    {
                        string s = "";
                        if (st.p_ison == 1)
                        {
                            bo = new TPR2.Collec.Footbo().GetBoView_kb_old(Convert.ToInt32(st.p_id), true);
                            bo = new TPR2.Collec.FootFalf().FootFalfPageHtml_kb_old(Convert.ToInt32(st.p_id), true, ref s);
                        }
                        else
                        {
                            bo = new TPR2.Collec.FootFalf().FootFalfPageHtml_kb_old(Convert.ToInt32(st.p_id), false, ref s);
                        }
                    }
                }
                #endregion
            }
            else
            {
                #region 进入新版更新
                if (st.p_basketve == 0)
                {
                    #region 全场赛事更新
                    if (st.p_type == 1)
                    {
                        if (st.p_ison == 1)
                        {
                            bo = new TPR2.Collec.Footbo().GetBoView1(Convert.ToInt32(st.p_id), true);
                        }
                        else
                        {
                            bo = new TPR2.Collec.Footbo().GetBoView1(Convert.ToInt32(st.p_id), false);
                            //进行波胆更新
                            if (st.p_score != "")
                            {
                                new TPR2.Collec.Footbd().FootbdPageHtml(Convert.ToInt32(st.p_id));
                            }
                        }
                        bool b = new TPR2.Collec.Footbo().ChkFootFlag(1);
                        if (!b)
                        {
                            bo = "";
                        }
                    }
                    else
                    {
                        if (st.p_ison == 1)
                        {
                            bo = new TPR2.Collec.Basketbo().GetBoView1(Convert.ToInt32(st.p_id), true);
                        }
                        else
                        {
                            bo = new TPR2.Collec.Basketbo().GetBoView1(Convert.ToInt32(st.p_id), false);
                        }
                        bool b = new TPR2.Collec.Footbo().ChkFootFlag(2);
                        if (!b)
                        {
                            bo = "";
                        }
                    }
                    #endregion
                }
                else if (st.p_basketve == 9)
                {
                    #region 半场赛事更新
                    //载入页面更新足球上半场
                    if (st.p_type == 1)
                    {
                        string s = "";
                        if (st.p_ison == 1)
                        {
                            bo = new TPR2.Collec.FootFalf().FootFalfPageHtml1(Convert.ToInt32(st.p_id), true, ref s);
                        }
                        else
                        {
                            bo = new TPR2.Collec.FootFalf().FootFalfPageHtml1(Convert.ToInt32(st.p_id), false, ref s);
                        }
                        bool b = new TPR2.Collec.Footbo().ChkFootFlag(1);
                        if (!b)
                        {
                            bo = "";
                        }
                    }
                    #endregion
                }
                #endregion
            }
            //篮球半场和单节
            if (st.p_basketve == 1 || st.p_basketve == 3)
            {
                bo = "1";
            }
        }
        #endregion

        #region 获得实体ID,并显示到界面
        //获得实体
        TPR2.Model.guess.BaList model = bll.GetModel(gid);
        //显示到标题
        Master.Title = model.p_one + "VS" + model.p_two;
        if (Request["act"] == "once")
        {
            OncePage(gid);
        }
        else if (Request["act"] == "analysis")
        {
            AnalysisPage(gid);
        }
        else if (Request["act"] == "Oddhistory")
        {
            OddhistoryPage(gid);
        }
        else if (Request["act"] == "score")
        {
            ScorePage(gid);
        }
        else
        {
            LoadPage(gid, bo, model);
        }

        builder.Append(Out.Tab("<div>", Out.Hr()));
        builder.Append(Out.waplink(Utils.getUrl("myGuess.aspx?ptype=1"), "未开投注") + " ");
        builder.Append(Out.waplink(Utils.getUrl("myGuess.aspx?ptype=2"), "历史投注") + "<br />");
        builder.Append(Out.waplink(Utils.getUrl("default.aspx"), "返回球彩首页") + "");
        builder.Append(Out.Tab("</div>", "<br />"));
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append(Out.waplink(Utils.getUrl("/default.aspx"), "首页") + "-");
        builder.Append(Out.waplink(Utils.getPage("default.aspx"), "上级") + "-");
        builder.Append(Out.waplink(Utils.getUrl("/bbs/game/default.aspx"), "游戏") + "");
        builder.Append(Out.Tab("</div>", ""));
        #endregion
    }
Ejemplo n.º 17
0
    private void ScorePage(int gid)
    {
        #region 波胆分析
        TPR2.BLL.guess.BaList   bll   = new TPR2.BLL.guess.BaList();
        TPR2.Model.guess.BaList model = bll.GetModel(gid);

        if (string.IsNullOrEmpty(model.p_score))
        {
            Utils.Error("不存在的波胆盘或已关闭波胆投注", "");
        }
        //根据会员本身的ID取会员实体
        int meid = new BCW.User.Users().GetUsId();
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        long gold = new BCW.BLL.User().GetGold(meid);
        builder.Append("您现在有" + Utils.ConvertGold(gold) + "" + ub.Get("SiteBz") + "");
        builder.Append(Out.Tab("</div>", "<br />"));
        builder.Append(Out.Tab("<div>", ""));
        string OnceText = "@";
        builder.Append("<a href=\"" + Utils.getUrl("default.aspx?showtype=1&amp;ptype=4&amp;fly=" + model.p_title + "") + "\">" + model.p_title + "</a>:" + model.p_one + "VS" + model.p_two + " " + OnceText + " " + DT.FormatDate(Convert.ToDateTime(model.p_TPRtime), 1));
        builder.Append(Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + "&amp;backurl=" + Utils.getPage(0) + ""), "[普通盘]") + "");

        if (model.p_result_one != null && model.p_result_two != null)
        {
            builder.Append("<br />完场比分:" + model.p_result_one + ":" + model.p_result_two + "");
        }
        else
        {
            builder.Append("<br />比赛状态:" + Convertp_once(model.p_once) + "");
            builder.Append(Out.waplink(Utils.getUrl("showGuess.aspx?act=score&amp;gid=" + gid + ""), "[刷新]") + "");
            builder.Append("<br />即时比分:" + model.p_result_temp1 + ":" + model.p_result_temp2 + "");
        }

        builder.Append("" + Out.waplink(Utils.getUrl("showGuess.aspx?act=analysis&amp;gid=" + model.ID + "&amp;backurl=" + Utils.PostPage(1) + ""), "[析]"));
        builder.Append(Out.Tab("</div>", "<br />"));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append("〓波胆盘〓<br />");
        builder.Append("主胜↔客胜↔打和<br />");
        string[] score = model.p_score.Split(',');

        for (int i = 0; i < score.Length; i++)
        {
            string[] Temp  = score[i].Split('|');
            string   stype = Temp[0].Replace(":", "");
            string   stext = Temp[0].Replace("5z", "主净胜5球或以上").Replace("5k", "客净胜5球或以上").Replace("ot", "其他胆");
            if (i >= 25 && i <= 26)
            {
                if (Temp[1] != "-1")
                {
                    builder.Append("" + stext + "");
                    builder.Append("<a href=\"" + Utils.getUrl("payGuess2.aspx?gid=" + model.ID + "&amp;p=" + Temp[0].Replace(":", "") + "") + "\">[" + Temp[1] + "倍]</a> ");
                }
            }
            else
            {
                builder.Append("" + stext + "");
                if (Temp[1] != "-1")
                {
                    builder.Append("<a href=\"" + Utils.getUrl("payGuess2.aspx?gid=" + model.ID + "&amp;p=" + Temp[0].Replace(":", "") + "") + "\">[" + Temp[1] + "倍]</a> ");
                }
                else
                {
                    builder.Append("[缺胆] ");
                }
            }

            if (i < 15 && (i + 1) % 3 == 0)
            {
                builder.Append("<br />");
            }
            else if (i >= 15 && i <= 25 && (i) % 2 == 0)
            {
                builder.Append("<br />");
            }
            else if (i >= 25 && i < 27)
            {
                if (i >= 25 && i <= 26)
                {
                    if (Temp[1] != "-1")
                    {
                        builder.Append("<br />");
                    }
                }
                else
                {
                    builder.Append("<br />");
                }
            }
        }

        builder.Append(Out.Tab("</div>", Out.Hr()));
        string purl    = "[url=/bbs/guess2/showguess.aspx?gid=" + gid + "]" + model.p_title + ":" + model.p_one + "VS" + model.p_two + "[/url]";
        string strName = "purl,act,backurl";
        string strValu = "" + purl + "'recommend'" + Utils.PostPage(1) + "";
        string strOthe = "分享给好友,/bbs/guest.aspx,post,1,red";
        builder.Append(Out.wapform(strName, strValu, strOthe));
        #endregion
    }
Ejemplo n.º 18
0
 /// <summary>
 /// 增加足球让球盘一条数据
 /// </summary>
 public int FootAdd(TPR2.Model.guess.BaList model)
 {
     return(dal.FootAdd(model));
 }
Ejemplo n.º 19
0
    /// <summary>
    /// 球赛盘口历史数据
    /// </summary>
    /// <param name="gid"></param>
    private void OddhistoryPage(int gid)
    {
        #region 赛事分析 点击 析 字的操作 有抓取
        //获得实体
        TPR2.BLL.guess.BaList   bll   = new TPR2.BLL.guess.BaList();
        TPR2.Model.guess.BaList model = bll.GetModel(gid);
        //类型(1全场让球盘,2全场大小盘,3全场标准盘;4半场让球盘,5半场大小盘,6半场标准盘;7第一节让球盘,8第一节大小盘;9第二节让球盘,10第二节大小盘;11第三节让球盘,12第三节大小盘)
        int t = Utils.ParseInt(Utils.GetRequest("t", "get", 2, @"^[0-12]*$", "类型无效"));

        if (model != null)
        {
            IList <TPR2.Model.guess.TBaListNew_History> models = bll.GetHistory(int.Parse(model.p_id.ToString()), t);
            Master.Title = model.p_one + "vs" + model.p_two + " " + TPR2.BLL.guess.BaList.TYPE_NAMES[t + 1];
            builder.Append(Out.Tab("<div class=\"title\">" + Out.waplink(Utils.getUrl("default.aspx"), "球彩首页") + ">" + Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + ""), "返回赛事") + "</div>", Out.waplink(Utils.getUrl("default.aspx"), "球彩首页") + ">" + Out.waplink(Utils.getUrl("showGuess.aspx?gid=" + gid + ""), "返回赛事")));
            builder.Append(Out.Tab("<div>", "<br />"));
            string strAnal = string.Empty;
            builder.Append(Out.SysUBB(model.p_one + " VS " + model.p_two + " " + TPR2.BLL.guess.BaList.TYPE_NAMES[t + 1] + "<br />"));
            builder.Append("开赛日期:" + model.p_TPRtime + "<br />");
            builder.Append(Out.SysUBB("注:数据仅作参考,不完全准确,如有错误请与[url=/bbs/uinfo.aspx?uid=10086]客服ID10086[/url]反映"));

            builder.Append("<style>table{border-collapse:collapse;align-text:center;border:solid 1px #d7d7d7;}table tr td{padding:0px 3px;border:solid 1px #d7d7d7;text-align:center;}</style>");
            builder.Append("<table>");
            if (t == 1 || t == 4)
            {
                builder.Append("<tr style=\"text-align:center;font-weight:bold;background-color:#1c5e84;color:#ffffff\"><td>序号</td><td>比分</td><td>时间</td><td>主队</td><td>让球</td><td>客队</td><td>变化时间</td><td>状态</td></tr>");
            }
            else if (t == 2 || t == 5)
            {
                builder.Append("<tr style=\"text-align:center;font-weight:bold;background-color:#1c5e84;color:#ffffff\"><td>序号</td><td>比分</td><td>时间</td><td>大球</td><td>大小球</td><td>小球</td><td>变化时间</td><td>状态</td></tr>");
            }
            else if (t == 3 || t == 6)
            {
                builder.Append("<tr style=\"text-align:center;font-weight:bold;background-color:#1c5e84;color:#ffffff\"><td>序号</td><td>比分</td><td>时间</td><td>胜</td><td>平</td><td>负</td><td>变化时间</td><td>状态</td></tr>");
            }
            if (models != null)
            {
                if (models.Count > 0)
                {
                    for (int i = 0; i < models.Count; i++)
                    {
                        builder.Append("<tr>");

                        TPR2.Model.guess.TBaListNew_History m = models[i];

                        builder.Append("<td>" + (models.Count - i) + "</td>");
                        builder.Append("<td>" + Out.SysUBB("[B]" + m.result + "[/B]") + "</td>");
                        builder.Append("<td>" + m.remark + "</td>");
                        if (m.lockflag == 1)
                        {
                            builder.Append("<td colspan=\"3\">" + Out.SysUBB("[绿]封[/绿]") + "</td>");
                        }
                        else
                        {
                            builder.Append("<td>" + Math.Round(double.Parse(m.v1.ToString()), 2).ToString() + "</td>");
                            string sr = "";
                            if (m.vs < 0)
                            {
                                sr = "[红]受[/红]";
                            }
                            if (t == 1 || t == 4)
                            {
                                builder.Append("<td>" + Out.SysUBB("[蓝]" + sr + GCK.getPkName(Math.Abs(Convert.ToInt32(m.vs))) + "[/蓝]") + "</td>");
                            }
                            else if (t == 2 || t == 5)
                            {
                                builder.Append("<td>" + Out.SysUBB("[蓝]" + sr + GCK.getDxPkName(Math.Abs(Convert.ToInt32(m.vs))) + "[/蓝]") + "</td>");
                            }
                            else if (t == 3 || t == 6)
                            {
                                builder.Append("<td>" + Out.SysUBB("[蓝]" + Convert.ToInt32(m.vs) + "[/蓝]") + "</td>");
                            }
                            builder.Append("<td>" + Math.Round(double.Parse(m.v2.ToString()), 2).ToString() + "</td>");
                        }

                        builder.Append("<td>" + Out.SysUBB("" + m.downloadtime.ToString("HH:mm:ss") + "") + "</td>");

                        if (m.zdflag == 0)
                        {
                            if (DateTime.Parse(model.p_TPRtime.ToString()).AddMonths(-1) > m.downloadtime)
                            {
                                builder.Append("<td>" + Out.SysUBB("[绿]临[/绿]") + "</td>");
                            }
                            else
                            {
                                builder.Append("<td>" + Out.SysUBB("[蓝]即[/蓝]") + "</td>");
                            }
                        }
                        else
                        {
                            builder.Append("<td>" + Out.SysUBB("[红]滚[/红]") + "</td>");
                        }
                        builder.Append("</tr>");
                    }
                }
                else
                {
                    builder.Append("暂无记录..");
                }
            }
            else
            {
                builder.Append("暂无记录..");
            }
            builder.Append("</table>");
        }
        else
        {
            builder.Append("不存在的赛事..");
        }

        builder.Append(Out.Tab("</div>", Out.Hr()));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append(Out.waplink(Utils.getPage("showGuess.aspx?gid=" + gid + ""), "返回上级") + "");
        builder.Append(Out.Tab("</div>", ""));
        #endregion
    }
Ejemplo n.º 20
0
 /// <summary>
 /// 更新赛事比分
 /// </summary>
 public void UpdateResult(TPR2.Model.guess.BaList model)
 {
     dal.UpdateResult(model);
 }
Ejemplo n.º 21
0
 /// <summary>
 /// 自动更新赛事比分
 /// </summary>
 public int UpdateZDResult(TPR2.Model.guess.BaList model)
 {
     return(dal.UpdateZDResult(model));
 }
Ejemplo n.º 22
0
 /// <summary>
 /// 更新特殊数据
 /// </summary>
 public void Update2(TPR2.Model.guess.BaList model)
 {
     dal.Update2(model);
 }
Ejemplo n.º 23
0
    public void GetFoot()
    {
        int recordCount = 0;
        IList <TPR2.Model.guess.BaList> listFoot = new TPR2.Collec.Foot().GetFoot(out recordCount);

        if (listFoot != null)
        {
            if (listFoot.Count > 0)
            {
                foreach (TPR2.Model.guess.BaList n in listFoot)
                {
                    //builder.AppendFormat("赛事ID:{0}<br />", n.p_id);
                    //builder.AppendFormat("赛事名称:{0}<br />", n.p_title);
                    //builder.AppendFormat("赛事时间:{0}<br />", n.p_TPRtime);
                    //builder.AppendFormat("主队名称:{0}<br />", n.p_one);
                    //builder.AppendFormat("客队名称:{0}<br />", n.p_two);
                    //builder.AppendFormat("盘口类型:{0}<br />", n.p_pn);
                    //builder.AppendFormat("让球盘口:{0}<br />", n.p_pk);
                    //builder.AppendFormat("主队赔率:{0}<br />", n.p_one_lu);
                    //builder.AppendFormat("客队赔率:{0}<br />", n.p_two_lu);
                    //builder.Append("<br />----------<br />");

                    //写入数据
                    if (Convert.ToDateTime(n.p_TPRtime) <= DateTime.Now.AddHours(Convert.ToDouble(ub.GetSub("SiteJcTime", xmlPath))))
                    {
                        if (ub.GetSub("Sitezqstat", xmlPath).IndexOf(n.p_title) != -1)
                        {
                            if (n.p_one_lu != 0)
                            {
                                TPR2.Model.guess.BaList model = new TPR2.Model.guess.BaList();
                                model.p_id    = n.p_id;
                                model.p_title = n.p_title;
                                model.p_type  = 1;
                                model.p_one   = n.p_one;
                                model.p_two   = n.p_two;
                                if (n.p_pn == 1)
                                {
                                    model.p_one_lu = n.p_one_lu + 1;
                                    model.p_two_lu = n.p_two_lu + 1;
                                }
                                else
                                {
                                    model.p_one_lu = n.p_two_lu + 1;
                                    model.p_two_lu = n.p_one_lu + 1;
                                }
                                //算得最终的受让结果
                                if (Convert.ToString(n.p_pk).IndexOf("-") != -1)
                                {
                                    model.p_pk = GCK.getPkNum(Convert.ToString(n.p_pk).Replace("-", ""));
                                    model.p_pn = 2;
                                }
                                else
                                {
                                    model.p_pk = GCK.getPkNum(Convert.ToString(n.p_pk));
                                    model.p_pn = n.p_pn;
                                }

                                model.p_addtime = DateTime.Now;
                                model.p_TPRtime = n.p_TPRtime;

                                TPR2.BLL.guess.BaList bll = new TPR2.BLL.guess.BaList();
                                if (bll.ExistsByp_id(Convert.ToInt32(n.p_id)))
                                {
                                    bll.FootUpdate(model);
                                }
                                else
                                {
                                    //是否先隐藏
                                    if (ub.GetSub("SiteIsyc", xmlPath) == "1")
                                    {
                                        model.p_del = 1;
                                    }
                                    else
                                    {
                                        model.p_del = 0;
                                    }
                                    bll.FootAdd(model);
                                }
                            }
                        }
                    }
                }
                binddata();
            }
        }
    }
Ejemplo n.º 24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int ptype = int.Parse(Utils.GetRequest("ptype", "get", 1, @"^[0-9]$", "0"));
        int k     = int.Parse(Utils.GetRequest("k", "get", 1, @"^[0-9]\d*$", "1"));
        //抓取http://3g.8bo.com的数据
        string bo = GetFootbolist1x(ptype, k);

        //builder.Append(bo);
        //获取页面HTML代码
        string[] boTemp = Regex.Split(bo, @"<td class=.W1\s[\w\d]+.>");
        for (int i = 1; i < boTemp.Length; i++)
        {
            builder.Append(DateTime.Now.ToString("yyyyMMddHHmmss-fff") + " ");
            builder.Append(" (" + i + ") ");

            #region 取比赛状态 获得 strState值 未、点(这个是代表点球)、完、待定、腰斩、推迟(无这些选项则取的比赛进行分钟数)
            //取比赛状态
            string strState   = "";
            string strpattern = @"<td align=""center"">([\s\S]{1,10})</td>";//未、点(这个是代表点球)、完、待定、腰斩、推迟(无这些选项则取的比赛进行分钟数)
            Match  mtitle     = Regex.Match(boTemp[i], strpattern, RegexOptions.IgnoreCase);
            if (mtitle.Success)
            {
                strState = mtitle.Groups[1].Value;
            }
            #endregion

            #region 未完,大小,滚球 的数据等
            if ((strState == "未" && boTemp[i].Contains("<td>↑大小</td>")) || boTemp[i].Contains("<td>↑滾球</td>"))
            {
                #region 取联赛名称 获取title值

                //取联赛名称
                //Response.Write(strState + "<br />");
                string title = "";
                strpattern = @"([\s\S]+)</td><td class=""W2"">";
                mtitle     = Regex.Match(boTemp[i], strpattern, RegexOptions.IgnoreCase);
                if (mtitle.Success)
                {
                    title = mtitle.Groups[1].Value;
                    //Response.Write(title + "<br />");
                }
                #endregion

                #region 取p_id
                //取p_id
                int p_id = 0;
                strpattern = @"by=detail&amp;eid=(\d+).>析";
                mtitle     = Regex.Match(boTemp[i], strpattern, RegexOptions.IgnoreCase);
                if (mtitle.Success)
                {
                    p_id = Utils.ParseInt(mtitle.Groups[1].Value);
                    //Response.Write(p_id + "<br />");
                }
                #endregion

                #region  取比赛日期 获取Date
                //取比赛日期
                string Date = "";
                strpattern = @"<td class=""W2"">((\d){2}-(\d){2})</td><td class=""teamname"">";
                mtitle     = Regex.Match(boTemp[i], strpattern, RegexOptions.IgnoreCase);
                if (mtitle.Success)
                {
                    Date = mtitle.Groups[1].Value;
                    //Response.Write(Date + "<br />");
                }
                #endregion

                #region 取比赛时间 获取Time
                //取比赛时间
                string Time = "";
                strpattern = @"<td>((\d){2}:(\d){2})</td><td class=""teamname"">";
                mtitle     = Regex.Match(boTemp[i], strpattern, RegexOptions.IgnoreCase);
                if (mtitle.Success)
                {
                    Time = mtitle.Groups[1].Value;
                    //Response.Write(Time + "<br />");
                }
                DateTime p_TPRtime = DateTime.Parse(DateTime.Now.Year + "-" + Date + " " + Time);
                //Response.Write(p_TPRtime + "<br />");
                #endregion

                #region 取主队名称 获取p_one
                //取主队名称
                string p_one = "";
                strpattern = @"<td class=""teamname"">([\s\S]+)<a href=""today.aspx";
                mtitle     = Regex.Match(boTemp[i], strpattern, RegexOptions.IgnoreCase);
                if (mtitle.Success)
                {
                    p_one = mtitle.Groups[1].Value.Trim();

                    //这里取主队红牌数量
                    if (boTemp[i].Contains("<td>↑滾球</td>"))
                    {
                        string strpatternHp = @"<span class=""rc"">(\d)</span>";
                        Match  mtitleHp     = Regex.Match(p_one, strpatternHp, RegexOptions.IgnoreCase);
                        if (mtitleHp.Success)
                        {
                            int hp_one = Utils.ParseInt(mtitleHp.Groups[1].Value);
                            if (hp_one > 0)
                            {
                                new TPR2.BLL.guess.BaList().Updatep_hp_one(p_id, hp_one);
                            }
                        }
                    }

                    p_one = Regex.Replace(p_one, @"<small>\[[\w\d]+\]</small>", "");
                    p_one = Regex.Replace(p_one, @"<span class=""rc"">[\w\d]+</span>", "");
                    p_one = Regex.Replace(p_one, @"<.+?>", "");
                    //Response.Write(p_one + "<br />");
                }
                #endregion

                #region 取客队名称 p_two
                //取客队名称
                string p_two = "";
                strpattern = @"<td>(\d){2}:(\d){2}</td><td class=""teamname"">([\s\S]+)</td></tr>";
                mtitle     = Regex.Match(boTemp[i], strpattern, RegexOptions.IgnoreCase);
                if (mtitle.Success)
                {
                    p_two = mtitle.Groups[0].Value.Trim();

                    //这里取客队红牌数量
                    if (boTemp[i].Contains("<td>↑滾球</td>"))
                    {
                        string strpatternHp2 = @"<span class=""rc"">(\d)</span>";
                        Match  mtitleHp2     = Regex.Match(p_two, strpatternHp2, RegexOptions.IgnoreCase);
                        if (mtitleHp2.Success)
                        {
                            int hp_two = Utils.ParseInt(mtitleHp2.Groups[1].Value);
                            if (hp_two > 0)
                            {
                                new TPR2.BLL.guess.BaList().Updatep_hp_two(p_id, hp_two);
                            }
                        }
                    }

                    string[] p_twoTemp = Regex.Split(p_two, @"<tr class=""alternation"">");

                    p_two = Regex.Replace(p_twoTemp[0], @"<small>\[[\w\d]+\]</small>", "");
                    p_two = Regex.Replace(p_two, @"<span class=""rc"">[\w\d]+</span>", "");
                }
                else
                {
                    strpattern = @"<td>(\d){2}:(\d){2}</td><td class=""teamname"">([\s\S]+)</td></tr>";
                    mtitle     = Regex.Match(boTemp[i], strpattern, RegexOptions.IgnoreCase);
                    if (mtitle.Success)
                    {
                        p_two = mtitle.Groups[0].Value.Trim();

                        //这里取客队红牌数量
                        if (boTemp[i].Contains("<td>↑滾球</td>"))
                        {
                            string strpatternHp2 = @"<span class=""rc"">(\d)</span>";
                            Match  mtitleHp2     = Regex.Match(p_two, strpatternHp2, RegexOptions.IgnoreCase);
                            if (mtitleHp2.Success)
                            {
                                int hp_two = Utils.ParseInt(mtitleHp2.Groups[1].Value);
                                if (hp_two > 0)
                                {
                                    new TPR2.BLL.guess.BaList().Updatep_hp_two(p_id, hp_two);
                                }
                            }
                        }

                        string[] p_twoTemp = Regex.Split(p_two, @"<tr class=""alternation"">");

                        p_two = Regex.Replace(p_twoTemp[0], @"<small>\[[\w\d]+\]</small>", "");
                        p_two = Regex.Replace(p_two, @"<span class=""rc"">[\w\d]+</span>", "");
                        if (p_two.Contains("↑"))
                        {
                            p_two = Regex.Split(p_two, "↑")[0];
                        }
                    }
                }
                p_two = Regex.Replace(p_two, @"<td>(\d){2}:(\d){2}</td>", "");
                p_two = Regex.Replace(p_two, strpattern, "");
                p_two = Regex.Replace(p_two, @"<td>\(<em>((\d){1,2}-(\d){1,2})</em>\)</td>", "");
                p_two = Regex.Replace(p_two, @"<.+?>", "");
                if (p_two.Contains("↑"))
                {
                    p_two = Regex.Split(p_two, "↑")[0];
                }
                //Response.Write(p_two + "<br />");
                #endregion

                #region 取盘口 变量定义
                //取盘口
                decimal p_one_lu   = 0;
                decimal p_two_lu   = 0;
                decimal p_pk       = 0;
                int     p_pn       = 1;
                decimal p_big_lu   = 0;
                decimal p_small_lu = 0;
                decimal p_dx_pk    = 0;
                decimal bzs        = 0;
                decimal bzp        = 0;
                decimal bzx        = 0;
                #endregion

                #region 更新进数据库 TPR2.Model.guess.BaList 初始值
                //==================================更新进数据库====================================

                TPR2.Model.guess.BaList model = new TPR2.Model.guess.BaList();
                model.p_one_lu  = p_one_lu;
                model.p_two_lu  = p_two_lu;
                model.p_pk      = p_pk;
                model.p_pn      = p_pn;
                model.p_addtime = DateTime.Now;
                model.p_type    = 1;
                model.p_title   = title;

                model.p_big_lu   = p_big_lu;
                model.p_small_lu = p_small_lu;
                model.p_dx_pk    = p_dx_pk;

                model.p_TPRtime = p_TPRtime;
                model.p_one     = p_one;
                model.p_two     = p_two;
                model.p_bzs_lu  = bzs;
                model.p_bzp_lu  = bzp;
                model.p_bzx_lu  = bzx;
                model.p_id      = p_id;
                #endregion

                #region 进行波胆更新 波胆地址有问题
                if (Convert.ToDateTime(model.p_TPRtime) <= DateTime.Now.AddHours(20))
                {
                    if (ub.GetSub("Sitezqstat", xmlPath).IndexOf(title) != -1)
                    {
                        TPR2.BLL.guess.BaList bll = new TPR2.BLL.guess.BaList();
                        if (!bll.ExistsByp_id(p_id))
                        {
                            //是否先隐藏
                            if (ub.GetSub("SiteIsyc", xmlPath) == "1")
                            {
                                model.p_del = 1;
                            }
                            else
                            {
                                model.p_del = 0;
                            }
                            bll.FootAdd(model);



                            //Response.Write("<br />====================<br />");
                        }
                        //进行波胆更新
                        if (ub.GetSub("Sitebdstat", xmlPath).IndexOf(title) != -1)
                        {
                            new TPR2.Collec.Footbd().FootbdPageHtml(p_id);
                        }
                    }
                }
                //Response.Write("<br />-----------------------<br />");
                #endregion

                #region 更新为滚球模式
                if (boTemp[i].Contains("滾球"))
                {
                    if (ub.GetSub("Sitegqstat", "/Controls/guess2.xml").IndexOf(title) != -1)
                    {
                        //更新为滚球模式 p_ison更新为1
                        new TPR2.BLL.guess.BaList().FootOnceType2(p_id, p_TPRtime.AddMinutes(130));
                    }
                }
                #endregion

                #region 更新比赛状态
                //更新比赛状态
                if (strState != "")
                {
                    new TPR2.BLL.guess.BaList().UpdateOnce(p_id, strState);
                }
                #endregion

                #region 更新半场
                //================================这里半场更新==================================
                if (strState == "未" || boTemp[i].Contains("<td>↑滾球</td>"))
                {
                    if (ub.GetSub("Sitezqhalf", xmlPath).IndexOf(title) != -1 || ub.GetSub("Sitezqhalf", xmlPath) == "")
                    {
                        #region 定义盘口变量
                        //取盘口
                        p_one_lu   = 0;
                        p_two_lu   = 0;
                        p_pk       = 0;
                        p_pn       = 1;
                        p_big_lu   = 0;
                        p_small_lu = 0;
                        p_dx_pk    = 0;
                        bzs        = 0;
                        bzp        = 0;
                        bzx        = 0;
                        DateTime p_temptime1 = DateTime.Parse("1990-1-1");
                        DateTime p_temptime2 = DateTime.Parse("1990-1-1");
                        DateTime p_temptime3 = DateTime.Parse("1990-1-1");
                        #endregion

                        #region 是不是走地
                        bool Iszd = false;

                        Iszd = new TPR2.BLL.guess.BaList().Existsp_ison(p_id, 9);
                        string txt = "";
                        if (Iszd == false)
                        {
                            if (boTemp[i].Contains("滾球") && ub.GetSub("Sitegqstat3", "/Controls/guess2.xml").IndexOf(title) != -1)
                            {
                                //更新为滚球模式
                                new TPR2.BLL.guess.BaList().FootOnceType4(p_id, p_TPRtime.AddMinutes(65));

                                Iszd = true;
                            }
                        }

                        if (Iszd)
                        {
                            txt = new TPR2.Collec.FootFalf().GetFootFalf(p_id, true);
                        }
                        else
                        {
                            txt = new TPR2.Collec.FootFalf().GetFootFalf(p_id, false);
                        }
                        //builder.Append(txt);
                        #endregion

                        #region 取亚盘
                        //取亚盘
                        string yp          = "";
                        string strpattern1 = @"d2.push\(""([\d.]{1,5}\,[^\^]{1,2}\,[\d.]{1,5}\,[\d]{4}\-[\d]{2}\-[\d]{2}\s[\d]{2}\:[\d]{2}\:[\d]{2})\,\d""\);\rd3\.push";
                        if (Iszd)
                        {
                            strpattern1 = @"d2.push\(""([\d.]{1,5}\,[\d.]{1,2}\,[\d.]{1,5}\,[\d]{4}\-[\d]{2}\-[\d]{2}\s[\d]{2}\:[\d]{2}\:[\d]{2})\,\d\,\d\,\d\,[\d]{2}'""\);\rd3\.push";
                        }
                        Match mtitle1 = Regex.Match(txt, strpattern1, RegexOptions.Compiled);
                        if (mtitle1.Success)
                        {
                            yp = mtitle1.Groups[1].Value;
                            string[] Temp = yp.Split(",".ToCharArray());
                            p_one_lu = Convert.ToDecimal(Temp[0]);
                            p_two_lu = Convert.ToDecimal(Temp[2]);
                            p_pk     = Convert.ToDecimal(Temp[1].Replace("-", ""));
                            if (Temp[1].Contains("-"))
                            {
                                p_pn = 2;
                            }
                            p_temptime1 = DateTime.Parse(Temp[3]);
                        }
                        #endregion

                        #region 取大小盘
                        //取大小盘
                        string dx          = "";
                        string strpattern2 = @"d3.push\(""([\d.]{1,5}\,[\d.]{1,3}\,[\d.]{1,5}\,[\d]{4}\-[\d]{2}\-[\d]{2}\s[\d]{2}\:[\d]{2}\:[\d]{2})\,\d""\);\rd1\.push";
                        if (Iszd)
                        {
                            strpattern2 = @"d3.push\(""([\d.]{1,5}\,[\d.]{1,3}\,[\d.]{1,5}\,[\d]{4}\-[\d]{2}\-[\d]{2}\s[\d]{2}\:[\d]{2}\:[\d]{2})\,\d\,\d\,\d\,[\d]{2}'""\);\rd1\.push";
                        }
                        Match mtitle2 = Regex.Match(txt, strpattern2, RegexOptions.Compiled);
                        if (mtitle2.Success)
                        {
                            dx = mtitle2.Groups[1].Value;
                            string[] Temp = dx.Split(",".ToCharArray());
                            p_big_lu   = Convert.ToDecimal(Temp[0]);
                            p_small_lu = Convert.ToDecimal(Temp[2]);
                            p_dx_pk    = GCK.getDxPkNum2(GCK.getDxPkNameZH(Convert.ToInt32(Temp[1])));

                            p_temptime2 = DateTime.Parse(Temp[3]);
                        }
                        #endregion

                        #region 取标准盘
                        //取标准盘
                        string bz          = "";
                        string strpattern3 = @"d1.push\(""([\d.]{5,6}\,[\d.]{5,6}\,[\d.]{5,6}\,[\d]{4}\-[\d]{2}\-[\d]{2}\s[\d]{2}\:[\d]{2}\:[\d]{2})\,\d""\);[\r\s]{1,}</script>";
                        if (Iszd)
                        {
                            strpattern3 = @"d1.push\(""([\d.]{5,6}\,[\d.]{5,6}\,[\d.]{5,6}\,[\d]{4}\-[\d]{2}\-[\d]{2}\s[\d]{2}\:[\d]{2}\:[\d]{2})\,\d\,\d\,\d\,[\d]{2}'""\);[\r\s]{1,}</script>";
                        }
                        Match mtitle3 = Regex.Match(txt, strpattern3, RegexOptions.Compiled);
                        if (mtitle3.Success)
                        {
                            bz = mtitle3.Groups[1].Value;
                            string[] Temp = bz.Split(",".ToCharArray());
                            bzs         = Convert.ToDecimal(Temp[0]);
                            bzp         = Convert.ToDecimal(Temp[1]);
                            bzx         = Convert.ToDecimal(Temp[2]);
                            p_temptime3 = DateTime.Parse(Temp[3]);
                        }
                        #endregion

                        #region 走地更新
                        decimal cc  = Convert.ToDecimal("0.000");
                        bool    fp1 = false;
                        bool    fp2 = false;
                        bool    fp3 = false;
                        if (Iszd)
                        {
                            if (cc == p_one_lu && cc == p_two_lu)
                            {
                                new TPR2.BLL.guess.BaList().Updatep_isluck(p_id, 1, 1, 9, p_temptime1);
                                fp1 = true;
                            }
                            else
                            {
                                new TPR2.BLL.guess.BaList().Updatep_isluck(p_id, 0, 1, 9, p_temptime1);
                            }
                            if (cc == p_big_lu && cc == p_small_lu)
                            {
                                new TPR2.BLL.guess.BaList().Updatep_isluck(p_id, 1, 2, 9, p_temptime2);
                                fp2 = true;
                            }
                            else
                            {
                                new TPR2.BLL.guess.BaList().Updatep_isluck(p_id, 0, 2, 9, p_temptime2);
                            }
                            if (cc == bzs && cc == bzp && cc == bzx)
                            {
                                new TPR2.BLL.guess.BaList().Updatep_isluck(p_id, 1, 3, 9, p_temptime3);
                                fp3 = true;
                            }
                            else
                            {
                                new TPR2.BLL.guess.BaList().Updatep_isluck(p_id, 0, 3, 9, p_temptime3);
                            }
                        }
                        #endregion

                        #region 半场更新进数据库
                        //==================================更新进数据库====================================
                        if (p_one_lu != 0 && p_two_lu != 0 && p_big_lu != 0 && p_small_lu != 0)
                        {
                            model.p_one_lu  = p_one_lu + 1;
                            model.p_two_lu  = p_two_lu + 1;
                            model.p_pk      = p_pk;
                            model.p_pn      = p_pn;
                            model.p_addtime = DateTime.Now;
                            model.p_type    = 1;
                            model.p_title   = title;

                            model.p_big_lu   = p_big_lu + 1;
                            model.p_small_lu = p_small_lu + 1;
                            model.p_dx_pk    = p_dx_pk;

                            model.p_TPRtime  = p_TPRtime;
                            model.p_one      = "(上半场)" + p_one;
                            model.p_two      = p_two;
                            model.p_bzs_lu   = bzs;
                            model.p_bzp_lu   = bzp;
                            model.p_bzx_lu   = bzx;
                            model.p_id       = p_id;
                            model.p_ison     = 0;
                            model.p_basketve = 9;//半场标识

                            if (Convert.ToDateTime(model.p_TPRtime) <= DateTime.Now.AddHours(20))
                            {
                                TPR2.BLL.guess.BaList bll2 = new TPR2.BLL.guess.BaList();
                                if (!bll2.ExistsByp_id(p_id, 9))
                                {
                                    //是否先隐藏
                                    if (ub.GetSub("SiteIsyc", xmlPath) == "1")
                                    {
                                        model.p_del = 1;
                                    }
                                    else
                                    {
                                        model.p_del = 0;
                                    }
                                    bll2.Add(model);
                                }
                                else
                                {
                                    //bll2.UpdateFalf(model);
                                    if (fp1 == false)
                                    {
                                        new TPR2.BLL.guess.BaList().UpdateFalf1(model);
                                    }
                                    if (fp2 == false)
                                    {
                                        new TPR2.BLL.guess.BaList().UpdateFalf2(model);
                                    }
                                    if (fp3 == false)
                                    {
                                        new TPR2.BLL.guess.BaList().UpdateFalf3(model);
                                    }
                                }
                            }
                        }
                        #endregion
                    }
                }
                //================================这里半场更新==================================
                #endregion
            }
            #endregion

            #region 完场的数据
            if (strState == "完")
            {
                //取p_id
                int p_id = 0;
                strpattern = @"by=detail&amp;eid=(\d+).>析";
                mtitle     = Regex.Match(boTemp[i], strpattern, RegexOptions.IgnoreCase);
                if (mtitle.Success)
                {
                    p_id = Utils.ParseInt(mtitle.Groups[1].Value);
                    //Response.Write(p_id + "<br />");
                }

                #region 取主队名称 获取p_one
                //取主队名称
                string p_one = "";
                strpattern = @"<td class=""teamname"">([\s\S]+)<a href=""today.aspx";
                mtitle     = Regex.Match(boTemp[i], strpattern, RegexOptions.IgnoreCase);
                if (mtitle.Success)
                {
                    p_one = mtitle.Groups[1].Value.Trim();

                    //这里取主队红牌数量
                    if (boTemp[i].Contains("<td>↑滾球</td>"))
                    {
                        string strpatternHp = @"<span class=""rc"">(\d)</span>";
                        Match  mtitleHp     = Regex.Match(p_one, strpatternHp, RegexOptions.IgnoreCase);
                        if (mtitleHp.Success)
                        {
                            int hp_one = Utils.ParseInt(mtitleHp.Groups[1].Value);
                            if (hp_one > 0)
                            {
                                new TPR2.BLL.guess.BaList().Updatep_hp_one(p_id, hp_one);
                            }
                        }
                    }

                    p_one = Regex.Replace(p_one, @"<small>\[[\w\d]+\]</small>", "");
                    p_one = Regex.Replace(p_one, @"<span class=""rc"">[\w\d]+</span>", "");
                    p_one = Regex.Replace(p_one, @"<.+?>", "");
                    //Response.Write(p_one + "<br />");
                }
                #endregion

                #region 取客队名称 p_two
                //取客队名称
                string p_two = "";
                strpattern = @"<td>(\d){2}:(\d){2}</td><td class=""teamname"">([\s\S]+)</td></tr>";
                mtitle     = Regex.Match(boTemp[i], strpattern, RegexOptions.IgnoreCase);
                if (mtitle.Success)
                {
                    p_two = mtitle.Groups[0].Value.Trim();

                    //这里取客队红牌数量
                    string strpatternHp2 = @"<span class=""rc"">(\d)</span>";
                    Match  mtitleHp2     = Regex.Match(p_two, strpatternHp2, RegexOptions.IgnoreCase);
                    if (mtitleHp2.Success)
                    {
                        int hp_two = Utils.ParseInt(mtitleHp2.Groups[1].Value);
                        if (hp_two > 0)
                        {
                            new TPR2.BLL.guess.BaList().Updatep_hp_two(p_id, hp_two);
                        }
                    }

                    string[] p_twoTemp = Regex.Split(p_two, @"<tr class=""alternation"">");

                    p_two = Regex.Replace(p_twoTemp[0], @"<small>\[[\w\d]+\]</small>", "");
                    p_two = Regex.Replace(p_two, @"<span class=""rc"">[\w\d]+</span>", "");
                }
                else
                {
                    strpattern = @"<td>(\d){2}:(\d){2}</td><td class=""teamname"">([\s\S]+)</td></tr>";
                    mtitle     = Regex.Match(boTemp[i], strpattern, RegexOptions.IgnoreCase);
                    if (mtitle.Success)
                    {
                        p_two = mtitle.Groups[0].Value.Trim();

                        //这里取客队红牌数量
                        string strpatternHp2 = @"<span class=""rc"">(\d)</span>";
                        Match  mtitleHp2     = Regex.Match(p_two, strpatternHp2, RegexOptions.IgnoreCase);
                        if (mtitleHp2.Success)
                        {
                            int hp_two = Utils.ParseInt(mtitleHp2.Groups[1].Value);
                            if (hp_two > 0)
                            {
                                new TPR2.BLL.guess.BaList().Updatep_hp_two(p_id, hp_two);
                            }
                        }


                        string[] p_twoTemp = Regex.Split(p_two, @"<tr class=""alternation"">");

                        p_two = Regex.Replace(p_twoTemp[0], @"<small>\[[\w\d]+\]</small>", "");
                        p_two = Regex.Replace(p_two, @"<span class=""rc"">[\w\d]+</span>", "");
                        if (p_two.Contains("↑"))
                        {
                            p_two = Regex.Split(p_two, "↑")[0];
                        }
                    }
                }
                p_two = Regex.Replace(p_two, @"<td>(\d){2}:(\d){2}</td>", "");
                p_two = Regex.Replace(p_two, strpattern, "");
                p_two = Regex.Replace(p_two, @"<td>\(<em>((\d){1,2}-(\d){1,2})</em>\)</td>", "");
                p_two = Regex.Replace(p_two, @"<.+?>", "");
                if (p_two.Contains("↑"))
                {
                    p_two = Regex.Split(p_two, "↑")[0];
                }
                //Response.Write(p_two + "<br />");
                #endregion

                //这里即时完场比分
                string Result = "";
                strpattern = @"<b class=""score"">((\d){1,2}-(\d){1,2})</b>";
                mtitle     = Regex.Match(boTemp[i], strpattern, RegexOptions.IgnoreCase);
                if (mtitle.Success)
                {
                    Result = mtitle.Groups[1].Value;
                    if (Result.Contains("-"))
                    {
                        string[] p_result     = Result.Split('-');
                        int      p_result_one = Convert.ToInt32(p_result[0]);
                        int      p_result_two = Convert.ToInt32(p_result[1]);
                        new TPR2.BLL.guess.BaList().UpdateBoResult(p_id, p_result_one, p_result_two);
                    }
                }
                //更新比赛状态
                if (strState != "")
                {
                    new TPR2.BLL.guess.BaList().UpdateOnce(p_id, strState);
                }
            }
            #endregion

            #region 未完,更新分析链接 析
            if (strState != "未")
            {
                int Min = Utils.ParseInt(strState.Replace("+", "").Replace("'", ""));
                if (Min > 48 || strState == "完" || strState == "中")
                {
                    //这里即时半场比分
                    string Result = "";
                    strpattern = @"\(<em>((\d){1,2}-(\d){1,2})</em>\)";
                    mtitle     = Regex.Match(boTemp[i], strpattern, RegexOptions.IgnoreCase);
                    if (mtitle.Success)
                    {
                        Result = mtitle.Groups[1].Value;
                        if (Result.Contains("-"))
                        {
                            //取p_id
                            int p_id = 0;
                            strpattern = @"by=detail&amp;eid=(\d+).>析";
                            mtitle     = Regex.Match(boTemp[i], strpattern, RegexOptions.IgnoreCase);
                            if (mtitle.Success)
                            {
                                p_id = Utils.ParseInt(mtitle.Groups[1].Value);
                                //Response.Write(p_id + "<br />");
                            }

                            string[] p_result     = Result.Split('-');
                            int      p_result_one = Convert.ToInt32(p_result[0]);
                            int      p_result_two = Convert.ToInt32(p_result[1]);
                            new TPR2.BLL.guess.BaList().UpdateBoResult(9, p_id, p_result_one, p_result_two);
                        }
                    }
                }
            }
            #endregion
            builder.Append(DateTime.Now.ToString("yyyyMMddHHmmss-fff" + "<br />"));
        }

        #region 采集足球赛事 提示
        Master.Title = "采集足球赛事";
        if (bo.Contains("#NEXT#"))
        {
            Master.Refresh = 10;
            Response.Redirect(Utils.getUrl("boCollec.aspx?k=" + (k + 1) + ""));
            Master.Gourl = Utils.getUrl("boCollec.aspx?k=" + (k + 1) + "");
            builder.Append("第" + k + "页采集结束,正在采集第" + (k + 1) + "页");
        }
        else
        {
            Master.Refresh = 10;
            Master.Gourl   = Utils.getUrl("boCollec.aspx");
            builder.Append("第" + k + "页采集结束,正在循环到第1页");
        }
        #endregion
    }