public async Task <IActionResult> Edit(int id, [Bind("ID,statDate,age,weight,height,MembersID")] Stats stats)
        {
            if (id != stats.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(stats);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!StatsExists(stats.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["MembersID"] = new SelectList(_context.Membership, "ID", "name", stats.MembersID);
            return(View(stats));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,name,gender,address,city,state,zip,email,cell")] Members members)
        {
            if (id != members.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(members);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MembersExists(members.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewBag.gender = genderList();
            return(View(members));
        }
Beispiel #3
0
 public void Update(T t)
 {
     _context.Update(t);
 }