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