コード例 #1
0
        public async Task <IActionResult> Edit(int id, [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")] Clackamas clackamas)
        {
            if (id != clackamas.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(clackamas);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClackamasExists(clackamas.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(clackamas));
        }
コード例 #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")] Clackamas clackamas)
        {
            if (ModelState.IsValid)
            {
                _context.Add(clackamas);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(clackamas));
        }