Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Mechant mechant = db.Mechants.Find(id);

            db.Mechants.Remove(mechant);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "MechantID,CivilID,Pseudonyme,Image_Mechant,Disponible")] Mechant mechant)
 {
     if (ModelState.IsValid)
     {
         db.Entry(mechant).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MechantID = new SelectList(db.Civils, "CivilID", "Prenom", mechant.MechantID);
     return(View(mechant));
 }
Exemplo n.º 3
0
        // GET: Mechants/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Mechant mechant = db.Mechants.Find(id);

            if (mechant == null)
            {
                return(HttpNotFound());
            }
            return(View(mechant));
        }
Exemplo n.º 4
0
        // GET: Mechants/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Mechant mechant = db.Mechants.Find(id);

            if (mechant == null)
            {
                return(HttpNotFound());
            }
            ViewBag.MechantID = new SelectList(db.Civils, "CivilID", "Prenom", mechant.MechantID);
            return(View(mechant));
        }