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