// // // GET: /TeamsPaper/Edit/5 public ActionResult Edit(int id) { teams_paper teamModel = new teams_paper(); using (ModelsCMS db = new ModelsCMS()) { teamModel = db.teams_papers.Where(x => x.DelegatesID == id).FirstOrDefault(); } return(View(teamModel)); }
public ActionResult Create(teams_paper org) { try { using (ModelsCMS db = new ModelsCMS()) { db.teams_papers.Add(org); db.SaveChanges(); } return(RedirectToAction("Create", "Attendee")); } catch { return(View("Required")); } }
// // GET: /TeamsPaper/Create public ActionResult Create(int id = 0) { teams_paper teamModel = new teams_paper(); using (ModelsCMS db = new ModelsCMS()) { if (id != 0) { teamModel = db.teams_papers.Where(x => x.DelegatesID == id).FirstOrDefault(); } teamModel.ConferenceCollection = db.conference_events.ToList <conference_event>(); } return(View(teamModel)); }