public async Task <IActionResult> Edit(int id, TipCerere tipCerere) { if (id != tipCerere.TipCerereId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tipCerere); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TipCerereExists(tipCerere.TipCerereId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(tipCerere)); }
public async Task <IActionResult> Create(TipCerere tipCerere) { if (ModelState.IsValid) { _context.Add(tipCerere); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(tipCerere)); }