Beispiel #1
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();
        }
Beispiel #2
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();
        }