public ActionResult Save(entradaNF entradaNF) { _context.entradasNF.Add(entradaNF); try { _context.SaveChanges(); } catch (Exception) { return(RedirectToAction("New", "EntradaNF")); } return(RedirectToAction("Index", "EntradaNF")); }
public ActionResult Inativar(entradaNF entradaNF) { var entradaNFExistente = _context.entradasNF.Single(e => e.en_cod == entradaNF.en_cod); entradaNFExistente.en_status = entradaNF.en_status; try { _context.SaveChanges(); } catch (Exception) { return(RedirectToAction("New", "Item")); } return(RedirectToAction("Index", "Item")); }