public ActionResult Modifier(int id) { ArbreServiceAPI rs = new ArbreServiceAPI(); ArbreModification r = new ArbreModification(rs.Donner(id)); return(View(r)); }
public ActionResult Supprimer(int id) { ArbreServiceAPI rsa = new ArbreServiceAPI(); ArbreDetails r = new ArbreDetails(rsa.Donner(id)); return(View(r)); }
public ActionResult Details(int id) { ArbreServiceAPI rsa = new ArbreServiceAPI(); Arbre r = rsa.Donner(id); ArbreDetails rd = new ArbreDetails(r); return(View(rd)); }
public ActionResult ListerTout() { ArbreServiceAPI asa = new ArbreServiceAPI(); IEnumerable <ArbreIndex> ai = asa.Donner().Select(j => { ArbreIndex a = new ArbreIndex(j); a.proprietaire = new UtilisateurServiceAPI().Donner(j.idCreateur).login; a.blocage = j.idBlocage == null ? "xxx" : new BlocageServiceAPI().Donner((int)j.idBlocage).nom; return(a); }); return(View(ai)); }
public ActionResult Supprimer(int id, ArbreDetails r) { if (ModelState.IsValid) { ArbreServiceAPI rsa = new ArbreServiceAPI(); Arbre a = rsa.Donner(id); bool b = rsa.Supprimer(id); if (b) { SessionUtilisateur.arbres.Remove(a); return(RedirectToAction("Index")); } } return(View(r)); }
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)); }