Ejemplo n.º 1
0
 //
 // GET: /tSection/Create
 public ActionResult Create(int id)
 {
     tVenue venue = db.tVenue.Find(id);
     tSection section = new tSection();
     //section.tVenue = venue;
     section.tVenueId = venue.tVenueId;
     return View(section);
 }
Ejemplo n.º 2
0
        public ActionResult Create(tSection section)
        {
            if (ModelState.IsValid)
            {
                db.tSection.Add(section);
                db.SaveChanges();
                //return RedirectToAction("Index", new { id = section.tVenueId });
                tVenue venue = db.tVenue.Find(section.tVenueId);
                return RedirectToAction("Index",  venue);
            }

            return View(section);
        }
Ejemplo n.º 3
0
 public ActionResult Edit(tSection section)
 {
     if (ModelState.IsValid)
     {
         db.Entry(section).State = EntityState.Modified;
         db.SaveChanges();
         tVenue venue = db.tVenue.Find(section.tVenueId);
         return RedirectToAction("Index",venue);
     }
     return View(section);
 }