public async Task <IActionResult> Edit(int id, [Bind("IdProfesor,NameProfesor,EnrollDate")] Profesor profesor) { if (id != profesor.IdProfesor) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(profesor); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProfesorExists(profesor.IdProfesor)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(profesor)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Age,EnrollDate")] Student student) { if (id != student.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(student); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StudentExists(student.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(student)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,NCode,SCode,Name,Family,Father,Phone,Mobile,Address,isActive")] Teacher teacher) { if (id != teacher.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(teacher); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TeacherExists(teacher.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(teacher)); }