public ActionResult createProgramSeminar(Seminar post)
 {
     if (post.SeminarID > 0)
         db.editSeminar(post);
     else
         db.createProgramSeminar(post);
     return RedirectToAction("Programs", new { SelectedItemID = post.ProgramID });
 }
 public ActionResult createProgramSeminar(int Id, int? EditID, string mode = "Create")
 {
     ViewBag.mode = mode;
     Seminar model;
     if (EditID != null)
     {
         model = db.getSeminars().Single(s => s.SeminarID == Id);
     }
     else
     {
         model = new Seminar() { ProgramID = Id };
     }
     return View(model);
 }
 public void createProgramSeminar(Seminar seminar)
 {
     db.Seminars.Add(seminar);
     db.SaveChanges();
 }
 public ActionResult EditSeminar(Seminar post)
 {
     db.editSeminar(post);
     return RedirectToAction("Seminars");
 }
 public void editSeminar(Seminar seminar)
 {
     Seminar editSeminar = db.Seminars.Find(seminar.SeminarID);
     editSeminar.SeminarTitle = seminar.SeminarTitle;
     db.SaveChanges();
 }