public IActionResult CheckIn(IFormCollection controls) { var id = Convert.ToInt32(controls["Id"]); try { ChildCare.DailyCheckIn(id); return(RedirectToAction(nameof(Index))); } catch (FormatException) { _toastNotification.AddErrorToastMessage("CheckIn not completed!"); ViewBag.ErrorMessage = "Invalid Child Id!"; var person = ChildCare.DailyCheckIn(id); return(View(person)); } }
public IActionResult CheckIn(int?id) { var person = ChildCare.DailyCheckIn(id.Value); return(View(person)); }