static void TestRestClientPost() { var client = new RestClient(); var condition = new SearchToolConditionsDto { BothTeamsScore = true, TeamId = 16, GameTotal = new ST_Total { GoalsNumber = 2, TotalType = ST_TotalType.Over }, TimeRange = new SearchTimeRangeDto { FromDate = new DateTime(2013, 1, 1), ToDate = DateTime.Now } }; var leagues = client.GetNumberAllGames(condition); }
public ActionResult GetSearchingToolResult(SearchingToolInput input) { ReturnArgs r = new ReturnArgs(); var condition = new SearchToolConditionsDto { TimeRange = new SearchTimeRangeDto { FromDate = input.DateFrom, ToDate = input.DateTo } }; foreach (var cond in input.Conditions) { switch (cond.ConditionTypeId) { case ConditionTypeId.GameTotal: condition.GameTotal = new ST_Total { GoalsNumber = Int32.Parse(cond.SelectedCondition), TotalType = (ST_TotalType)((int)cond.TotalType) }; break; case ConditionTypeId.TeamTotal: condition.TeamTotal = new ST_TeamTotal { GoalsNumber = Int32.Parse(cond.SelectedCondition), TotalType = (ST_TotalType)((int)cond.TotalType), Team = ST_Team.Team1 }; break; case ConditionTypeId.Btts: condition.BothTeamsScore = bool.Parse(cond.SelectedCondition); break; case ConditionTypeId.Team: condition.TeamId = 16; break; case ConditionTypeId.GameResult: condition.Result = (ST_GameResultDto)(int.Parse(cond.SelectedCondition)); break; case ConditionTypeId.GamePlace: condition.GamePlace = (ST_GamePlaceDto)(int.Parse(cond.SelectedCondition)); break; default: break; } } var model = new SearchingToolResults() { StreaksNumber = -1, GamesNumber = -1, Games = new List <GameDto>() }; switch (input.ResultFormatId) { case ResultFormatId.AllGames: model.Games = client.GetAllGames(condition); break; case ResultFormatId.NumberOfAllGames: model.GamesNumber = client.GetNumberAllGames(condition); break; case ResultFormatId.MinStreak: model.Games = client.GetMinStreak(condition); break; case ResultFormatId.MaxStreak: model.Games = client.GetMaxStreak(condition); break; case ResultFormatId.NumberOfStreaks: model.StreaksNumber = 777; break; default: throw new Exception("Not implemented!!!"); } r.ViewString = RenderRazorViewToString("_SearchingToolResult", model); return(Json(r)); }
public int GetNumberOfStreak(SearchToolConditionsDto conditions) { var results = PostRequestAsync <int>(Routes.SearchingToolStreakNumber, conditions).GetAwaiter().GetResult(); return(results); }
public List <GameDto> GetMaxStreak(SearchToolConditionsDto conditions) { var results = PostRequestAsync <List <GameDto> >(Routes.SearchingToolMaxStreak, conditions).GetAwaiter().GetResult(); return(results); }