public ActionResult DeleteConfirmed(int id) { MovimentoEntity movimentoentity = db.Movimentos.Find(id); db.Movimentos.Remove(movimentoentity); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /Movimento/Details/5 public ActionResult Details(int id = 0) { MovimentoEntity movimentoentity = db.Movimentos.Find(id); if (movimentoentity == null) { return(HttpNotFound()); } return(View(movimentoentity)); }
// // GET: /Movimento/Edit/5 public ActionResult Edit(int id = 0) { FillDdl(); MovimentoEntity movimentoentity = db.Movimentos.Find(id); if (movimentoentity == null) { return(HttpNotFound()); } return(View(movimentoentity)); }
public ActionResult Create(MovimentoEntity movimentoentity) { FillAudit(movimentoentity); movimentoentity.ValorTotal = 0; if (ModelState.IsValid) { db.Movimentos.Add(movimentoentity); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(movimentoentity)); }
public ActionResult Edit(MovimentoEntity movimentoentity) { FillAuditUpdate(movimentoentity); movimentoentity.ValorTotal = 0; movimentoentity.DtCadastro = new BaseContext().Categorias.Find(movimentoentity.Id).DtCadastro; if (ModelState.IsValid) { db.Entry(movimentoentity).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(movimentoentity)); }