// // GET: /tSeat/Create public ActionResult Create(int id) { tSection section = db.tSection.Find(id); tSeat seat = new tSeat(); seat.tSectionId = section.tSectionId; return View(seat); }
public ActionResult Create(tSeat seat) { if (ModelState.IsValid) { db.tSeat.Add(seat); db.SaveChanges(); return RedirectToAction("List", new { id = seat.tSectionId }); } return View(seat); }
public ActionResult Edit(tSeat seat) { if (ModelState.IsValid) { db.Entry(seat).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("List", new { id = seat.tSectionId }); } return View(seat); }