예제 #1
0
 public ActionResult Nieuweschool(School school)
 {
     try
     {
         // TODO: Add insert logic here
         school.Naam = Request.Form["Naam"];
         school.Adres = Request.Form["Adres"];
         school.Huisnummer = Convert.ToInt32(Request.Form["Huisnummer"]);
         school.Postcode = Convert.ToInt32(Request.Form["Postcode"]);
         school.Gemeente = Request.Form["Gemeente"];
         if (Request.Form["LogoUrl"] != null)
         {
             school.LogoUrl = Request.Form["LogoUrl"];
         }
         superuserservice.Voegschooltoe(school);
         return RedirectToAction("Dashboard");
     }
     catch
     {
         return View();
     }
 }
예제 #2
0
 public School Voegschooltoe(School school)
 {
     SchoolRepository.Insert(school);
     uow.SaveChanges();
     return school;
 }
예제 #3
0
 public ActionResult Wijzigschool(School school)
 {
     try
     {
         // TODO: Add update logic here
         if (ModelState.IsValid)
         {
             superuserservice.Updateschool(school);
             return RedirectToAction("Dashboard");
         }
     }
     catch
     {
         ModelState.AddModelError(string.Empty, "Onmogelijk om gegevens op te slaan. Als het probleem blijft bestaan, contacteer de administrator.");
     }
     return View(school);
 }
예제 #4
0
 public School Updateschool(School school)
 {
     SchoolRepository.Update(school);
     uow.SaveChanges();
     return school;
 }