public async Task <IActionResult> Edit(int id, [Bind("Adminstrator_ID,Adminstrator_username,Adminstrator_password,Adminstrator_lastname,Adminstrator_firstname")] Administrator administrator) { if (id != administrator.Adminstrator_ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(administrator); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AdministratorExists(administrator.Adminstrator_ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(administrator)); }
public async Task <IActionResult> Edit(int id, [Bind("member_ID,member_lastName,member_FirstName,member_contacNo,member_email,captain_status,member_username,member_password,Adminstrator_ID")] Member member) { if (id != member.member_ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(member); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MemberExists(member.member_ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(member)); }