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