示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Movei movei = db.Moveis.Find(id);

            db.Moveis.Remove(movei);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "MovelID,FuncionarioID,Modelo,PlaquetaID")] Movei movei)
 {
     if (ModelState.IsValid)
     {
         db.Entry(movei).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.FuncionarioID = new SelectList(db.Funcionarios, "FuncionarioID", "Nome", movei.FuncionarioID);
     ViewBag.MovelID       = new SelectList(db.ModMovels, "ModMovelID", "Modelo", movei.MovelID);
     ViewBag.PlaquetaID    = new SelectList(db.Plaquetas, "PlaquetaID", "PlaquetaID", movei.PlaquetaID);
     return(View(movei));
 }
示例#3
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Movei movei = db.Moveis.Find(id);

            if (movei == null)
            {
                return(HttpNotFound());
            }
            return(View(movei));
        }
示例#4
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Movei movei = db.Moveis.Find(id);

            if (movei == null)
            {
                return(HttpNotFound());
            }
            ViewBag.FuncionarioID = new SelectList(db.Funcionarios, "FuncionarioID", "Nome", movei.FuncionarioID);
            ViewBag.MovelID       = new SelectList(db.ModMovels, "ModMovelID", "Modelo", movei.MovelID);
            ViewBag.PlaquetaID    = new SelectList(db.Plaquetas, "PlaquetaID", "PlaquetaID", movei.PlaquetaID);
            return(View(movei));
        }