public void InsertProgramm(OProgrammModel programm)
 {
     var programmData = new OlimpProgramma()
     {
         Programma = programm.Programma,
     };
     _dataContext.OlimpProgrammas.InsertOnSubmit(programmData);
     _dataContext.SubmitChanges();
 }
 public OProgrammModel GetProgrammById(int programmId)
 {
     var query = from p in _dataContext.OlimpProgrammas
                 where p.Id == programmId
                 select p;
     var programm = query.FirstOrDefault();
     var model = new OProgrammModel()
     {
         Id = programmId,
         Programma = programm.Programma
     };
     return model;
 }
 public ActionResult Create(OProgrammModel programm)
 {
     try
     {
         if (ModelState.IsValid)
         {
             programm.Programma = System.Net.WebUtility.HtmlDecode(programm.Programma);
             _repository.InsertProgramm(programm);
             return RedirectToAction("Index");
         }
     }
     catch (DataException)
     {
         ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists see your system administrator.");
     }
     return View(programm);
 }
 public void UpdateProgramm(OProgrammModel programm)
 {
     OlimpProgramma programmData = _dataContext.OlimpProgrammas.Where(p => p.Id == programm.Id).SingleOrDefault();
     programmData.Programma = programm.Programma;
     _dataContext.SubmitChanges();
 }