public async Task <IActionResult> Edit(int id, [Bind("Id,DataInicio,DataFim")] TrocaTape trocaTape) { if (id != trocaTape.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(trocaTape); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TrocaTapeExists(trocaTape.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(trocaTape)); }
public async Task <IActionResult> Create([Bind("Id,DataInicio,DataFim")] TrocaTape trocaTape) { if (ModelState.IsValid) { _context.Add(trocaTape); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(trocaTape)); }