public async Task <IActionResult> Edit(int id, [Bind("ResponsabilModelID,Nume,Prenume,Email,Functie,Departament")] ResponsabilModel responsabilModel) { if (id != responsabilModel.ResponsabilModelID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(responsabilModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ResponsabilModelExists(responsabilModel.ResponsabilModelID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(responsabilModel)); }
public async Task <IActionResult> Create([Bind("ResponsabilModelID,Nume,Prenume,Email,Functie,Departament")] ResponsabilModel responsabilModel) { if (ModelState.IsValid) { _context.Add(responsabilModel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(responsabilModel)); }