public ActionResult DeleteConfirmed(int id) { Movei movei = db.Moveis.Find(id); db.Moveis.Remove(movei); db.SaveChanges(); return(RedirectToAction("Index")); }
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)); }
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)); }
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)); }