public ActionResult AddSchedule(AddScheduleViewModel addScheduleViewModel)
        {
            if (!ModelState.IsValid) return View("AddSchedule", addScheduleViewModel);

            var child = userService.GetUser(addScheduleViewModel.ChildId) as Child;
            if (userService.IsNotChildOfCurrentUser(child)) return StatusCode.NotFound;

            child.Account.AddPaymentSchedule(
                addScheduleViewModel.StartDate,
                addScheduleViewModel.Interval,
                addScheduleViewModel.Amount,
                addScheduleViewModel.Description
                );

            return View("AddScheduleConfirm", addScheduleViewModel);
        }
        public ActionResult AddSchedule(string id)
        {
            // id is the child's username
            var child = userService.GetUserByUserName(id) as Child;
            if (userService.IsNotChildOfCurrentUser(child)) return StatusCode.NotFound;

            // give the user some defaults
            var addScheduleViewModel = new AddScheduleViewModel
            {
                ChildId = child.Id,
                Amount = 1.0M,
                Description = "Pocket Money",
                Interval = Interval.Week,
                StartDate = DateTime.Now
            };

            return View("AddSchedule", addScheduleViewModel);
        }
        public ActionResult AddSchedule(AddScheduleViewModel addScheduleViewModel)
        {
            if (!ModelState.IsValid) return View("AddSchedule", addScheduleViewModel);

            if (addScheduleViewModel.StartDate < DateTime.Now.Date)
            {
                ModelState.AddModelError("StartDate", "The start date can not be in the past.");
                return View("AddSchedule", addScheduleViewModel);
            }

            var child = userService.GetUser(addScheduleViewModel.ChildId) as Child;
            if (userService.IsNotChildOfCurrentUser(child)) return StatusCode.NotFound;

            child.Account.AddPaymentSchedule(
                addScheduleViewModel.StartDate,
                addScheduleViewModel.Interval,
                addScheduleViewModel.Amount,
                addScheduleViewModel.Description
                );

            return View("AddScheduleConfirm", addScheduleViewModel);
        }