Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            MovimentoEntity movimentoentity = db.Movimentos.Find(id);

            db.Movimentos.Remove(movimentoentity);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        //
        // GET: /Movimento/Details/5

        public ActionResult Details(int id = 0)
        {
            MovimentoEntity movimentoentity = db.Movimentos.Find(id);

            if (movimentoentity == null)
            {
                return(HttpNotFound());
            }
            return(View(movimentoentity));
        }
Beispiel #3
0
        //
        // 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));
        }
Beispiel #4
0
        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));
        }
Beispiel #5
0
        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));
        }