Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            deparment deparment = db.deparment.Find(id);

            db.deparment.Remove(deparment);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "id,descripcion")] deparment deparment)
 {
     if (ModelState.IsValid)
     {
         db.Entry(deparment).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(deparment));
 }
Exemple #3
0
        public ActionResult Create([Bind(Include = "id,descripcion")] deparment deparment)
        {
            if (ModelState.IsValid)
            {
                db.deparment.Add(deparment);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(deparment));
        }
Exemple #4
0
        // GET: deparments/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            deparment deparment = db.deparment.Find(id);

            if (deparment == null)
            {
                return(HttpNotFound());
            }
            return(View(deparment));
        }