예제 #1
0
        public ActionResult Modifier(int id)
        {
            ArbreServiceAPI   rs = new ArbreServiceAPI();
            ArbreModification r  = new ArbreModification(rs.Donner(id));

            return(View(r));
        }
예제 #2
0
 public static Arbre VersArbre(this ArbreModification e)
 {
     if (e == null)
     {
         return(null);
     }
     return(new Arbre {
         id = e.id, nom = e.nom, description = e.description
     });
 }
예제 #3
0
        public ActionResult Modifier(int id, ArbreModification rm)
        {
            if (ModelState.IsValid)
            {
                ArbreServiceAPI rsa = new ArbreServiceAPI();
                Arbre           a   = rsa.Donner(id);

                Arbre r = rm.VersArbre();
                r.id = a.id;

                bool b = rsa.Modifier(id, r);
                if (b)
                {
                    return(RedirectToAction("Index"));
                }
            }

            return(View(rm));
        }