예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            vmain vmain = db.vmain.Find(id);

            db.vmain.Remove(vmain);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "id_vmain,label,poids,id_texture,id_couleur")] vmain vmain)
 {
     if (ModelState.IsValid)
     {
         db.Entry(vmain).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.id_couleur = new SelectList(db.couleur, "id_couleur", "label", vmain.id_couleur);
     ViewBag.id_texture = new SelectList(db.texture, "id_texture", "label", vmain.id_texture);
     return(View(vmain));
 }
예제 #3
0
        // GET: Vmain/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            vmain vmain = db.vmain.Find(id);

            if (vmain == null)
            {
                return(HttpNotFound());
            }
            return(View(vmain));
        }
예제 #4
0
        // GET: Vmain/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            vmain vmain = db.vmain.Find(id);

            if (vmain == null)
            {
                return(HttpNotFound());
            }
            ViewBag.id_couleur = new SelectList(db.couleur, "id_couleur", "label", vmain.id_couleur);
            ViewBag.id_texture = new SelectList(db.texture, "id_texture", "label", vmain.id_texture);
            return(View(vmain));
        }