public ActionResult DeleteConfirmed(int id) { CATALOGO_PECAS cATALOGO_PECAS = db.CATALOGO_PECAS.Find(id); db.CATALOGO_PECAS.Remove(cATALOGO_PECAS); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID_PECA,NOME_PECA,DESCRICAO_PECA")] CATALOGO_PECAS cATALOGO_PECAS) { if (ModelState.IsValid) { db.Entry(cATALOGO_PECAS).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cATALOGO_PECAS)); }
public ActionResult Create([Bind(Include = "ID_PECA,NOME_PECA,DESCRICAO_PECA")] CATALOGO_PECAS cATALOGO_PECAS) { if (ModelState.IsValid) { db.CATALOGO_PECAS.Add(cATALOGO_PECAS); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cATALOGO_PECAS)); }
// GET: CRUDcatalogoPecas/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CATALOGO_PECAS cATALOGO_PECAS = db.CATALOGO_PECAS.Find(id); if (cATALOGO_PECAS == null) { return(HttpNotFound()); } return(View(cATALOGO_PECAS)); }