public ActionResult DeleteConfirmed(int id)
        {
            plano_contas plano_contas = db.plano_contas.Find(id);

            db.plano_contas.Remove(plano_contas);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "id_planocontas,id_dre,codigo_planocontas,descricao_planocontas")] plano_contas plano_contas)
 {
     if (ModelState.IsValid)
     {
         db.Entry(plano_contas).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.id_dre = new SelectList(db.dre, "id_dre", "nome_dre", plano_contas.id_dre);
     return(View(plano_contas));
 }
        // GET: PlanoContas/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            plano_contas plano_contas = db.plano_contas.Find(id);

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

            if (plano_contas == null)
            {
                return(HttpNotFound());
            }
            ViewBag.id_dre = new SelectList(db.dre, "id_dre", "nome_dre", plano_contas.id_dre);
            return(View(plano_contas));
        }