예제 #1
0
        public IActionResult Activity(IFormCollection controls)
        {
            var id = Convert.ToInt32(controls["Id"]);

            try
            {
                ChildCare.GetAllActivitiesById(id);
                return(RedirectToAction(nameof(Index)));
            }
            catch (FormatException)
            {
                _toastNotification.AddErrorToastMessage("Acitivites List not completed!");
                ViewBag.ErrorMessage = "Invalid Child Id!";
                var person = ChildCare.GetAllActivitiesById(id);
                return(View(person));
            }
        }
예제 #2
0
        public IActionResult Activity(int?id)
        {
            var person = ChildCare.GetAllActivitiesById(id.Value);

            return(View(person));
        }