public ActionResult DeleteConfirmed(int id)
        {
            Mobilhome mobilhome = db.Mobilhomes.Find(id);

            db.Mobilhomes.Remove(mobilhome);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "id_mobilhome,id_tarif,capacite,terrasse")] Mobilhome mobilhome)
 {
     if (ModelState.IsValid)
     {
         db.Entry(mobilhome).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.id_tarif = new SelectList(db.Tarifs, "id_tarif", "libelle_tarif", mobilhome.id_tarif);
     return(View(mobilhome));
 }
        // GET: Mobilhomes/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Mobilhome mobilhome = db.Mobilhomes.Find(id);

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

            if (mobilhome == null)
            {
                return(HttpNotFound());
            }
            ViewBag.id_tarif = new SelectList(db.Tarifs, "id_tarif", "libelle_tarif", mobilhome.id_tarif);
            return(View(mobilhome));
        }