public ActionResult CheckIn(VehicleCtx ctx) { var car = new Vehicle(ctx.Owner); car.RegNr = ctx.RegNr; garage.Add(car); TempData["vehicle"] = car; return RedirectToAction("CheckinOK"); }
public ActionResult Edit(Vehicle garageitem) { if (ModelState.IsValid) { db.Entry(garageitem).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Main"); } return View(garageitem); }
public ActionResult Create(Vehicle vehicle) { if (ModelState.IsValid) { db.Item.Add(vehicle); db.SaveChanges(); return RedirectToAction("Main"); } return View(vehicle); }