public ActionResult Commit(ViewCalendarItem item) { // get RegistrationTerm from RegistrationTermID RegistrationTerm term = session.Get<RegistrationTerm>(item.RegistrationTermID); item.RegistrationTerm = term; session.SaveOrUpdate(item.ToCalendarItem()); TempData["message"] = String.Format("Calendar item '{0}' saved.", item.ID); return RedirectToAction("Index", new { id = item.RegistrationTerm.ID}); }
public ActionResult Edit(int id) { CalendarItem item = session.Get<CalendarItem>(id); if (item == null) { return RedirectToAction("Index"); } else { ViewCalendarItem viewItem = new ViewCalendarItem(item); return View (viewItem); } }