public async Task <ActionResult <Paymment> > PostPaymment(Paymment paymment) { _context.Paymments.Add(paymment); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPaymment", new { id = paymment.PaymmentId }, paymment)); }
public async Task <IActionResult> PutPaymment(int id, Paymment paymment) { if (id != paymment.PaymmentId) { return(BadRequest()); } _context.Entry(paymment).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PaymmentExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public ActionResult DeleteConfirmed(int id) { Paymment paymment = db.Paymments.Find(id); db.Paymments.Remove(paymment); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "paymmentId,datePaymment,numCompte,telACommercant,telUtilisateur,utilisateurId,commandeId")] Paymment paymment) { if (ModelState.IsValid) { db.Entry(paymment).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.commandeId = new SelectList(db.Commandes, "commandeId", "lieuLaivraison", paymment.commandeId); ViewBag.utilisateurId = new SelectList(db.Utilisateurs, "utilisateurId", "nom", paymment.utilisateurId); return(View(paymment)); }
// GET: Paymments/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Paymment paymment = db.Paymments.Find(id); if (paymment == null) { return(HttpNotFound()); } return(View(paymment)); }
// GET: Paymments/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Paymment paymment = db.Paymments.Find(id); if (paymment == null) { return(HttpNotFound()); } ViewBag.commandeId = new SelectList(db.Commandes, "commandeId", "lieuLaivraison", paymment.commandeId); ViewBag.utilisateurId = new SelectList(db.Utilisateurs, "utilisateurId", "nom", paymment.utilisateurId); return(View(paymment)); }