public ActionResult Modifier(int id)
        {
            AbonnementServiceAPI rs = new AbonnementServiceAPI();
            var test = rs.Donner(id);
            AbonnementModification r = new AbonnementModification(rs.Donner(id));

            return(View(r));
        }
Пример #2
0
 public static Abonnement VersAbonnement(this AbonnementModification e)
 {
     if (e == null)
     {
         return(null);
     }
     return(new Abonnement {
         id = e.id, description = e.description, nom = e.nom, duree = e.duree, nombreMaxArbres = e.nombreMaxArbres, nombreMaxPersonnes = e.nombreMaxPersonnes, prix = e.prix
     });
 }
        public ActionResult Modifier(int id, AbonnementModification rm)
        {
            if (ModelState.IsValid)
            {
                AbonnementServiceAPI rsa = new AbonnementServiceAPI();
                Abonnement           r   = rm.VersAbonnement();
                bool b = rsa.Modifier(id, r);
                if (b)
                {
                    return(RedirectToAction("Index"));
                }
            }

            return(View(rm));
        }