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

            db.p_subdependencia.Remove(p_subdependencia);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "id,id_dependencia,cod,nombre")] p_subdependencia p_subdependencia)
 {
     if (ModelState.IsValid)
     {
         db.Entry(p_subdependencia).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.id_dependencia = new SelectList(db.p_dependencia, "id", "codigo", p_subdependencia.id_dependencia);
     return(View(p_subdependencia));
 }
        // GET: p_subdependencia/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            p_subdependencia p_subdependencia = db.p_subdependencia.Find(id);

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

            if (p_subdependencia == null)
            {
                return(HttpNotFound());
            }
            ViewBag.id_dependencia = new SelectList(db.p_dependencia, "id", "codigo", p_subdependencia.id_dependencia);
            return(View(p_subdependencia));
        }