Ejemplo n.º 1
0
        public ActionResult ajouterItemAuPanier(int MyProperty, int?nombre = null)
        {
            var clientConnecter = ClientUtilitaire.FindClientParId(db, Int32.Parse(User.Identity.Name));

            ItemUtilitaire.AjouterItemPanier(db, clientConnecter.clientId, Utilitaire.ItemUtilitaire.findItemById(MyProperty).itemId, nombre);
            return(RedirectToAction("Index", "Home"));
        }
Ejemplo n.º 2
0
        public ActionResult checkOut(int?MyProperty = null, int?nombre = null)
        {
            var clientConnecter = ClientUtilitaire.FindClientParId(db, Int32.Parse(User.Identity.Name));

            if (MyProperty != null)
            {
                ItemUtilitaire.AjouterItemPanier(db, clientConnecter.clientId, Utilitaire.ItemUtilitaire.findItemById((int)MyProperty).itemId, nombre);
            }

            return(View(CommandeUtilitaire.nouvelleCommande()));
        }
Ejemplo n.º 3
0
        public ActionResult Details(int?id)
        {
            var client = ClientUtilitaire.FindClientParId(db, id.Value);

            if (client == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.NotFound));
            }
            var clientDetailsView = DataManipulation.copyClientToClientDetailsView(client);

            return(View(clientDetailsView));
        }
Ejemplo n.º 4
0
        public ActionResult Inscription(Inscription inscription)
        {
            var client = ClientUtilitaire.AjouterClient(db, inscription);

            if (client == null)
            {
                ViewBag.dejaInscrit = true;
                return(View());
            }
            else
            {
                ViewBag.dejaInscrit = false;
                FormsAuthentication.SetAuthCookie(client.clientId.ToString(), false);
                return(RedirectToAction("Index", "Home"));
            }
        }
Ejemplo n.º 5
0
        public ActionResult Connection(Connection connection)
        {
            if (ModelState.IsValid)
            {
                var client = ClientUtilitaire.TrouverClientConnection(db, connection);
                if (client == null)
                {
                    ViewBag.notFound = true;
                    return(View());
                }
                else
                {
                    FormsAuthentication.SetAuthCookie(client.clientId.ToString(), false);
                    ViewBag.notFound = false;
                    return(RedirectToAction("Index", "Home"));;
                }
            }


            return(View());
        }
Ejemplo n.º 6
0
 public ActionResult Edit(ClientEditView clientEditView)
 {
     ClientUtilitaire.EditClient(db, clientEditView);
     return(View());
 }
Ejemplo n.º 7
0
 public ActionResult Edit(int id)
 {
     return(View(DataManipulation.copyClientToClientEditView(ClientUtilitaire.FindClientParId(db, id))));//retourne ClientEditView
 }
Ejemplo n.º 8
0
 public ActionResult Delete(int id)
 {
     ClientUtilitaire.DeleteClient(db, id);
     return(View());
 }