public ActionResult DeleteConfirmed(int id) { CarsSet carsSet = db.CarsSets.Find(id); db.CarsSets.Remove(carsSet); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Car_Id,Car_Type,Car_MarK,Car_Vin,Car_Price,Car_License_Plate,LocationLocatio_Id1")] CarsSet carsSet) { if (ModelState.IsValid) { db.Entry(carsSet).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.LocationLocatio_Id1 = new SelectList(db.LocationSets, "Locatio_Id", "Location_Name", carsSet.LocationLocatio_Id1); return(View(carsSet)); }
// GET: CarsSets/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CarsSet carsSet = db.CarsSets.Find(id); if (carsSet == null) { return(HttpNotFound()); } return(View(carsSet)); }
// GET: CarsSets/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CarsSet carsSet = db.CarsSets.Find(id); if (carsSet == null) { return(HttpNotFound()); } ViewBag.LocationLocatio_Id1 = new SelectList(db.LocationSets, "Locatio_Id", "Location_Name", carsSet.LocationLocatio_Id1); return(View(carsSet)); }