コード例 #1
0
 public void GetBetLiveData(string date, int companyid)
 {
     try
     {
         NowGoalBLL bll = new NowGoalBLL();
         StringJSON = bll.GetBetLiveData(date, companyid);
     }
     catch (Exception e)
     {
         System.Diagnostics.Debug.Write(e);
         throw;
     }
 }
コード例 #2
0
ファイル: GetOdds1x2.aspx.cs プロジェクト: opo30/bet-helper
 public void GetOdds1x2(string scheduleID)
 {
     try
     {
         NowGoalBLL bll = new NowGoalBLL();
         StringJSON = bll.GetOdds1x2(scheduleID);
     }
     catch (Exception e)
     {
         System.Diagnostics.Debug.Write(e);
         throw;
     }
 }
コード例 #3
0
 public void GetOddsDetail(string scheduleID, string companyID)
 {
     try
     {
         NowGoalBLL bll = new NowGoalBLL();
         StringJSON = bll.GetOddsDetail(scheduleID, companyID, "undefined");
     }
     catch (Exception e)
     {
         System.Diagnostics.Debug.Write(e);
         throw;
     }
 }
コード例 #4
0
 public void GetOddsDetailInfo()
 {
     try
     {
         NowGoalBLL bll        = new NowGoalBLL();
         string     scheduleID = Request.Form["scheduleID"];
         string     companyID  = Request.Form["companyID"];
         string     dateStr    = Request.Form["date"];
         StringJSON = bll.GetOddsDetail(scheduleID, companyID, dateStr);
     }
     catch (Exception e)
     {
         System.Diagnostics.Debug.Write(e);
         throw;
     }
 }
コード例 #5
0
 public void GetPrediction(string scheduleID, string goalNum)
 {
     try
     {
         NowGoalBLL bll = new NowGoalBLL();
         if (goalNum == null)
         {
             StringJSON = bll.GetPrediction(scheduleID);
         }
         else
         {
             StringJSON = bll.GetPrediction(scheduleID, float.Parse(goalNum));
         }
     }
     catch (Exception e)
     {
         System.Diagnostics.Debug.Write(e);
         throw;
     }
 }
コード例 #6
0
ファイル: Server.aspx.cs プロジェクト: opo30/bet-helper
    private void updateOdds()
    {
        //SeoWebSite.BLL.odds_bz odds_bzBLL = new SeoWebSite.BLL.odds_bz();
        //SeoWebSite.BLL.odds_rq odds_rqBLL = new SeoWebSite.BLL.odds_rq();
        //SeoWebSite.BLL.odds_dx odds_dxBLL = new SeoWebSite.BLL.odds_dx();
        //SeoWebSite.BLL.Company companyBLL = new SeoWebSite.BLL.Company();
        NowGoalBLL   nowGoalBLL   = new NowGoalBLL();
        WebClientBLL webClientBLL = new WebClientBLL();

        try
        {
            //if (Request["scheduleid"] != null && Request["companyid"] != null)
            //{
            //    string scheduleid = Request.Form["scheduleid"];
            //    string companyid = Request.Form["companyid"];
            //    string[] paramArr = { companyid, scheduleid };
            //    string s = webClientBLL.GetRemoteHtml("odds/detail.aspx?companyID={0}&scheduleid={1}", paramArr);
            //    if (string.IsNullOrEmpty(s))
            //    {
            //        scheduleBLL.Delete(int.Parse(scheduleid));
            //        JsonStr = "{success:false,message:'已删除错误的比赛数据'}";
            //    }
            //    Parser parser = Parser.CreateParser(s, "utf-8");
            //    AndFilter andFilter = new AndFilter(new TagNameFilter("table"), new HasAttributeFilter("bgColor", "#bbbbbb"));
            //    NodeList tableList = parser.ExtractAllNodesThatMatch(andFilter);
            //    parser = Parser.CreateParser(s, "utf-8");
            //    NodeList h3tag = parser.ExtractAllNodesThatMatch(new TagNameFilter("h3"));
            //    string year = h3tag[0].ToPlainTextString().Remove(5);
            //    if (tableList.Count == 3)
            //    {
            //        odds_rqBLL.Delete(companyid, scheduleid);
            //        odds_bzBLL.Delete(companyid, scheduleid);
            //        odds_dxBLL.Delete(companyid, scheduleid);
            //        AndFilter andFilter1 = new AndFilter(new TagNameFilter("tr"), new HasAttributeFilter("class", "ts1"));
            //        #region 让球盘
            //        NodeList list = tableList[0].Children.ExtractAllNodesThatMatch(andFilter1);
            //        for (int i = 0; i < list.Count; i++)
            //        {
            //            NodeList tdList = list[i].Children.SearchFor(typeof(Winista.Text.HtmlParser.Tags.TableColumn));
            //            string pankou = CommonHelper.GoalCnToGoal(tdList[1].ToPlainTextString());
            //            if (!string.IsNullOrEmpty(pankou))
            //            {
            //                SeoWebSite.Model.odds_rq model = new SeoWebSite.Model.odds_rq();
            //                model.scheduleID = int.Parse(scheduleid);
            //                model.companyID = int.Parse(companyid);
            //                model.home = decimal.Parse(tdList[0].ToPlainTextString());
            //                model.pankou = decimal.Parse(pankou);
            //                model.away = decimal.Parse(tdList[2].ToPlainTextString());
            //                model.time = DateTime.Parse(year + "-" + tdList[3].ToPlainTextString().Replace("早餐", ""));
            //                odds_rqBLL.Add(model);
            //            }
            //        }
            //        #endregion
            //        #region 标准盘
            //        list = tableList[1].Children.ExtractAllNodesThatMatch(andFilter1);
            //        for (int i = 0; i < list.Count; i++)
            //        {
            //            NodeList tdList = list[i].Children.SearchFor(typeof(Winista.Text.HtmlParser.Tags.TableColumn));
            //            SeoWebSite.Model.odds_bz model = new SeoWebSite.Model.odds_bz();
            //            model.scheduleID = int.Parse(scheduleid);
            //            model.companyID = int.Parse(companyid);
            //            model.home = decimal.Parse(tdList[0].ToPlainTextString());
            //            model.draw = decimal.Parse(tdList[1].ToPlainTextString());
            //            model.away = decimal.Parse(tdList[2].ToPlainTextString());
            //            model.time = DateTime.Parse(year + "-" + tdList[3].ToPlainTextString().Replace("早餐", ""));
            //            odds_bzBLL.Add(model);
            //        }
            //        #endregion
            //        #region 大小盘
            //        list = tableList[2].Children.ExtractAllNodesThatMatch(andFilter1);
            //        for (int i = 0; i < list.Count; i++)
            //        {
            //            NodeList tdList = list[i].Children.SearchFor(typeof(Winista.Text.HtmlParser.Tags.TableColumn));
            //            string pankou = CommonHelper.BallSizeToBall(tdList[1].ToPlainTextString());
            //            if (!string.IsNullOrEmpty(pankou))
            //            {
            //                SeoWebSite.Model.odds_dx model = new SeoWebSite.Model.odds_dx();
            //                model.scheduleID = int.Parse(scheduleid);
            //                model.companyID = int.Parse(companyid);
            //                model.big = decimal.Parse(tdList[0].ToPlainTextString());
            //                model.pankou = decimal.Parse(pankou);
            //                model.small = decimal.Parse(tdList[2].ToPlainTextString());
            //                model.time = DateTime.Parse(year + "-" + tdList[3].ToPlainTextString().Replace("早餐", ""));
            //                odds_dxBLL.Add(model);
            //            }
            //        }
            //        #endregion
            //    }
            //    JsonStr = "{success:true}";
            //}
            if (Request["scheduleid"] != null && !string.IsNullOrEmpty(Request.Form["scheduleid"]))
            {
                nowGoalBLL.updateOdds1x2(Request.Form["scheduleid"]);
                scheduleBLL.SetUpdated(Request.Form["scheduleid"], true);
                JsonStr = "{success:true}";
            }
            else
            {
                JsonStr = "{success:false,message:'请求数据异常!'}";
            }
        }
        catch (Exception e)
        {
            JsonStr = "{success:false,message:'" + e.Message + "'}";
        }
    }