// GET: Chart public ActionResult Index() { //on peut pas utiliser groupBy List <competition> ff = new List <competition>(); // List<SubCategory> disponibilite = (List<SubCategory>)serviceSubCateg.GetAllSubCategories().GroupBy(x=>x.CategoryId).Select(g => new { Name = g.Key, Count = g.Count() }); var disponibilite = matchservice.GetAll().GroupBy(x => x.idComp).ToList(); //je vais faire le stat des valeur qui existe dans fvm List <match> fVM = new List <match>(); int[] CounSubCateg = new int[disponibilite.Count()]; string[] nameCat = new string[disponibilite.Count()]; int i = 0; foreach (var group in disponibilite) //parcourir liste des subCateg et compter { int compteur = 0; foreach (var item in group) { compteur++; } CounSubCateg[i] = compteur; var cat = service.GetById(group.Key.Value); nameCat[i] = cat.name; i++; } string myTheme = @"<Chart BackColor=""Transparent""> <ChartAreas> <ChartArea Name=""Default"" BackColor=""Transparent""></ChartArea> </ChartAreas> </Chart>"; new Chart(width: 600, height: 600, theme: myTheme).AddTitle("Statistic of matchs By competition") .AddSeries( //Transparent chartType: "pie", //chartType: "StackedColumn ", // chartType: "StackedArea ", xValue: nameCat, yValues: CounSubCateg) .Write("png"); return(null); }
public async Task CheckMatches() { dynamic matchs = await _matchServices.GetAll(); foreach (dynamic item in matchs) { DateTime matchDate = item.date; matchDate = matchDate.AddMinutes(-5); if (matchDate < DateTime.UtcNow) { await CheckCardsAsync(); } } ; }
public async Task <IActionResult> GetAllAsync() { try { return(Ok(await _services.GetAll())); } catch (FXSException fxse) { return(StatusCode(Int32.Parse(fxse.Code), new ExceptionModel { Message = fxse.Message, Code = fxse.Code })); } catch (Exception ex) { return(NotFound(ex.Message)); } }