public PartialViewResult _RegisterToLessonPartial(
            RegisterToLessonViewModel registerToLessonViewModel)
        {
            registerToLessonViewModel.Lessons = GetLessonList();

            var selectedLesson = registerToLessonViewModel.Lessons
                .FirstOrDefault(l => l.Id == registerToLessonViewModel.LessonId);

            registerToLessonViewModel.LessonCost = (selectedLesson != null) ?
                selectedLesson.Price :
                0;

            try
            {
                if (ModelState.IsValid)
                {
                    if (this.VerifyRecaptchaResponse())
                    {
                        var lessonRegistrationDto =
                            Mapper.Map<LessonRegistrationCreatingDto>(
                                registerToLessonViewModel);

                        string lessonName = selectedLesson.Name;

                        var notification = new Notification(
                            ConfigurationManager.AppSettings["EmailForNotifications"],
                            Resources.Resource.RegisterToLessonNotificationSubject,
                            String.Format(
                                Resources.Resource.RegisterToLessonNotificationBody,
                                registerToLessonViewModel.LearnerName,
                                registerToLessonViewModel.LearnerPhone,
                                registerToLessonViewModel.LearnerEmail,
                                lessonName,
                                registerToLessonViewModel.LessonDate,
                                registerToLessonViewModel.LessonTime,
                                registerToLessonViewModel.LessonCost,
                                registerToLessonViewModel.Comment));

                        lock (_updateLocker)
                        {
                            _managementService.CreateLessonRegistration(
                                lessonRegistrationDto,
                                notification);
                        }

                        ModelState.Clear();

                        return _RegisterToLessonPartial(
                            registerToLessonViewModel.LessonId,
                            true);
                    }
                    else
                    {
                        ModelState.AddModelError(string.Empty, _invalidCaptchaError);
                    }
                }
            }
            catch (Exception ex)
            {
                ModelState.AddModelError(String.Empty, _generalError);
                _logger.Error(
                    ex,
                    "Не удалось выполнить регистрацию на занятие viewModel='{0}'",
                    registerToLessonViewModel);
            }

            return PartialView(registerToLessonViewModel);
        }
        public PartialViewResult _RegisterToLessonPartial(
            int? lessonId = null,
            bool successfullyRegistered = false)
        {
            var registerToLessonViewModel = new RegisterToLessonViewModel()
            {
                LessonDate = DateTime.Now.Date,
                LessonTime = new TimeSpan(10, 0, 0),
                LessonId = lessonId ?? 0,
                SuccessfullyRegistered = successfullyRegistered
            };

            registerToLessonViewModel.Lessons = GetLessonList();

            var selectedLesson = registerToLessonViewModel.Lessons
                .FirstOrDefault(l => l.Id == registerToLessonViewModel.LessonId);

            if (selectedLesson != null)
            {
                registerToLessonViewModel.LessonCost = selectedLesson.Price;
            }

            return PartialView(registerToLessonViewModel);
        }