public async Task <IActionResult> Edit(int id, [Bind("MeetingID,FirstName,LastName,PetName,MeetingDay,MeetingTime")] CatAppointmentSetup catAppointmentSetup) { if (id != catAppointmentSetup.MeetingID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(catAppointmentSetup); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CatAppointmentSetupExists(catAppointmentSetup.MeetingID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(catAppointmentSetup)); }
public async Task <IActionResult> Create([Bind("MeetingID,FirstName,LastName,PetName,MeetingDay,MeetingTime")] CatAppointmentSetup catAppointmentSetup) { if (ModelState.IsValid) { _context.Add(catAppointmentSetup); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(catAppointmentSetup)); }
public IActionResult CatAppointmentSetup(CatAppointmentSetup userCatAppointment) { if (ModelState.IsValid) { CatMeetingRepository.AddAppointment(userCatAppointment); return(View("CatAppointmentThankYou", userCatAppointment)); } else { return(View()); } }