コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            TableJalon tableJalon = db.TableJalon.Find(id);

            db.TableJalon.Remove(tableJalon);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit(TableJalon tableJalon)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tableJalon).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", new { id = tableJalon.IdProjet }));
     }
     ViewBag.IdProjet       = new SelectList(db.TableProjet, "ProjetId", "ProjetNom", tableJalon.IdProjet);
     ViewBag.JalonTrigramme = new SelectList(db.TableTrigramme, "TrigrammeId", "TrigrammeNom", tableJalon.JalonTrigramme);
     return(View(tableJalon));
 }
コード例 #3
0
 public ActionResult Create(TableJalon tableJalon)
 {
     if (ModelState.IsValid)
     {
         db.TableJalon.Add(tableJalon);
         db.SaveChanges();
         return(RedirectToAction("Index", new { id = tableJalon.IdProjet }));
     }
     ViewBag.IdProjet = new SelectList(db.TableProjet, "ProjetId", "ProjetNom", tableJalon.IdProjet);
     // ViewBag.IdJalon = new SelectList(db.TableTache, "TacheId", "TacheNom", tableJalon.Id);
     ViewBag.JalonTrigramme = new SelectList(db.TableTrigramme, "TrigrammeId", "TrigrammeNom", tableJalon.JalonTrigramme);
     return(View(tableJalon));
 }
コード例 #4
0
        // GET: TableJalons/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TableJalon tableJalon = db.TableJalon.Find(id);

            if (tableJalon == null)
            {
                return(HttpNotFound());
            }
            return(View(tableJalon));
        }
コード例 #5
0
        // GET: TableJalons/Edit/5
        public ActionResult Edit(int?id, int?idpage)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TableJalon tableJalon = db.TableJalon.Find(id);

            ViewBag.IdProjet = id;
            if (tableJalon == null)
            {
                return(HttpNotFound());
            }
            ViewBag.IdProjet       = new SelectList(db.TableProjet, "ProjetId", "ProjetNom", tableJalon.IdProjet);
            ViewBag.JalonTrigramme = new SelectList(db.TableTrigramme, "TrigrammeId", "TrigrammeNom", tableJalon.JalonTrigramme);
            return(View(tableJalon));
        }