public ActionResult DeleteConfirmed(int id) { Moto3 moto3 = db.Moto3s.Find(id); db.Moto3s.Remove(moto3); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,Motoname,CC,price")] Moto3 moto3) { if (ModelState.IsValid) { db.Entry(moto3).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(moto3)); }
public ActionResult Create([Bind(Include = "ID,Motoname,CC,price")] Moto3 moto3) { if (ModelState.IsValid) { db.Moto3s.Add(moto3); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(moto3)); }
// GET: Moto3/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Moto3 moto3 = db.Moto3s.Find(id); if (moto3 == null) { return(HttpNotFound()); } return(View(moto3)); }