Example #1
0
        public string get_data(string html)
        {
            StringBuilder sb = new StringBuilder();

            html = html.Replace("<thead=\"\"", "");
            HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
            doc.LoadHtml(html);

            HtmlNodeCollection nodes_all = doc.DocumentNode.SelectNodes(@"//*");
            List <HtmlNode>    nodes     = new List <HtmlNode>();


            foreach (HtmlNode node in nodes_all)
            {
                if (node.Id == "tb2")
                {
                    string   team       = node.SELECT_NODE("/div[1]/table[1]/tbody[1]/tr[1]/td[2]/a[1]/span[1]").InnerText;
                    string[] teams      = team.E_SPLIT("-");
                    string   host       = teams[0];
                    string   client     = teams[1];
                    string   start_time = node.SELECT_NODE("/div[1]/table[1]/tbody[1]/tr[1]/td[3]").ChildNodes[0].InnerText.E_TRIM();
                    start_time = DateTime.Now.Year.ToString() + "-" + start_time.Substring(3, 2) + "-" + start_time.Substring(0, 2) + " " + start_time.Substring(6, 5);

                    string       odd_host = node.SELECT_NODE("/div[2]/table[1]/tbody[1]/tr[2]/td[1]").InnerText;
                    string       odd_draw = node.SELECT_NODE("/div[2]/table[1]/tbody[1]/tr[2]/td[2]").InnerText;
                    string       odd_away = node.SELECT_NODE("/div[2]/table[1]/tbody[1]/tr[2]/td[3]").InnerText;
                    BsonDocument doc_odd  = AnalyseTool.get_odd_doc_from_europe(odd_host, odd_draw, odd_away);
                    sb.Append(host.PR(10) + client.PR(10) + start_time.PR(30) + odd_host.PR(10) + odd_draw.PR(10) + odd_away.PR(10) + doc_odd["persent_return"].ToString() + M.N);
                    Match100Helper.insert_data("1-x-bet", "", start_time, host, client, odd_host, odd_draw, odd_away, "0", "0");
                }
            }


            return(sb.ToString());
        }
Example #2
0
        private void btn_compute_Click(object sender, EventArgs e)
        {
            string win  = txt_win.Text;
            string draw = txt_draw.Text;
            string lose = txt_lose.Text;

            if (cb_usa.Checked)
            {
                win  = AnalyseTool.convert_ameriaca_odd(win);
                draw = AnalyseTool.convert_ameriaca_odd(draw);
                lose = AnalyseTool.convert_ameriaca_odd(lose);
            }
            if (cb_eng.Checked)
            {
                win  = AnalyseTool.convert_english_odd(win);
                draw = AnalyseTool.convert_english_odd(draw);
                lose = AnalyseTool.convert_english_odd(lose);
            }

            if (string.IsNullOrEmpty(win) || string.IsNullOrEmpty(draw))
            {
                return;
            }

            if (!string.IsNullOrEmpty(sb.ToString()))
            {
                sb.AppendLine("----------------------------------------------");
            }

            if (cb_usa.Checked || cb_eng.Checked)
            {
                sb.AppendLine("ODD".PR(15) + txt_win.Text.PR(10) + txt_draw.Text.PR(10) + txt_lose.Text.PR(10));
            }
            BsonDocument doc_odd = new BsonDocument();

            if (!string.IsNullOrEmpty(lose))
            {
                doc_odd = AnalyseTool.get_odd_doc_from_europe(win, draw, lose);
                sb.AppendLine("ODD".PR(15) + doc_odd["win"].PR(10) + doc_odd["draw"].PR(10) + doc_odd["lose"].PR(10));
                sb.AppendLine("PERSENT".PR(15) + doc_odd["persent_win"].PR(10) + doc_odd["persent_draw"].PR(10) + doc_odd["persent_lose"].PR(10));
                sb.AppendLine("RETURN PESENT:".PR(15) + doc_odd["persent_return"].PR(10));
            }
            else
            {
                doc_odd = AnalyseTool.get_odd_doc_from_europe(win, draw);
                sb.AppendLine("ODD".PR(15) + doc_odd["home"].PR(10) + doc_odd["away"].PR(10));
                sb.AppendLine("PERSENT".PR(15) + doc_odd["persent_home"].PR(10) + doc_odd["persent_away"].PR(10));
                sb.AppendLine("RETURN PESENT:".PR(15) + doc_odd["persent_return"].PR(10));
            }
            this.txt_result.Text = sb.ToString();
        }
Example #3
0
        public string get_data2(string html)
        {
            StringBuilder sb = new StringBuilder();

            html = html.Replace("<thead=\"\"", "");
            HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
            doc.LoadHtml(html);

            HtmlNodeCollection nodes_all = doc.DocumentNode.SelectNodes(@"//*");
            List <HtmlNode>    nodes     = new List <HtmlNode>();


            foreach (HtmlNode node in nodes_all)
            {
                if (node.CLASS() == "MatchContainer")
                {
                    if (!node.InnerHtml.Contains("LiveMatchCompetitors"))
                    {
                        try
                        {
                            string date = node.SELECT_NODE("/div[1]/span[1]/strong[1]").ChildNodes[0].InnerText.E_TRIM();
                            string time = node.SELECT_NODE("/div[1]/span[1]/em[1]").ChildNodes[0].InnerText.E_TRIM();

                            string start_time = "";
                            if (date.E_TRIM().ToLower() != "live")
                            {
                                string[] dates = date.E_SPLIT("/");
                                date       = dates[1] + "/" + dates[0];
                                start_time = date + M.D + time;
                            }
                            else
                            {
                                start_time = DateTime.Now.ToString("MM/dd") + M.D + time;
                            }

                            string host   = node.SELECT_NODE("/div[2]/h3[1]/a[1]/span[1]").ChildNodes[0].InnerText;
                            string client = node.SELECT_NODE("/div[2]/h3[1]/a[1]/span[3]").ChildNodes[0].InnerText;

                            string       odd_host = node.SELECT_NODE("div[4]/ol[1]/li[1]/a[1]/span[1]").InnerText;
                            string       odd_draw = node.SELECT_NODE("div[4]/ol[1]/li[2]/a[1]/span[1]").InnerText;
                            string       odd_away = node.SELECT_NODE("div[4]/ol[1]/li[3]/a[1]/span[1]").InnerText;
                            BsonDocument doc_odd  = AnalyseTool.get_odd_doc_from_europe(odd_host, odd_draw, odd_away);
                            sb.Append(start_time.PR(20) + host.PR(30) + client.PR(30) + odd_host.PR(10) + odd_draw.PR(10) + odd_away.PR(10) + doc_odd["persent_return"].ToString() + M.N);
                            Match100Helper.insert_data("betadonis", "", start_time, host, client, odd_host, odd_draw, odd_away, "2", "0");
                        }
                        catch (Exception error) { }
                    }
                }
            }
            return(sb.ToString());
        }
Example #4
0
    public static string test_2result_persent()
    {
        string    sql     = "  select * from a_odd where type_id in (0,1,2,3)";
        DataTable dt_temp = SQLServerHelper.get_table(sql);

        foreach (DataRow row in dt_temp.Rows)
        {
            BsonDocument doc = new BsonDocument();
            if (row["type_id"].ToString() == "0")
            {
                doc = AnalyseTool.get_odd_doc_from_europe(row["o1"].ToString(), row["o2"].ToString(), row["o3"].ToString());
            }
            else
            {
                doc = AnalyseTool.get_odd_doc_from_europe(row["o1"].ToString(), row["o2"].ToString());
            }

            IWindow.write_line(row["event_id"].PR(10) + row["type_id"].PR(10) + doc["persent_return"].PR(10));
        }
        return("COMPUTE OK!!!");
    }
Example #5
0
        private void btn_compute_Click(object sender, EventArgs e)
        {
            string win1  = txt_win_1.Text;
            string draw1 = txt_draw_1.Text;
            string lose1 = txt_lose_1.Text;

            if (cb_usa_1.Checked)
            {
                win1  = AnalyseTool.convert_ameriaca_odd(win1);
                draw1 = AnalyseTool.convert_ameriaca_odd(draw1);
                lose1 = AnalyseTool.convert_ameriaca_odd(lose1);
            }
            if (cb_eng_1.Checked)
            {
                win1  = AnalyseTool.convert_english_odd(win1);
                draw1 = AnalyseTool.convert_english_odd(draw1);
                lose1 = AnalyseTool.convert_english_odd(lose1);
            }

            string win2  = txt_win_2.Text;
            string draw2 = txt_draw_2.Text;
            string lose2 = txt_lose_2.Text;

            if (cb_usa_2.Checked)
            {
                win2  = AnalyseTool.convert_ameriaca_odd(win2);
                draw2 = AnalyseTool.convert_ameriaca_odd(draw2);
                lose2 = AnalyseTool.convert_ameriaca_odd(lose2);
            }
            if (cb_eng_2.Checked)
            {
                win2  = AnalyseTool.convert_english_odd(win2);
                draw2 = AnalyseTool.convert_english_odd(draw2);
                lose2 = AnalyseTool.convert_english_odd(lose2);
            }

            string win  = win1;
            string draw = draw1;
            string lose = lose1;

            if (Convert.ToDecimal(win2) > Convert.ToDecimal(win))
            {
                win = win2;
            }
            if (Convert.ToDecimal(draw2) > Convert.ToDecimal(win))
            {
                draw = draw2;
            }
            if (Convert.ToDecimal(lose2) > Convert.ToDecimal(lose))
            {
                lose = lose2;
            }


            if (string.IsNullOrEmpty(win) || string.IsNullOrEmpty(draw) || string.IsNullOrEmpty(lose))
            {
                return;
            }

            BsonDocument doc_odd1 = AnalyseTool.get_odd_doc_from_europe(win1, draw1, lose1);
            BsonDocument doc_odd2 = AnalyseTool.get_odd_doc_from_europe(win2, draw2, lose2);
            BsonDocument doc_odd  = AnalyseTool.get_odd_doc_from_europe(win, draw, lose);

            if (!string.IsNullOrEmpty(sb.ToString()))
            {
                sb.AppendLine("=================================================");
            }


            sb.AppendLine("-----------ONE");
            if (cb_usa_1.Checked)
            {
                sb.AppendLine("USA".PR(15) + txt_win_1.Text.PR(10) + txt_draw_1.Text.PR(10) + txt_lose_1.Text.PR(10));
            }
            if (cb_eng_1.Checked)
            {
                sb.AppendLine("ENG".PR(15) + txt_win_1.Text.PR(10) + txt_draw_1.Text.PR(10) + txt_lose_1.Text.PR(10));
            }
            sb.AppendLine("ODD".PR(15) + doc_odd1["win"].PR(10) + doc_odd1["draw"].PR(10) + doc_odd1["lose"].PR(10));
            sb.AppendLine("PERSENT".PR(15) + doc_odd1["persent_win"].PR(10) + doc_odd1["persent_draw"].PR(10) + doc_odd1["persent_lose"].PR(10));
            sb.AppendLine("RETURN PESENT:".PR(15) + doc_odd1["persent_return"].PR(10));


            sb.AppendLine("-----------TWO");
            if (cb_usa_2.Checked)
            {
                sb.AppendLine("USA".PR(15) + txt_win_2.Text.PR(10) + txt_draw_2.Text.PR(10) + txt_lose_2.Text.PR(10));
                sb.AppendLine("".PR(15) + win2.PR(10) + draw2.PR(10) + lose2.PR(10));
            }
            if (cb_eng_2.Checked)
            {
                sb.AppendLine("ENG".PR(15) + txt_win_2.Text.PR(10) + txt_draw_2.Text.PR(10) + txt_lose_2.Text.PR(10));
                sb.AppendLine("".PR(15) + win2.PR(10) + draw2.PR(10) + lose2.PR(10));
            }
            sb.AppendLine("ODD".PR(15) + doc_odd2["win"].PR(10) + doc_odd2["draw"].PR(10) + doc_odd2["lose"].PR(10));
            sb.AppendLine("PERSENT".PR(15) + doc_odd2["persent_win"].PR(10) + doc_odd2["persent_draw"].PR(10) + doc_odd2["persent_lose"].PR(10));
            sb.AppendLine("RETURN PESENT:".PR(15) + doc_odd2["persent_return"].PR(10));


            sb.AppendLine("-----------ALL");
            sb.AppendLine("ODD".PR(15) + doc_odd["win"].PR(10) + doc_odd["draw"].PR(10) + doc_odd["lose"].PR(10));
            sb.AppendLine("PERSENT".PR(15) + doc_odd["persent_win"].PR(10) + doc_odd["persent_draw"].PR(10) + doc_odd["persent_lose"].PR(10));
            sb.AppendLine("RETURN PESENT:".PR(15) + doc_odd["persent_return"].PR(10));

            this.txt_result.Text = sb.ToString();
        }