public async Task <IActionResult> Edit(int id, [Bind("Id,Nume,Prenume,Cnp,Permis,Cazier")] PersoanePolitie persoanePolitie) { if (id != persoanePolitie.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(persoanePolitie); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PersoanePolitieExists(persoanePolitie.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(persoanePolitie)); }
public async Task <IActionResult> Edit(string id, [Bind("Cnp,Nume,Prenume,Serie,Numar,Adresa,Oras,DataNasterii,StatusPolitie,StatusMedic,StatusUniversitate")] Persoane persoane) { if (id != persoane.Cnp) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(persoane); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PersoaneExists(persoane.Cnp)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(persoane)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Nume,Prenume,Cnp,Facultate,Specializare,Stadiu,An")] StudentiUniversitate studentiUniversitate) { if (id != studentiUniversitate.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(studentiUniversitate); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StudentiUniversitateExists(studentiUniversitate.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(studentiUniversitate)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,NumeInstitutie")] Institutii institutii) { if (id != institutii.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(institutii); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InstitutiiExists(institutii.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(institutii)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,UserId,TipCerere,InstitutieId,Status,Data")] Cereri cereri) { if (id != cereri.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(cereri); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CereriExists(cereri.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["InstitutieId"] = new SelectList(_context.Institutii, "Id", "NumeInstitutie", cereri.InstitutieId); ViewData["UserId"] = new SelectList(_context.Persoane, "Cnp", "Cnp", cereri.UserId); return(View(cereri)); }