Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            CSP_DOC cSP_DOC = db.CSP_DOC.Find(id);

            db.CSP_DOC.Remove(cSP_DOC);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit(CSP_DOC cSP_DOC)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cSP_DOC).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CodeCSP = new SelectList(db.CSP, "Code", "Libelle", cSP_DOC.CodeCSP);
     ViewBag.CodeDoc = new SelectList(db.Documents, "Code", "Libelle", cSP_DOC.CodeDoc);
     return(View(cSP_DOC));
 }
Example #3
0
        public ActionResult Create(CSP_DOC cSP_DOC)
        {
            if (ModelState.IsValid)
            {
                db.CSP_DOC.Add(cSP_DOC);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.CodeCSP = new SelectList(db.CSP, "Code", "Libelle", cSP_DOC.CodeCSP);
            ViewBag.CodeDoc = new SelectList(db.Documents, "Code", "Libelle", cSP_DOC.CodeDoc);
            return(View(cSP_DOC));
        }
Example #4
0
        // GET: Depouillement/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CSP_DOC cSP_DOC = db.CSP_DOC.Find(id);

            if (cSP_DOC == null)
            {
                return(HttpNotFound());
            }
            return(View(cSP_DOC));
        }
Example #5
0
        // GET: Depouillement/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CSP_DOC cSP_DOC = db.CSP_DOC.Find(id);

            if (cSP_DOC == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CodeCSP = new SelectList(db.CSP, "Code", "Libelle", cSP_DOC.CodeCSP);
            ViewBag.CodeDoc = new SelectList(db.Documents, "Code", "Libelle", cSP_DOC.CodeDoc);
            return(View(cSP_DOC));
        }