public ActionResult DeleteConfirmed(int id)
        {
            ClasseEnergetica classeEnergetica = db.ClassesEnergeticas.Find(id);

            db.ClassesEnergeticas.Remove(classeEnergetica);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "ClasseEnergeticaId,Nome,Ordem")] ClasseEnergetica classeEnergetica)
 {
     if (ModelState.IsValid)
     {
         db.Entry(classeEnergetica).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(classeEnergetica));
 }
        public ActionResult Create([Bind(Include = "ClasseEnergeticaId,Nome,Ordem")] ClasseEnergetica classeEnergetica)
        {
            if (ModelState.IsValid)
            {
                db.ClassesEnergeticas.Add(classeEnergetica);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(classeEnergetica));
        }
        // GET: ClassesEnergeticas/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ClasseEnergetica classeEnergetica = db.ClassesEnergeticas.Find(id);

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