public async Task <IActionResult> Edit(int id, [Bind("ID,Valor,Quantidade,Broker,Data,Acao")] Venda venda) { if (id != venda.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(venda); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VendaExists(venda.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(venda)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Data")] Info info) { if (id != info.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(info); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InfoExists(info.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(info)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Nome,Codigo,Atividade")] Acao acao) { if (id != acao.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(acao); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AcaoExists(acao.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(acao)); }