public ActionResult ManageSplits(long runnerRaceRecordId)
        {
            if (!AccessIsAllowed(runnerRaceRecordId))
                return HttpNotFound();

            var model = new ManageSplitsViewModel
            {
                RunnerRaceRecordId = runnerRaceRecordId,
                Splits = RunnerRaceRecordSegment.GetSplitsForRunnerRaceRecord(runnerRaceRecordId)
                    .Select(s => new SplitViewModel
                    {
                        RunnerRaceRecordSegmentId = s.RunnerRaceRecordSegmentId,
                        ElapsedTimeInSeconds = s.ElapsedTimeInSeconds,
                        IntervalFromPriorSplit = s.IntervalFromPriorSplit,
                    }).ToList()
            };

            return PartialView(model);
        }
        public ActionResult ManageSplits(ManageSplitsViewModel model)
        {
            if (!AccessIsAllowed(model.RunnerRaceRecordId))
                ModelState.AddModelError("Error", "You are not authorized to do this. Go away!");

            if (ModelState.IsValid)
            {
                RunnerRaceRecordSegment.DeleteSegmentsByRunnerRaceRecordId(model.RunnerRaceRecordId);

                foreach (var split in model.Splits)
                {
                    db.RunnerRaceRecordSegments.AddObject(new RunnerRaceRecordSegment
                    {
                        CreatedBy = LoggedInUserId,
                        ElapsedTimeInSeconds = split.ElapsedTimeInSeconds,
                        RunnerRaceRecordId = model.RunnerRaceRecordId
                    });
                }
                TryDBChange(() => db.SaveChanges());
                if (ModelState.IsValid)
                    return Json(new { });
            }
            return Json(new { Errors = ModelState.Errors() });
        }