Beispiel #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Distance,FitnessRating")] athlete athlete)
        {
            if (id != athlete.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(athlete);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!athleteExists(athlete.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(athlete));
        }
        public async Task<IActionResult> Edit(int id, [Bind("TestsID,TestType,TestDate,ParticipantCount")] Tests tests)
        {
            if (id != tests.TestsID)
            {
                return NotFound();
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tests);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TestsExists(tests.TestsID))
                    {
                        return NotFound();
                    }
                    else
                    {
                        throw;
                    }
                }
                return RedirectToAction(nameof(Index));
            }
            return View(tests);
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Date,number_participants,test_type")] Test test)
        {
            if (id != test.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(test);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TestExists(test.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(test));
        }
        public async Task <IActionResult> Edit(int id, [Bind("AthletesID,ParticipantName,Distance,Fitness")] Athletes athletes)
        {
            if (id != athletes.AthletesID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(athletes);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AthletesExists(athletes.AthletesID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(athletes));
        }
Beispiel #5
0
        public async Task <IActionResult> Edit(int id, [Bind("SAthletesID,Ranking,Seconds,FitnessRating")] SAthletes sAthletes)
        {
            if (id != sAthletes.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(sAthletes);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SAthletesExists(sAthletes.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(sAthletes));
        }