Пример #1
0
        public async Task <ActionResult <Paymment> > PostPaymment(Paymment paymment)
        {
            _context.Paymments.Add(paymment);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetPaymment", new { id = paymment.PaymmentId }, paymment));
        }
Пример #2
0
        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());
        }
Пример #3
0
        public ActionResult DeleteConfirmed(int id)
        {
            Paymment paymment = db.Paymments.Find(id);

            db.Paymments.Remove(paymment);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #4
0
 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));
 }
Пример #5
0
        // 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));
        }
Пример #6
0
        // 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));
        }