Exemple #1
0
        public IActionResult Form(Appointment appointment)
        {
            // If this appointment matches the ModelState, push to database
            if (ModelState.IsValid)
            {
                _context.Add(appointment);
                _context.SaveChanges();

                return(RedirectToAction("ViewAppointments"));
            }
            // Else return user to form page to fix errors
            return(View(appointment));
        }
Exemple #2
0
 public void InsertTourKind(TourKind tourKind)
 {
     _db.TourKinds.Add(tourKind);
     _db.SaveChanges();
 }