private void DisplayWinMoneyList() { winMoneyList.Clear(); using (SqlConnection con = DBConnection.Connecting()) { con.Open(); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "SelectWinMoney"; SqlDataReader sdr = cmd.ExecuteReader(); while (sdr.Read()) { WinMoney winMoney = new WinMoney(); winMoney.Turnnumber = Int32.Parse(sdr["turnnumber"].ToString()); winMoney.Win1 = long.Parse(sdr["win1"].ToString()); winMoney.Win2 = long.Parse(sdr["win2"].ToString()); winMoney.Win3 = long.Parse(sdr["win3"].ToString()); winMoney.Win4 = long.Parse(sdr["win4"].ToString()); winMoney.Win5 = long.Parse(sdr["win5"].ToString()); winMoneyList.Add(winMoney); // } } }
private void ParsingWinNum(HtmlAgilityPack.HtmlDocument htmlDoc) { int i; long[] temp = new long[5]; WinMoney winMoney = new WinMoney(); i = 0; foreach (HtmlNode item in htmlDoc.DocumentNode.SelectNodes("//body//div/section//div//div/div//table//tbody//tr")) { temp[i] = long.Parse(item.ChildNodes[7].InnerText.Substring(0, item.ChildNodes[7].InnerText.Length - 1).Replace(",", "")); i++; } foreach (var item in htmlDoc.DocumentNode.SelectNodes("//body//h4//strong")) { winMoney.Turnnumber = Int32.Parse(item.InnerText.Remove(item.InnerText.Length - 1, 1)); } winMoney.Win1 = temp[0]; winMoney.Win2 = temp[1]; winMoney.Win3 = temp[2]; winMoney.Win4 = temp[3]; winMoney.Win5 = temp[4]; winMoneyList.Add(winMoney); }