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"));
        }
        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()));
        }
示例#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));
        }
示例#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"));
            }
        }
示例#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());
        }
示例#6
0
 public ActionResult Edit(ClientEditView clientEditView)
 {
     ClientUtilitaire.EditClient(db, clientEditView);
     return(View());
 }
示例#7
0
 public ActionResult Edit(int id)
 {
     return(View(DataManipulation.copyClientToClientEditView(ClientUtilitaire.FindClientParId(db, id))));//retourne ClientEditView
 }
示例#8
0
 public ActionResult Delete(int id)
 {
     ClientUtilitaire.DeleteClient(db, id);
     return(View());
 }