示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Centre_Interet centre_Interet = db.Centre_Interet.Find(id);

            db.Centre_Interet.Remove(centre_Interet);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "Id,Interet,Id_Candiat")] Centre_Interet centre_Interet)
 {
     if (ModelState.IsValid)
     {
         db.Entry(centre_Interet).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Id_Candiat = new SelectList(db.Candidats, "Id", "Nom", centre_Interet.Id_Candiat);
     return(View(centre_Interet));
 }
示例#3
0
        // GET: Centre_Interet/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Centre_Interet centre_Interet = db.Centre_Interet.Find(id);

            if (centre_Interet == null)
            {
                return(HttpNotFound());
            }
            return(View(centre_Interet));
        }
示例#4
0
        // GET: Centre_Interet/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Centre_Interet centre_Interet = db.Centre_Interet.Find(id);

            if (centre_Interet == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Id_Candiat = new SelectList(db.Candidats, "Id", "Nom", centre_Interet.Id_Candiat);
            return(View(centre_Interet));
        }
示例#5
0
        public ActionResult Create([Bind(Include = "Id,Interet,Id_Candiat")] Centre_Interet centre_Interet)
        {
            var id = Session["IdCandidat"];

            if (ModelState.IsValid)
            {
                centre_Interet.Id_Candiat = int.Parse(id.ToString());
                db.Centre_Interet.Add(centre_Interet);
                db.SaveChanges();
                return(RedirectToAction("Create", "References"));
            }

            ViewBag.Id_Candiat = new SelectList(db.Candidats, "Id", "Nom", centre_Interet.Id_Candiat);
            return(View(centre_Interet));
        }