public ActionResult GetBettingData() { var bettingData = new BettingData(); var pro12Data = bettingData.GetCurrentBettingData; if (!pro12Data.Any()) { ViewData["NoData"] = "Currently no betting odds available online"; } return(View(pro12Data.ToList())); }
private async void FindFortunaEventsByName() { BindingSource Events = new BindingSource(); BettingData FortunaEvents = await GetNewFeedData(); if (FortunaEvents == null) { return; } foreach (var Category in FortunaEvents.Category) { foreach (var Tournament in Category.Tournament) { foreach (var Match in Tournament.Match) { foreach (var Event in GetMatchPrices(Match)) { Event.EventName = Match.Name; Event.TournamentName = Tournament.Name; Event.ID = Convert.ToInt64(Match.Id); Events.Add(Event); } } } } SearchResultsView.Columns.Clear(); SearchResultsView.AutoGenerateColumns = false; foreach (var Column in FortunaEventHelper.GenerateColumns()) { SearchResultsView.Columns.Add(Column); } SearchResultsView.Columns[4].Visible = false; // don't show match ID SearchResultsView.DataSource = Events; }
/// <summary> /// 下注(m.caikz99.com) /// </summary> /// <returns></returns> public async Task <bool> Bets() { await Task.Delay(0); if (string.IsNullOrWhiteSpace(urlText)) { throw new Exception("网站地址【Bets:UrlAddress】找不到"); } if (string.IsNullOrWhiteSpace(sessionValue)) { throw new Exception("账号Cookie【Bets:SessionValue】找不到"); } var maximumLoss = AppSettings.GetEntityValue("Bets:MaximumLoss"); //获取当前账号下的余额 var money = GetThisAccontMoney(); //1 //规则 //int[] rule = { 1, 3, 9, 27, 81, 240, 720 }; int[] rule = { 1, 3, 9, 1, 3, 9 }; if (money > 0) { var thisMoney = GetThisAccontMoney(); //1 int paymentAmount = rule[0]; int i = 0; string type = "大"; int k = 0; while (true) { if (thisMoney >= money) { paymentAmount = rule[0]; } else { if ((money - thisMoney) >= Convert.ToDecimal(maximumLoss)) { throw new Exception($"投资已超出,限额:{maximumLoss}元,已停止投注!"); } if (i <= rule.Length - 2) //6 { if (i == 2) { paymentAmount = rule[0]; type = "单"; } else if (i == 3) { paymentAmount = rule[1]; type = "单"; } else if (i == 4) { paymentAmount = rule[2]; type = "单"; } else { paymentAmount = rule[(i + 1)]; } i += 1; k += 1; } } if (!string.IsNullOrWhiteSpace(GetThisDayMaxIssueNumber())) { //支付实体 List <BettingData> list = new List <BettingData>(); BettingData bettingData = new BettingData(); bettingData.lotteryCode = AppSettings.GetEntityValue("Bets:lotteryCode"); bettingData.playDetailCode = bettingData.lotteryCode + "A10"; bettingData.bettingNumber = type; bettingData.bettingCount = 1; bettingData.bettingAmount = paymentAmount; bettingData.bettingPoint = "1.0"; bettingData.bettingUnit = 1; long number = Convert.ToInt64(GetThisDayMaxIssueNumber()); bettingData.bettingIssue = (number + 1).ToString(); bettingData.graduationCount = 1; list.Add(bettingData); var encodeString = UrlEncode(list.ToJson()); //Encode参数数据 //买 var state = BettingAction("bettingData=" + encodeString); //验 if (state) { money = GetThisAccontMoney(); await Task.Delay(60000); thisMoney = GetThisAccontMoney(); } else { throw new Exception("购买失败!"); } } } } else { return(false); } }
public async Task <bool> Bets_Lucky() { await Task.Delay(0); if (string.IsNullOrWhiteSpace(urlText)) { throw new Exception("网站地址【Bets:UrlAddress】找不到"); } if (string.IsNullOrWhiteSpace(sessionValue)) { throw new Exception("账号Cookie【Bets:SessionValue】找不到"); } //要购买的次数 long PurchaseTimes = 5000000; int ThisBuyNumber = 0; string ThisBuyType = ""; int ThisAmount = 1; for (int i = 0; i < PurchaseTimes; i++) { //当前账户金额 decimal money = GetThisAccontMoney(); int add = i; //获取历史期号信息 var NumberList = GetIssueNumber(); if (NumberList.Count > 0) { #region 算法一、收益失败 ////判断历史期号是否存在 //var HistoryList = Db.Queryable<LotteryNumber>().OrderBy(a => a.IssueNumber, OrderByType.Desc).Skip(0).Take(4).ToList(); //HistoryList.Reverse(); //#region 判断要押的值 ////要买的值 //string Pledge = ""; //int big, small, single, doubleInt; //big = small = single = doubleInt = 0; //foreach (var item in HistoryList) //{ // #region 大/小 // if (item.SumValue > 10) // { // small = 0; // big += 1; // } // else // { // big = 0; // small += 1; // } // #endregion // #region 单/双 // if (item.SingleOrDouble == "单") // { // doubleInt = 0; // single += 1; // } // else // { // single = 0; // doubleInt += 1; // } // #endregion //} //if (big == 3) //{ // Pledge = "大"; //} //else if (small == 3) //{ // Pledge = "小"; //} //else if (single == 3) //{ // Pledge = "单"; //} //else if (doubleInt == 3) //{ // Pledge = "双"; //} //#endregion #endregion #region 算法二,测试中 //判断历史期号是否存在 var HistoryList = Db.Queryable <LotteryNumber>().OrderBy(a => a.IssueNumber, OrderByType.Desc).Skip(0).Take(6).ToList(); string thisBuyy = HistoryList[0].SumValue > 10 ? "大" : "小"; decimal thisBuyMoney = GetThisAccontMoney(); bool thisBuyyState = false; if (ThisBuyNumber != 0) { if (thisBuyy != ThisBuyType) { if (ThisBuyNumber == 1) { thisBuyyState = true; ThisAmount = 3; LogHelper.Info("", "余额:" + thisBuyMoney + "是否盈利:亏,继续买入:" + ThisAmount + "元"); } //else if (ThisBuyNumber == 2) //{ // ThisAmount = 9; // LogHelper.Info("", "余额:" + thisBuyMoney + "是否盈利:亏,继续买入:" + ThisAmount + "元"); //} } else { LogHelper.Info("", "余额:" + thisBuyMoney + "是否盈利:盈利"); } } #region 判断要押的值 //要买的值 string Pledge = ""; string oneState, twoState, threeState, fourState, fiveState, sixState; oneState = twoState = threeState = fourState = fiveState = sixState = ""; oneState = HistoryList[0].SumValue > 10 ? "大" : "小"; twoState = HistoryList[1].SumValue > 10 ? "大" : "小"; threeState = HistoryList[2].SumValue > 10 ? "大" : "小"; fourState = HistoryList[3].SumValue > 10 ? "大" : "小"; fiveState = HistoryList[4].SumValue > 10 ? "大" : "小"; sixState = HistoryList[5].SumValue > 10 ? "大" : "小"; if (oneState != twoState && (twoState == threeState) && (threeState == fourState) && (fourState == fiveState) && (fiveState == sixState)) { Pledge = twoState; } if (thisBuyyState) { Pledge = ThisBuyType; } #endregion #endregion if (!string.IsNullOrWhiteSpace(Pledge)) { //进行购买 //支付实体 List <BettingData> list = new List <BettingData>(); BettingData bettingData = new BettingData(); bettingData.lotteryCode = AppSettings.GetEntityValue("Bets:lotteryCode"); bettingData.playDetailCode = bettingData.lotteryCode + "A10"; bettingData.bettingNumber = Pledge; bettingData.bettingCount = 1; bettingData.bettingAmount = ThisAmount; bettingData.bettingPoint = "1.0"; bettingData.bettingUnit = 1; long number = Convert.ToInt64(GetThisDayMaxIssueNumber()); bettingData.bettingIssue = (number + 1).ToString(); var thisBettingIssue = (number + 1).ToString(); bettingData.graduationCount = 1; list.Add(bettingData); var encodeString = UrlEncode(list.ToJson()); //Encode参数数据 //买 var state = BettingAction("bettingData=" + encodeString); if (state) { ThisBuyType = Pledge; if (ThisBuyNumber == 1) { ThisBuyNumber = 0; } else { ThisBuyNumber = ThisBuyNumber + 1; } bool Next = false; while (Next == false) { var thisNumberIssue = GetThisDayMaxIssueNumber(); if (thisBettingIssue == thisNumberIssue) { LotteryNumber lottery = new LotteryNumber(); var thisNumberList = GetIssueNumber(); //判断数据库是否存在 该期号 foreach (var item in thisNumberList) { var InsertNumberState = Db.Queryable <LotteryNumber>().Any(a => a.IssueNumber == item.issue); if (!InsertNumberState) { lottery.IssueNumber = item.issue; lottery.One = Convert.ToInt32(item.openNumber.Split(',')[0]); lottery.Two = Convert.ToInt32(item.openNumber.Split(',')[1]); lottery.Three = Convert.ToInt32(item.openNumber.Split(',')[2]); lottery.SumValue = item.SumValue; lottery.BigOrSmall = item.BigOrSmall; lottery.CreatTime = DateTime.Now; lottery.SingleOrDouble = item.SingleOrDouble; break; } } #region 是否盈利 并插入数据 lottery.IsOK = true; lottery.BuyingTime = DateTime.Now; bool moneyState = false; while (moneyState == false) { decimal thisMoney = GetThisAccontMoney(); if (thisMoney != money) { if (thisMoney > money) { lottery.IsWin = true; } else { lottery.IsWin = false; } LogHelper.Info("", "期号:" + thisBettingIssue + ",买入号码:" + Pledge + ",买入金额:" + ThisAmount + ",当前余额:" + thisMoney); moneyState = true; } } Db.Insertable(lottery).ExecuteCommand(); #endregion Next = true; } } } else { LogHelper.Info("", "购买过程中产生错误!"); i = i - 1; } } else { LogHelper.Info("", "不符合购买规则"); bool getNumber = false; while (getNumber == false) { DateTime time = DateTime.Now; if (time.Second >= 05 && time.Second < 10) { var thisRecordState = await AddRecord(); if (thisRecordState) { LogHelper.Info("", "执行跳过"); i = i - 1; } else { bool getIssueNumber = false; while (getIssueNumber == false) { var recordState = await AddRecord(); if (recordState) { LogHelper.Info("", "不符合购买规则执行跳过,获取历史期号错误,循环获取执行中!"); getIssueNumber = true; i = i - 1; } } LogHelper.Info("", "不符合购买规则执行跳过,获取历史期号错误,已执行循环!"); } getNumber = true; } } } } else { LogHelper.Info("", "账号登录失败!"); i = i - 1; } } return(true); }