Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("ID,CompetitionId,Match,Team,Baseline,AutoBalls_LVL_1,AutoBalls_LVL_2,AutoBalls_LVL_3,TeleopBalls_LVL_1,TeleopBalls_LVL_2,TeleopBalls_LVL_3,Spinner_Number,Spinner_Colour,Climbed,Climb_HI,Climb_MI,Climb_LO,Balanced")] Stats stats)
        {
            if (ModelState.IsValid)
            {
                _context.Add(stats);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(stats));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("ID,Team,Baseline,AutoBalls_LVL_1_A,AutoBalls_LVL_1_M,AutoBalls_LVL_2_A,AutoBalls_LVL_2_M,AutoBalls_LVL_3_A,AutoBalls_LVL_3_M,TeleopBalls_LVL_1_A,TeleopBalls_LVL_1_M,TeleopBalls_LVL_2_A,TeleopBalls_LVL_2_M,TeleopBalls_LVL_3_A,TeleopBalls_LVL_3_M,Spinner_Number_A,Spinner_Colour_A,Climbed_A,Climb_HI_S,Climb_MI_S,Climb_LO_S,Balanced_A")] AvgMax avgMax)
        {
            if (ModelState.IsValid)
            {
                _context.Add(avgMax);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(avgMax));
        }
Exemplo n.º 3
0
        private async Task HandleMessage(SocketMessage message)
        {
            if (_client.CurrentUser.Id == message.Author.Id)
            {
                return;
            }
            int argPos = 0;

            if (message is SocketUserMessage && (message as SocketUserMessage).HasMentionPrefix(_client.CurrentUser, ref argPos))
            {
                return;
            }

            _stats.Messages.Add(new Message
            {
                Author_Id  = message.Author.Id,
                Channel_Id = message.Channel.Id,
                Content    = message.Content,
                Date       = DateTime.Now
            });

            int changes = await _stats.SaveChangesAsync();
        }