Esempio n. 1
0
 //
 // 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);
 }
Esempio n. 2
0
        public ActionResult Create(tSeat seat)
        {
            if (ModelState.IsValid)
            {
                db.tSeat.Add(seat);
                db.SaveChanges();

                return RedirectToAction("List", new { id = seat.tSectionId });
            }
            return View(seat);
        }
Esempio n. 3
0
        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);
        }