Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Sejour sejour = db.Sejour.Find(id);

            db.Sejour.Remove(sejour);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "id_Sejour,id_client,id_Tsejour,id_option,date_debut,date_fin")] Sejour sejour)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sejour).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.id_client  = new SelectList(db.Client, "id_client", "nom_client", sejour.id_client);
     ViewBag.id_Tsejour = new SelectList(db.Type_sejour, "id_Tsejour", "libelle_Tsejour", sejour.id_Tsejour);
     return(View(sejour));
 }
Ejemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "id,date_debut,date_fin,client_id,type_sejour_id")] Sejour sejour)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sejour).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.client_id      = new SelectList(db.Client, "id", "nom", sejour.client_id);
     ViewBag.type_sejour_id = new SelectList(db.Type_sejour, "id", "libelle", sejour.type_sejour_id);
     return(View(sejour));
 }
Ejemplo n.º 4
0
 public ActionResult Edit([Bind(Include = "SejourId,Type,Description,NumeroVoyage,HebergementId")] Sejour sejour)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sejour).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.HebergementId = new SelectList(db.Hebergements, "HebergementId", "Type", sejour.HebergementId);
     ViewBag.NumeroVoyage  = new SelectList(db.Voyages, "NumeroVoyage", "NumeroVoyage", sejour.NumeroVoyage);
     return(View(sejour));
 }
Ejemplo n.º 5
0
        public ActionResult Create([Bind(Include = "id_sejour,date_debut,date_fin,id_client,id_tsejour,id_option")] Sejour sejour)
        {
            if (ModelState.IsValid)
            {
                db.Sejour.Add(sejour);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.id_client  = new SelectList(db.Client, "id_client", "nom", sejour.id_client);
            ViewBag.id_tsejour = new SelectList(db.type_sejour, "id_type", "lib_sejour", sejour.id_tsejour);
            return(View(sejour));
        }
Ejemplo n.º 6
0
        // GET: Sejours/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Sejour sejour = db.Sejour.Find(id);

            if (sejour == null)
            {
                return(HttpNotFound());
            }
            return(View(sejour));
        }
Ejemplo n.º 7
0
        // GET: Sejours/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Sejour sejour = db.Sejour.Find(id);

            if (sejour == null)
            {
                return(HttpNotFound());
            }
            ViewBag.id_client  = new SelectList(db.Client, "id_client", "nom_client", sejour.id_client);
            ViewBag.id_Tsejour = new SelectList(db.Type_sejour, "id_Tsejour", "libelle_Tsejour", sejour.id_Tsejour);
            return(View(sejour));
        }
Ejemplo n.º 8
0
        // GET: Sejours/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Sejour sejour = db.Sejours.Find(id);

            if (sejour == null)
            {
                return(HttpNotFound());
            }
            ViewBag.HebergementId = new SelectList(db.Hebergements, "HebergementId", "Type", sejour.HebergementId);
            ViewBag.NumeroVoyage  = new SelectList(db.Voyages, "NumeroVoyage", "NumeroVoyage", sejour.NumeroVoyage);
            return(View(sejour));
        }