コード例 #1
0
 public IActionResult ValiderPanier()
 {
     if (HttpContext.Request.Cookies["login"] == "true")
     {
         //Validation du panier
         Panier panier        = GetPanierFromSession();
         int    utilisateurId = Convert.ToInt32(HttpContext.Request.Cookies["userId"]);
         if (panier.Save(utilisateurId))
         {
             HttpContext.Session.Clear();
             return(View());
         }
         else
         {
             return(RedirectToAction("Index"));
         }
     }
     else
     {
         return(RedirectToAction("Login", "Utilisateur"));
     }
 }