public ActionResult DeleteConfirmed(int id)
        {
            billet billet = db.billet.Find(id);

            db.billet.Remove(billet);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "idBillet,nomProjet,description,idDepartement,idEmploye")] billet billet)
 {
     if (ModelState.IsValid)
     {
         db.Entry(billet).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.idDepartement = new SelectList(db.departement, "idDepartement", "nomDepartement", billet.idDepartement);
     ViewBag.idEmploye     = new SelectList(db.employe, "idEmploye", "nom", billet.idEmploye);
     return(View(billet));
 }
예제 #3
0
 public ActionResult Create([Bind(Include = "idBillet,nomProjet,description,dateCreation,idDepartement,idEmploye")] billet billet)
 {
     if (ModelState.IsValid)
     {
         db.billet.Add(billet);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.idDepartement = new SelectList(db.departement, "idDepartement", "nomDepartement", billet.idDepartement);
     ViewBag.idEmploye     = new SelectList(db.employe, "idEmploye", "nomEmploye", billet.idEmploye);
     return(View(billet));
 }
        // GET: billets/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            billet billet = db.billet.Find(id);

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

            if (billet == null)
            {
                return(HttpNotFound());
            }
            ViewBag.idDepartement = new SelectList(db.departement, "idDepartement", "nomDepartement", billet.idDepartement);
            ViewBag.idEmploye     = new SelectList(db.employe, "idEmploye", "nom", billet.idEmploye);
            return(View(billet));
        }