Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Deptos deptos = db.Deptos.Find(id);

            db.Deptos.Remove(deptos);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
        //
        // GET: /DeptosAdmin/Details/5

        public ActionResult Details(int id = 0)
        {
            Deptos deptos = db.Deptos.Find(id);

            if (deptos == null)
            {
                return(HttpNotFound());
            }
            return(View(deptos));
        }
Example #3
0
 public ActionResult Edit(Deptos deptos)
 {
     if (ModelState.IsValid)
     {
         db.Entry(deptos).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(deptos));
 }
Example #4
0
        public ActionResult Create(Deptos deptos)
        {
            if (ModelState.IsValid)
            {
                db.Deptos.Add(deptos);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(deptos));
        }