Exemplo n.º 1
0
 public void InsertProgramm(OProgrammModel programm)
 {
     var programmData = new OlimpProgramma()
     {
         Programma = programm.Programma,
     };
     _dataContext.OlimpProgrammas.InsertOnSubmit(programmData);
     _dataContext.SubmitChanges();
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 public void UpdateProgramm(OProgrammModel programm)
 {
     OlimpProgramma programmData = _dataContext.OlimpProgrammas.Where(p => p.Id == programm.Id).SingleOrDefault();
     programmData.Programma = programm.Programma;
     _dataContext.SubmitChanges();
 }