Esempio n. 1
0
 public ActionResult Edit(Session session)
 {
     if (ModelState.IsValid)
     {
         db.Entry(session).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.SpeakerId = new SelectList(db.Speakers, "SpeakerId", "FullName", session.SpeakerId);
     return View(session);
 }
Esempio n. 2
0
        public ActionResult Create(Session session)
        {
            if (ModelState.IsValid)
            {
                db.Sessions.Add(session);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.SpeakerId = new SelectList(db.Speakers, "SpeakerId", "FullName", session.SpeakerId);
            return View(session);
        }