public ActionResult DeleteConfirmed(int id) { CategoriaTransacao categoriaTransacao = db.CategoriaTransacao.Find(id); db.CategoriaTransacao.Remove(categoriaTransacao); db.SaveChanges(); return(RedirectToAction("Index")); }
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)); }
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)); }
// 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)); }
// 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)); }