Beispiel #1
0
 public ActionResult DetailCommande(int id)
 {
     if (Utils.Client != null)
     {
         CommandeApiService commandeApi = CommandeApiService.GetLoadBalancer();
         return(View(commandeApi.GetOne(id).GetCommandeASP()));
     }
     else
     {
         return(RedirectToAction("Accueil", "Home", new { area = "" }));
     }
 }
Beispiel #2
0
 public ActionResult Commande()
 {
     if (Utils.Client != null)
     {
         CommandeApiService commandeApi = CommandeApiService.GetLoadBalancer();
         //return View(commandeApi.GetAll().Where(p => p.clientLogin == Utils.Client.clientLogin).Select(p => p.GetCommandeASP()).ToList());
         return(View(commandeApi.GetByLogin(Utils.Client.clientLogin).Select(p => p.GetCommandeASP()).ToList()));
     }
     else
     {
         return(RedirectToAction("Accueil", "Home", new { area = "" }));
     }
 }
Beispiel #3
0
 public ActionResult CreateCommande(FormCommande commandeASP)
 {
     if (Utils.Client != null)
     {
         if (Verif.IsBiereValid(commandeASP.biereNom) && Verif.IsNumber(commandeASP.commandeQuantite.ToString()))
         {
             commandeASP.clientLogin = Utils.Client.clientLogin;
             string             test       = commandeASP.biereNom;
             CommandeApiService apiService = CommandeApiService.GetLoadBalancer();
             apiService.Create(commandeASP.GetCommandeASPFromFormCommande().GetCommandeDalAPI());
             return(RedirectToAction("Commande"));
         }
         else
         {
             ViewBag.Messages = "Commande non valide";
             return(View(commandeASP));
         }
     }
     else
     {
         return(RedirectToAction("Accueil", "Home", new { area = "" }));
     }
 }