Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            EcoType ecoType = db.EcoTypes.Find(id);

            db.EcoTypes.Remove(ecoType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,Name")] EcoType ecoType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(ecoType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(ecoType));
 }
Ejemplo n.º 3
0
        public ActionResult Create([Bind(Include = "Id,Name")] EcoType ecoType)
        {
            if (ModelState.IsValid)
            {
                db.EcoTypes.Add(ecoType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(ecoType));
        }
Ejemplo n.º 4
0
        // GET: EcoTypes/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EcoType ecoType = db.EcoTypes.Find(id);

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