Example #1
0
        public async Task <IActionResult> FinalizarRodada(int id)
        {
            var sqlRodada = new SqlRodadaData(_context);
            await sqlRodada.UpdateRodadaAtual();

            sqlRodada.UpdateRodadaId(id);
            return(Redirect("/"));
        }
Example #2
0
        public IActionResult Index()
        {
            var sqlRodada = new SqlRodadaData(_context);

            if (DateTime.Today.Day.ToString() != Globals.UpdateDay)
            {
                sqlRodada.UpdateCampeonato().Wait();
                Globals.UpdateDay = DateTime.Today.Day.ToString();
            }
            var info = sqlRodada.GetInfoCampeonato();

            return(View("campeonato", info));
        }
Example #3
0
        public async Task <IActionResult> RodadaAtual()
        {
            var sqlRodada = new SqlRodadaData(_context);

            if (Math.Abs(DateTime.Now.Second - Globals.UpdateSecond) > 15)
            {
                Globals.UpdateSecond = DateTime.Now.Second;
                sqlRodada.UpdateRodadaAtual().Wait();
                Globals.UpdateSecond = DateTime.Now.Second;
            }
            var info = sqlRodada.GetInfoRodadaAtual();

            return(View("rodadaatual", info));
        }