public ActionResult DeleteConfirmed(int id) { CADASTRO_CARRO cADASTRO_CARRO = db.CADASTRO_CARRO.Find(id); db.CADASTRO_CARRO.Remove(cADASTRO_CARRO); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID_CARRO,PLACA,MARCA,MODELO,COR,ANO_FABRICACAO")] CADASTRO_CARRO cADASTRO_CARRO) { if (ModelState.IsValid) { db.Entry(cADASTRO_CARRO).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cADASTRO_CARRO)); }
public ActionResult Create([Bind(Include = "ID_CARRO,PLACA,MARCA,MODELO,COR,ANO_FABRICACAO")] CADASTRO_CARRO cADASTRO_CARRO) { if (ModelState.IsValid) { db.CADASTRO_CARRO.Add(cADASTRO_CARRO); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cADASTRO_CARRO)); }
// GET: CRUDcadastroCarro/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CADASTRO_CARRO cADASTRO_CARRO = db.CADASTRO_CARRO.Find(id); if (cADASTRO_CARRO == null) { return(HttpNotFound()); } return(View(cADASTRO_CARRO)); }