Example #1
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(BCW.JQC.Model.JQC_Internet model)
 {
     return(dal.Add(model));
 }
Example #2
0
 //====================================
 /// <summary>
 /// me_更新一条数据
 /// </summary>
 public void Update_ht(BCW.JQC.Model.JQC_Internet model)
 {
     dal.Update_ht(model);
 }
Example #3
0
    protected long jqcFour  = Convert.ToInt64(ub.GetSub("jqcFour", "/Controls/jqc.xml"));            //4等奖

    protected void Page_Load(object sender, EventArgs e)
    {
        System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
        stopwatch.Start();
        //抓取
        List <Matchs> list = new List <Matchs>();

        try
        {
            list = TranList();
        }
        catch
        {
            Response.Write("抓取失败,error1.");
            Response.Close();
        }
        list.Reverse();//集合反序
        foreach (Matchs a in list)
        {
            if (!new BCW.JQC.BLL.JQC_Internet().Exists_phase(int.Parse(a.phase)))
            {
                #region 判断数据库最新一期是否存在,不存在,自动添加
                string Match      = string.Empty; //赛事
                string Team_Home  = string.Empty; //主队
                string Team_Away  = string.Empty; //客队
                string Start_Time = string.Empty; //比赛时间
                string Score      = string.Empty; //比赛比分
                int    i          = 1;
                BCW.JQC.Model.JQC_Internet model = new BCW.JQC.Model.JQC_Internet();
                model.phase = int.Parse(a.phase);
                foreach (Matchs2 b in a.listMatch)
                {
                    if (i == 4)
                    {
                        Match      = Match + b.match;
                        Team_Home  = Team_Home + b.team_home;
                        Team_Away  = Team_Away + b.team_away;
                        Start_Time = Start_Time + b.start_time;
                        Score      = Score + b.score;
                    }
                    else
                    {
                        Match      = Match + b.match + ",";
                        Team_Home  = Team_Home + b.team_home + ",";
                        Team_Away  = Team_Away + b.team_away + ",";
                        Start_Time = Start_Time + b.start_time + ",";
                        Score      = Score + b.score + "#";
                    }
                    i++;
                }
                model.Match      = Match;      //赛事
                model.Team_Home  = Team_Home;  //主队
                model.Team_Away  = Team_Away;  //客队
                model.Start_Time = Start_Time; //比赛时间
                model.Score      = Score;      //比赛比分
                model.Result     = a.result;   //比赛结果


                if (a.sale_start != "")
                {
                    model.Sale_Start = Convert.ToDateTime(a.sale_start);
                    model.Sale_End   = Convert.ToDateTime(a.sale_end);
                    new BCW.JQC.BLL.JQC_Internet().Add(model);
                    Response.Write("添加最新期数成功.JQCok1<br/>");
                }
                else
                {
                    //邵广林 20161007 修改没开售时间都添加到数据库
                    model.Sale_Start = DateTime.Now.AddYears(-1);
                    model.Sale_End   = DateTime.Now.AddYears(-1);
                    new BCW.JQC.BLL.JQC_Internet().Add(model);
                    //通知系统管理员,存进了无销售时间的一期
                    new BCW.BLL.Guest().Add(1, 52784, new BCW.BLL.User().GetUsName(52784), "进球彩存进没有销售时间的一期,期号" + a.phase + ".请到后台查看.");
                    Response.Write("添加最新期数成功.【但没有销售时间.】JQCok1<br/>");
                    //Response.Write("最新期数[" + a.phase + "]已出.等待加入.JQCok1<br/>");
                }
                #endregion
            }
            else
            {
                if (!new BCW.JQC.BLL.JQC_Internet().Exists_Result(int.Parse(a.phase)))
                {
                    #region 若存在,则判断是否开奖
                    string Match      = string.Empty; //赛事
                    string Team_Home  = string.Empty; //主队
                    string Team_Away  = string.Empty; //客队
                    string Start_Time = string.Empty; //比赛时间
                    string Score      = string.Empty; //比赛比分
                    int    i          = 1;
                    foreach (Matchs2 b in a.listMatch)
                    {
                        if (i == 4)
                        {
                            Match      = Match + b.match;
                            Team_Home  = Team_Home + b.team_home;
                            Team_Away  = Team_Away + b.team_away;
                            Start_Time = Start_Time + b.start_time;
                            Score      = Score + b.score;
                        }
                        else
                        {
                            Match      = Match + b.match + ",";
                            Team_Home  = Team_Home + b.team_home + ",";
                            Team_Away  = Team_Away + b.team_away + ",";
                            Start_Time = Start_Time + b.start_time + ",";
                            Score      = Score + b.score + "#";
                        }
                        i++;
                    }
                    //判断是否有不足信息的球队,不足则添加信息
                    BCW.JQC.Model.JQC_Internet hj = new BCW.JQC.BLL.JQC_Internet().Get_kainum(int.Parse(a.phase));
                    try
                    {
                        string[] sNum = hj.Match.Split(',');
                        if (sNum.Length < 4)
                        {
                            new BCW.JQC.BLL.JQC_Internet().Update_Result("Match='" + Match + "',Team_Home='" + Team_Home + "',Team_Away='" + Team_Away + "',Start_Time='" + Start_Time + "'", "phase='" + a.phase + "'");
                            Response.Write("" + a.phase + "期信息已补录成功.<br/>");
                        }
                        if (a.sale_start != "")
                        {
                            new BCW.JQC.BLL.JQC_Internet().Update_Result("Sale_Start='" + a.sale_start + "',Sale_End='" + a.sale_end + "'", "phase='" + a.phase + "'");
                        }
                    }
                    catch { }
                    if (a.result != null)//如果有开奖结果,即兑奖
                    {
                        if (a.sale_start != "")
                        {
                            new BCW.JQC.BLL.JQC_Internet().Update_Result("Sale_Start='" + a.sale_start + "',Sale_End='" + a.sale_end + "'", "phase='" + a.phase + "'");
                        }
                        new BCW.JQC.BLL.JQC_Internet().Update_Result("Result='" + a.result + "',Score='" + Score + "'", "phase='" + a.phase + "'");
                        Open_price(a.phase);//兑奖
                    }
                    else//没有开奖结果,则更新比分
                    {
                        new BCW.JQC.BLL.JQC_Internet().Update_Result("Score='" + Score + "'", "phase='" + a.phase + "'");
                        if (a.sale_start != "")
                        {
                            new BCW.JQC.BLL.JQC_Internet().Update_Result("Sale_Start='" + a.sale_start + "',Sale_End='" + a.sale_end + "'", "phase='" + a.phase + "'");
                        }
                        Response.Write("" + a.phase + "期等待开奖.ok1<br/>");
                    }
                    #endregion
                }
                else
                {
                    Response.Write("" + a.phase + "期已获取.ok1<br/>");
                }
            }
        }
        //系统收回过期未兑奖
        new BCW.JQC.BLL.JQC_Bet().update_GetMoney("State=2", "GetMoney>0 and Input_Time<DateAdd(dd,-" + date_1 + ",getdate())");
        //机器人兑奖
        Robot_case();
        stopwatch.Stop();
        Response.Write("<font color=\"red\">" + "<br/>刷新总耗时:" + stopwatch.Elapsed.TotalSeconds + "秒</font><br/>");
    }