Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            CategoriaTransacao categoriaTransacao = db.CategoriaTransacao.Find(id);

            db.CategoriaTransacao.Remove(categoriaTransacao);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "Id,Descricao,DescricaoLonga,IdCategoriaPai,TipoDespesa")] CategoriaTransacao categoriaTransacao)
 {
     if (ModelState.IsValid)
     {
         db.Entry(categoriaTransacao).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.IdCategoriaPai = new SelectList(db.CategoriaTransacao, "Id", "Descricao", categoriaTransacao.IdCategoriaPai);
     PreencherTipoDespesa();
     return(View(categoriaTransacao));
 }
Esempio n. 3
0
        public ActionResult Create([Bind(Include = "Id,Descricao,DescricaoLonga,IdCategoriaPai,TipoDespesa")] CategoriaTransacao categoriaTransacao)
        {
            if (ModelState.IsValid)
            {
                db.CategoriaTransacao.Add(categoriaTransacao);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.IdCategoriaPai = new SelectList(db.CategoriaTransacao, "Id", "Descricao", categoriaTransacao.IdCategoriaPai);
            return(View(categoriaTransacao));
        }
Esempio n. 4
0
        // GET: CategoriaTransacao/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CategoriaTransacao categoriaTransacao = db.CategoriaTransacao.Find(id);

            if (categoriaTransacao == null)
            {
                return(HttpNotFound());
            }
            return(View(categoriaTransacao));
        }
Esempio n. 5
0
        // GET: CategoriaTransacao/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CategoriaTransacao categoriaTransacao = db.CategoriaTransacao.Find(id);

            if (categoriaTransacao == null)
            {
                return(HttpNotFound());
            }
            ViewBag.IdCategoriaPai = new SelectList(db.CategoriaTransacao, "Id", "Descricao", categoriaTransacao.IdCategoriaPai);
            PreencherTipoDespesa();
            return(View(categoriaTransacao));
        }