Esempio n. 1
0
 public void CrawlGolfBettingMarketName()
 {
     string url = "";
     string htmlcontent = Helper.GetWebSiteContent(url);
     HtmlAgilityPack.HtmlDocument doc = Helper.LoadHtml(htmlcontent);
     XmlDocument xmldoc = new XmlDocument();
     CrawlAllMarketsData crawldata = new CrawlAllMarketsData();
     var row11 = doc.DocumentNode.SelectSingleNode("//ul[@class='more-outrights 1']");
     var rows = row11.SelectNodes("./a");
     if (rows != null)
     {
         List<MarketMaster> lit = new List<MarketMaster>();
         for (int i = 0; i < rows.Count; i++)
         {
             MarketMaster market = new MarketMaster();
             string li = rows[i].InnerText;
             var linkrow = rows[i].SelectNodes("./span");
             market.MarketMarketName = linkrow[0].InnerText;
             market.MarketResultLink = "http://www.oddschecker.com" + rows[0].Attributes["href"].Value;
             market.MarketSportID = 29;
             InsertMasterMarket(market);
             lit.Add(market);
         }
         xmldoc = GenerateXmlGolfMarketMaster(lit);
     }
 }
Esempio n. 2
0
      /// <summary>
 /// dev
 /// </summary>
 /// <param name="marketid"></param>
 /// <returns></returns>
 /// 
 public void InsertMasterMarket(MarketMaster market)
 {
     using (SqlConnection objConn = new SqlConnection(OddsConnection.GetConnectionString()))
     {
         objConn.Open();
         SqlCommand cmd = new SqlCommand("sp_MasterMarket", objConn);
         cmd.Parameters.AddWithValue("@SportID", market.MarketSportID);
         cmd.Parameters.AddWithValue("@ResultName", market.MarketMarketName);
         cmd.Parameters.AddWithValue("@ResultLink", market.MarketResultLink);
         cmd.Parameters.AddWithValue("@Mode", "Insert");
         cmd.ExecuteNonQuery();
         objConn.Close();
         cmd.Dispose();
     }
 }