public IActionResult InsertOne(Models.FricFrac.Event Event)
 {
     ViewBag.Message = "Insert een persoon in de database";
     dbContext.Event.Add(Event);
     dbContext.SaveChanges();
     return(View("Index", dbContext.Event.ToList()));
 }
 public IActionResult UpdateOne(Fric_frac.Models.FricFrac.Country country)
 {
     if (ModelState.IsValid)
     {
         try
         {
             dbContext.Update(country);
             dbContext.SaveChanges();
             ViewBag.Countries = dbContext.Country.ToList();
             return(View("ReadingOne", country));
         }
         catch (DbUpdateConcurrencyException)
         {
             if (!dbContext.Country.Any(e => e.Id == country.Id))
             {
                 return(NotFound());
             }
             else
             {
                 throw;
             }
         }
     }
     return(View("Index", country));
 }
 public IActionResult UpdateOne(Fric_frac.Models.FricFrac.Eventtopic eventTopic)
 {
     if (ModelState.IsValid)
     {
         try
         {
             dbContext.Update(eventTopic);
             dbContext.SaveChanges();
             ViewBag.EventTopics = dbContext.Eventtopic.ToList();
             return(View("ReadingOne", eventTopic));
         }
         catch (DbUpdateConcurrencyException)
         {
             if (!dbContext.Eventtopic.Any(e => e.Id == eventTopic.Id))
             {
                 return(NotFound());
             }
             else
             {
                 throw;
             }
         }
     }
     return(View("Index", eventTopic));
 }
Example #4
0
        public IActionResult InsertOne(Models.FricFrac.User User)
        {
            ViewBag.Message = "Insert een persoon in de database";
            dbContext.User.Add(User);
            dbContext.SaveChanges();
            ViewBag.Users = dbContext.User.ToList();

            return(View("Index", dbContext.User.ToList()));
        }