protected void Page_Load(object sender, EventArgs e) { string URL_MatchListAPI = "http://i.sporttery.cn/odds_calculator/get_odds?i_format=json&poolcode[]=hhad"; string ret = HttpResponse.GetHttpResponseJson(URL_MatchListAPI, null); //string ret = "{\"data\":{\"_111355\":{\"id\":\"111355\",\"num\":\"\\u5468\\u4e00002\",\"date\":\"2018-09-24\",\"time\":\"23:30:00\",\"b_date\":\"2018-09-24\",\"status\":\"Selling\",\"hot\":\"0\",\"l_id\":\"100\",\"l_cn\":\"\\u4fc4\\u7f57\\u65af\\u8d85\\u7ea7\\u8054\\u8d5b\",\"h_id\":\"711\",\"h_cn\":\"\\u82cf\\u7ef4\\u57c3\\u4e4b\\u7ffc\",\"a_id\":\"1996\",\"a_cn\":\"\\u514b\\u62c9\\u65af\\u8bfa\\u8fbe\\u5c14\",\"index_show\":\"0\",\"show\":\"1\",\"hhad\":{\"a\":\"3.55\",\"d\":\"3.25\",\"h\":\"1.85\",\"goalline\":\"\",\"p_code\":\"HHAD\",\"o_type\":\"F\",\"p_id\":\"498443\",\"p_status\":\"Selling\",\"single\":\"0\",\"allup\":\"1\",\"fixedodds\":\"+1\",\"cbt\":\"1\",\"int\":\"1\",\"vbt\":\"0\",\"h_trend\":\"0\",\"a_trend\":\"0\",\"d_trend\":\"0\",\"l_trend\":\"0\"},\"l_cn_abbr\":\"\\u4fc4\\u8d85\",\"h_cn_abbr\":\"\\u82cf\\u7ef4\\u57c3\\u7ffc\",\"a_cn_abbr\":\"\\u514b\\u62c9\\u65af\\u8bfa\",\"h_order\":\"[\\u4fc4\\u8d8513]\",\"a_order\":\"[\\u4fc4\\u8d854]\",\"h_id_dc\":\"1848\",\"a_id_dc\":\"10610\",\"l_background_color\":\"336699\",\"weather\":\"\\u5929\\u6674\",\"weather_city\":\"\\u8428\\u9a6c\\u62c9|\",\"temperature\":\"20°\",\"weather_pic\":\"http:\\/\\/static.sporttery.cn\\/www\\/images\\/weather_logo\\/sunny.png\",\"match_info\":[]},\"_111356\":{\"id\":\"111356\",\"num\":\"\\u5468\\u4e00003\",\"date\":\"2018-09-25\",\"time\":\"01:00:00\",\"b_date\":\"2018-09-24\",\"status\":\"Selling\",\"hot\":\"0\",\"l_id\":\"58\",\"l_cn\":\"\\u745e\\u5178\\u8d85\\u7ea7\\u8054\\u8d5b\",\"h_id\":\"604\",\"h_cn\":\"\\u8d6b\\u6839\",\"a_id\":\"600\",\"a_cn\":\"IFK\\u54e5\\u5fb7\\u5821\",\"index_show\":\"0\",\"show\":\"1\",\"hhad\":{\"a\":\"2.41\",\"d\":\"3.45\",\"h\":\"2.36\",\"goalline\":\"\",\"p_code\":\"HHAD\",\"o_type\":\"F\",\"p_id\":\"498118\",\"p_status\":\"Selling\",\"single\":\"0\",\"allup\":\"1\",\"fixedodds\":\"-1\",\"cbt\":\"1\",\"int\":\"1\",\"vbt\":\"0\",\"h_trend\":\"0\",\"a_trend\":\"0\",\"d_trend\":\"0\",\"l_trend\":\"0\"},\"l_cn_abbr\":\"\\u745e\\u8d85\",\"h_cn_abbr\":\"\\u8d6b\\u6839\",\"a_cn_abbr\":\"\\u54e5\\u5fb7\\u5821\",\"h_order\":\"[\\u745e\\u8d858]\",\"a_order\":\"[\\u745e\\u8d8511]\",\"h_id_dc\":\"2398\",\"a_id_dc\":\"2149\",\"l_background_color\":\"004488\",\"weather\":\"\\u5929\\u6674\",\"weather_city\":\"\",\"temperature\":\"8°\",\"weather_pic\":\"http:\\/\\/static.sporttery.cn\\/www\\/images\\/weather_logo\\/sunny.png\",\"match_info\":[]},\"_111357\":{\"id\":\"111357\",\"num\":\"\\u5468\\u4e00004\",\"date\":\"2018-09-25\",\"time\":\"01:00:00\",\"b_date\":\"2018-09-24\",\"status\":\"Selling\",\"hot\":\"0\",\"l_id\":\"51\",\"l_cn\":\"\\u632a\\u5a01\\u8d85\\u7ea7\\u8054\\u8d5b\",\"h_id\":\"619\",\"h_cn\":\"\\u5229\\u52d2\\u65af\\u7279\\u7f57\\u59c6\",\"a_id\":\"617\",\"a_cn\":\"\\u7279\\u7f57\\u59c6\\u745f\",\"index_show\":\"0\",\"show\":\"1\",\"hhad\":{\"a\":\"1.83\",\"d\":\"3.65\",\"h\":\"3.25\",\"goalline\":\"\",\"p_code\":\"HHAD\",\"o_type\":\"F\",\"p_id\":\"498123\",\"p_status\":\"Selling\",\"single\":\"0\",\"allup\":\"1\",\"fixedodds\":\"-1\",\"cbt\":\"1\",\"int\":\"1\",\"vbt\":\"0\",\"h_trend\":\"0\",\"a_trend\":\"0\",\"d_trend\":\"0\",\"l_trend\":\"0\"},\"l_cn_abbr\":\"\\u632a\\u8d85\",\"h_cn_abbr\":\"\\u5229\\u52d2\\u65af\\u7279\",\"a_cn_abbr\":\"\\u7279\\u7f57\\u59c6\\u745f\",\"h_order\":\"[\\u632a\\u8d8515]\",\"a_order\":\"[\\u632a\\u8d8510]\",\"h_id_dc\":\"1592\",\"a_id_dc\":\"1585\",\"l_background_color\":\"666666\",\"weather\":\"\\u672a\\u77e5\",\"weather_city\":\"\",\"temperature\":\"\",\"match_info\":[]},\"_111358\":{\"id\":\"111358\",\"num\":\"\\u5468\\u4e00005\",\"date\":\"2018-09-25\",\"time\":\"02:45:00\",\"b_date\":\"2018-09-24\",\"status\":\"Selling\",\"hot\":\"0\",\"l_id\":\"81\",\"l_cn\":\"\\u6cd5\\u56fd\\u4e59\\u7ea7\\u8054\\u8d5b\",\"h_id\":\"867\",\"h_cn\":\"\\u5c3c\\u5965\\u5c14\",\"a_id\":\"179\",\"a_cn\":\"\\u6717\\u65af\",\"index_show\":\"0\",\"show\":\"1\",\"hhad\":{\"a\":\"4.90\",\"d\":\"3.62\",\"h\":\"1.54\",\"goalline\":\"\",\"p_code\":\"HHAD\",\"o_type\":\"F\",\"p_id\":\"498128\",\"p_status\":\"Selling\",\"single\":\"0\",\"allup\":\"1\",\"fixedodds\":\"+1\",\"cbt\":\"1\",\"int\":\"1\",\"vbt\":\"0\",\"h_trend\":\"0.02\",\"a_trend\":\"-0.15\",\"d_trend\":\"-0.03\",\"l_trend\":\"0\"},\"l_cn_abbr\":\"\\u6cd5\\u4e59\",\"h_cn_abbr\":\"\\u5c3c\\u5965\\u5c14\",\"a_cn_abbr\":\"\\u6717\\u65af\",\"h_order\":\"[\\u6cd5\\u4e596]\",\"a_order\":\"[\\u6cd5\\u4e594]\",\"h_id_dc\":\"909\",\"a_id_dc\":\"892\",\"l_background_color\":\"5BC992\",\"weather\":\"\\u672a\\u77e5\",\"weather_city\":\"\",\"temperature\":\"10°\",\"match_info\":[]},\"_111359\":{\"id\":\"111359\",\"num\":\"\\u5468\\u4e00006\",\"date\":\"2018-09-25\",\"time\":\"03:15:00\",\"b_date\":\"2018-09-24\",\"status\":\"Selling\",\"hot\":\"0\",\"l_id\":\"55\",\"l_cn\":\"\\u8461\\u8404\\u7259\\u8d85\\u7ea7\\u8054\\u8d5b\",\"h_id\":\"269\",\"h_cn\":\"\\u5e03\\u62c9\\u52a0\",\"a_id\":\"1060\",\"a_cn\":\"\\u91cc\\u65af\\u672c\\u7ade\\u6280\",\"index_show\":\"0\",\"show\":\"1\",\"hhad\":{\"a\":\"1.46\",\"d\":\"3.95\",\"h\":\"5.22\",\"goalline\":\"\",\"p_code\":\"HHAD\",\"o_type\":\"F\",\"p_id\":\"498448\",\"p_status\":\"Selling\",\"single\":\"0\",\"allup\":\"1\",\"fixedodds\":\"-1\",\"cbt\":\"1\",\"int\":\"1\",\"vbt\":\"0\",\"h_trend\":\"0\",\"a_trend\":\"0\",\"d_trend\":\"0\",\"l_trend\":\"0\"},\"l_cn_abbr\":\"\\u8461\\u8d85\",\"h_cn_abbr\":\"\\u5e03\\u62c9\\u52a0\",\"a_cn_abbr\":\"\\u91cc\\u65af\\u672c\",\"h_order\":\"[\\u8461\\u8d853]\",\"a_order\":\"[\\u8461\\u8d854]\",\"h_id_dc\":\"1682\",\"a_id_dc\":\"1680\",\"l_background_color\":\"008888\",\"weather\":\"\\u5929\\u6674\",\"weather_city\":\"\",\"temperature\":\"20°\",\"weather_pic\":\"http:\\/\\/static.sporttery.cn\\/www\\/images\\/weather_logo\\/sunny.png\",\"match_info\":[]},\"_111360\":{\"id\":\"111360\",\"num\":\"\\u5468\\u4e00007\",\"date\":\"2018-09-25\",\"time\":\"05:00:00\",\"b_date\":\"2018-09-24\",\"status\":\"Selling\",\"hot\":\"0\",\"l_id\":\"77\",\"l_cn\":\"\\u963f\\u6839\\u5ef7\\u7532\\u7ea7\\u8054\\u8d5b\",\"h_id\":\"2126\",\"h_cn\":\"\\u963f\\u5c14\\u591a\\u897f\\u7ef4\",\"a_id\":\"1575\",\"a_cn\":\"\\u8d1d\\u5c14\\u683c\\u62c9\\u8bfa\",\"index_show\":\"0\",\"show\":\"1\",\"hhad\":{\"a\":\"1.43\",\"d\":\"3.75\",\"h\":\"6.10\",\"goalline\":\"\",\"p_code\":\"HHAD\",\"o_type\":\"F\",\"p_id\":\"498453\",\"p_status\":\"Selling\",\"single\":\"0\",\"allup\":\"1\",\"fixedodds\":\"-1\",\"cbt\":\"1\",\"int\":\"1\",\"vbt\":\"0\",\"h_trend\":\"0\",\"a_trend\":\"0\",\"d_trend\":\"0\",\"l_trend\":\"0\"},\"l_cn_abbr\":\"\\u963f\\u7532\",\"h_cn_abbr\":\"\\u963f\\u591a\\u897f\\u7ef4\",\"a_cn_abbr\":\"\\u8d1d\\u683c\\u62c9\\u8bfa\",\"h_order\":\"[\\u963f\\u753210]\",\"a_order\":\"[\\u963f\\u753214]\",\"h_id_dc\":\"5030\",\"a_id_dc\":\"114\",\"l_background_color\":\"0CB9E4\",\"weather\":\"\\u5929\\u6674\",\"weather_city\":\"\\u9a6c\\u5fb7\\u666e\\u62c9\\u5854|ht\",\"temperature\":\"8°\",\"weather_pic\":\"http:\\/\\/static.sporttery.cn\\/www\\/images\\/weather_logo\\/sunny.png\",\"match_info\":[]},\"_111361\":{\"id\":\"111361\",\"num\":\"\\u5468\\u4e00008\",\"date\":\"2018-09-25\",\"time\":\"07:00:00\",\"b_date\":\"2018-09-24\",\"status\":\"Selling\",\"hot\":\"0\",\"l_id\":\"6\",\"l_cn\":\"\\u5df4\\u897f\\u7532\\u7ea7\\u8054\\u8d5b\",\"h_id\":\"584\",\"h_cn\":\"\\u74e6\\u65af\\u79d1\\u8fbe\\u4f3d\\u9a6c\",\"a_id\":\"1558\",\"a_cn\":\"\\u5df4\\u4f0a\\u4e9a\",\"index_show\":\"0\",\"show\":\"1\",\"hhad\":{\"a\":\"1.71\",\"d\":\"3.35\",\"h\":\"4.06\",\"goalline\":\"\",\"p_code\":\"HHAD\",\"o_type\":\"F\",\"p_id\":\"498133\",\"p_status\":\"Selling\",\"single\":\"0\",\"allup\":\"1\",\"fixedodds\":\"-1\",\"cbt\":\"1\",\"int\":\"1\",\"vbt\":\"0\",\"h_trend\":\"0\",\"a_trend\":\"0\",\"d_trend\":\"0\",\"l_trend\":\"0\"},\"l_cn_abbr\":\"\\u5df4\\u7532\",\"h_cn_abbr\":\"\\u8fbe\\u4f3d\\u9a6c\",\"a_cn_abbr\":\"\\u5df4\\u4f0a\\u4e9a\",\"h_order\":\"[\\u5df4\\u753218]\",\"a_order\":\"[\\u5df4\\u753215]\",\"h_id_dc\":\"321\",\"a_id_dc\":\"341\",\"l_background_color\":\"DDDD00\",\"weather\":\"\\u672a\\u77e5\",\"weather_city\":\"\",\"temperature\":\"\",\"match_info\":[]},\"_111362\":{\"id\":\"111362\",\"num\":\"\\u5468\\u4e00009\",\"date\":\"2018-09-25\",\"time\":\"07:00:00\",\"b_date\":\"2018-09-24\",\"status\":\"Selling\",\"hot\":\"0\",\"l_id\":\"6\",\"l_cn\":\"\\u5df4\\u897f\\u7532\\u7ea7\\u8054\\u8d5b\",\"h_id\":\"1947\",\"h_cn\":\"\\u6c99\\u4f69\\u79d1\\u6069\\u65af\",\"a_id\":\"572\",\"a_cn\":\"\\u5f17\\u9c81\\u7c73\\u5ae9\\u585e\",\"index_show\":\"0\",\"show\":\"1\",\"hhad\":{\"a\":\"1.80\",\"d\":\"3.20\",\"h\":\"3.85\",\"goalline\":\"\",\"p_code\":\"HHAD\",\"o_type\":\"F\",\"p_id\":\"498138\",\"p_status\":\"Selling\",\"single\":\"0\",\"allup\":\"1\",\"fixedodds\":\"-1\",\"cbt\":\"1\",\"int\":\"1\",\"vbt\":\"0\",\"h_trend\":\"0\",\"a_trend\":\"0\",\"d_trend\":\"0\",\"l_trend\":\"0\"},\"l_cn_abbr\":\"\\u5df4\\u7532\",\"h_cn_abbr\":\"\\u6c99\\u4f69\\u79d1\",\"a_cn_abbr\":\"\\u5f17\\u9c81\\u7c73\\u5ae9\",\"h_order\":\"[\\u5df4\\u753216]\",\"a_order\":\"[\\u5df4\\u753213]\",\"h_id_dc\":\"6223\",\"a_id_dc\":\"312\",\"l_background_color\":\"DDDD00\",\"weather\":\"\\u672a\\u77e5\",\"weather_city\":\"\",\"temperature\":\"\",\"match_info\":[]},\"_111363\":{\"id\":\"111363\",\"num\":\"\\u5468\\u4e00010\",\"date\":\"2018-09-25\",\"time\":\"07:00:00\",\"b_date\":\"2018-09-24\",\"status\":\"Selling\",\"hot\":\"0\",\"l_id\":\"77\",\"l_cn\":\"\\u963f\\u6839\\u5ef7\\u7532\\u7ea7\\u8054\\u8d5b\",\"h_id\":\"1328\",\"h_cn\":\"\\u7ade\\u6280\\u4ff1\\u4e50\\u90e8\",\"a_id\":\"1573\",\"a_cn\":\"\\u5723\\u83f2\\u8054\\u5408\",\"index_show\":\"0\",\"show\":\"1\",\"hhad\":{\"a\":\"2.07\",\"d\":\"3.20\",\"h\":\"3.00\",\"goalline\":\"\",\"p_code\":\"HHAD\",\"o_type\":\"F\",\"p_id\":\"498458\",\"p_status\":\"Selling\",\"single\":\"0\",\"allup\":\"1\",\"fixedodds\":\"-1\",\"cbt\":\"1\",\"int\":\"1\",\"vbt\":\"0\",\"h_trend\":\"0\",\"a_trend\":\"0\",\"d_trend\":\"0\",\"l_trend\":\"0\"},\"l_cn_abbr\":\"\\u963f\\u7532\",\"h_cn_abbr\":\"\\u7ade\\u6280\",\"a_cn_abbr\":\"\\u5723\\u83f2\\u8054\\u5408\",\"h_order\":\"[\\u963f\\u75322]\",\"a_order\":\"[\\u963f\\u75329]\",\"h_id_dc\":\"106\",\"a_id_dc\":\"131\",\"l_background_color\":\"0CB9E4\",\"weather\":\"\\u5929\\u6674\",\"weather_city\":\"\",\"temperature\":\"16°\",\"weather_pic\":\"http:\\/\\/static.sporttery.cn\\/www\\/images\\/weather_logo\\/sunny.png\",\"match_info\":[]}},\"status\":{\"maxcount\":\"8\",\"allup\":{\"HHAD\":{\"2x1\":{\"value\":\"1\",\"multiallup\":\"1\"},\"2x3\":{\"value\":\"0\",\"multiallup\":\"0\"},\"3x1\":{\"value\":\"1\",\"multiallup\":\"1\"},\"3x3\":{\"value\":\"1\",\"multiallup\":\"0\"},\"3x4\":{\"value\":\"1\",\"multiallup\":\"0\"},\"3x6\":{\"value\":\"0\",\"multiallup\":\"0\"},\"3x7\":{\"value\":\"0\",\"multiallup\":\"0\"},\"4x1\":{\"value\":\"1\",\"multiallup\":\"1\"},\"4x4\":{\"value\":\"1\",\"multiallup\":\"0\"},\"4x5\":{\"value\":\"1\",\"multiallup\":\"0\"},\"4x6\":{\"value\":\"1\",\"multiallup\":\"0\"},\"4x10\":{\"value\":\"0\",\"multiallup\":\"0\"},\"4x11\":{\"value\":\"1\",\"multiallup\":\"0\"},\"4x14\":{\"value\":\"0\",\"multiallup\":\"0\"},\"4x15\":{\"value\":\"0\",\"multiallup\":\"0\"},\"5x1\":{\"value\":\"1\",\"multiallup\":\"1\"},\"5x5\":{\"value\":\"1\",\"multiallup\":\"0\"},\"5x6\":{\"value\":\"1\",\"multiallup\":\"0\"},\"5x10\":{\"value\":\"1\",\"multiallup\":\"0\"},\"5x15\":{\"value\":\"0\",\"multiallup\":\"0\"},\"5x16\":{\"value\":\"1\",\"multiallup\":\"0\"},\"5x20\":{\"value\":\"1\",\"multiallup\":\"0\"},\"5x25\":{\"value\":\"0\",\"multiallup\":\"0\"},\"5x26\":{\"value\":\"1\",\"multiallup\":\"0\"},\"5x30\":{\"value\":\"0\",\"multiallup\":\"0\"},\"5x31\":{\"value\":\"0\",\"multiallup\":\"0\"},\"6x1\":{\"value\":\"1\",\"multiallup\":\"1\"},\"6x6\":{\"value\":\"1\",\"multiallup\":\"0\"},\"6x7\":{\"value\":\"1\",\"multiallup\":\"0\"},\"6x15\":{\"value\":\"1\",\"multiallup\":\"0\"},\"6x20\":{\"value\":\"1\",\"multiallup\":\"0\"},\"6x21\":{\"value\":\"0\",\"multiallup\":\"0\"},\"6x22\":{\"value\":\"1\",\"multiallup\":\"0\"},\"6x35\":{\"value\":\"1\",\"multiallup\":\"0\"},\"6x41\":{\"value\":\"0\",\"multiallup\":\"0\"},\"6x42\":{\"value\":\"1\",\"multiallup\":\"0\"},\"6x50\":{\"value\":\"1\",\"multiallup\":\"0\"},\"6x56\":{\"value\":\"0\",\"multiallup\":\"0\"},\"6x57\":{\"value\":\"1\",\"multiallup\":\"0\"},\"6x62\":{\"value\":\"0\",\"multiallup\":\"0\"},\"6x63\":{\"value\":\"0\",\"multiallup\":\"0\"},\"7x1\":{\"value\":\"1\",\"multiallup\":\"1\"},\"7x7\":{\"value\":\"1\",\"multiallup\":\"0\"},\"7x8\":{\"value\":\"1\",\"multiallup\":\"0\"},\"7x21\":{\"value\":\"1\",\"multiallup\":\"0\"},\"7x35\":{\"value\":\"1\",\"multiallup\":\"0\"},\"7x120\":{\"value\":\"1\",\"multiallup\":\"0\"},\"7x127\":{\"value\":\"0\",\"multiallup\":\"0\"},\"8x1\":{\"value\":\"1\",\"multiallup\":\"1\"},\"8x8\":{\"value\":\"1\",\"multiallup\":\"0\"},\"8x9\":{\"value\":\"1\",\"multiallup\":\"0\"},\"8x28\":{\"value\":\"1\",\"multiallup\":\"0\"},\"8x56\":{\"value\":\"1\",\"multiallup\":\"0\"},\"8x70\":{\"value\":\"1\",\"multiallup\":\"0\"},\"8x247\":{\"value\":\"1\",\"multiallup\":\"0\"},\"8x255\":{\"value\":\"0\",\"multiallup\":\"0\"},\"Single\":{\"value\":\"1\",\"multiallup\":\"1\"}}},\"last_updated\":\"2018-09-24 19:50:33\"}}"; JObject json = (JObject)JsonConvert.DeserializeObject(ret); List <BetData> dbRecords = new List <BetData>(); foreach (JProperty i in json["data"]) { JObject item = (JObject)i.Value; BetData bd = new BetData(); bd.MatchID = Convert.ToInt32(item["id"]); bd.Num = item["num"].ToString(); bd.Date = Convert.ToDateTime(item["date"]); bd.Time = Convert.ToDateTime(item["time"]).TimeOfDay; bd.L_ID = Convert.ToInt32(item["l_id"]); bd.L_CN = item["l_cn"].ToString(); bd.H_ID = Convert.ToInt32(item["h_id"]); bd.H_CN = item["h_cn"].ToString(); bd.A_ID = Convert.ToInt32(item["a_id"]); bd.A_CN = item["a_cn"].ToString(); //获取odds string URL_MatchDetailAPI = string.Format("http://i.sporttery.cn/api/fb_match_info/get_asia/?f_callback=asia_tb&mid={0}", bd.MatchID); string str_detail = HttpResponse.GetHttpResponseJson(URL_MatchDetailAPI, null); str_detail = str_detail.Replace("asia_tb(", "").Replace(")", ""); JObject json_detail = (JObject)JsonConvert.DeserializeObject(str_detail); JObject s = (JObject)json_detail["result"]["data"]; bd.CreateDate = DateTime.Now; bd.UpdateDate = DateTime.Now; dbRecords.Add(bd); } }
partial void UpdateBetData(BetData instance);
partial void DeleteBetData(BetData instance);
partial void InsertBetData(BetData instance);