Example #1
0
        public void Continue()
        {
            var storage = new LessonProgressStorage(Context.GetAspNetCoreContext());

            var step = Step as ValidableStepBase;

            if (step != null)
            {
                var validableStep = step;
                if (Context.IsPostBack)
                {
                    ErrorMessage = validableStep.Validate();
                }
            }

            if (string.IsNullOrEmpty(ErrorMessage))
            {
                if (CurrentStepNumber < lesson.Steps.Count())
                {
                    storage.UpdateLessonLastStep(lessonNumber, NextStepNumber);
                    Context.RedirectToRoute("Lesson", new { Step = NextStepNumber });
                }
                else
                {
                    storage.UpdateLessonLastStep(lessonNumber, LessonProgressStorage.FinishedLessonStepNumber);
                    Context.RedirectToRoute("Default");
                }
            }
        }
        public override Task Load()
        {
            LessonName = LessonNames.ResourceManager.GetString("LessonText", CultureInfo.CurrentCulture);

            TutorialsText = LessonNames.ResourceManager.GetString("TutorialsText", CultureInfo.CurrentCulture);

            var storage = new LessonProgressStorage(Context.GetAspNetCoreContext());

            Lessons = new List <LessonDTO>
            {
                new LessonDTO
                {
                    Number         = 1,
                    LastStep       = storage.GetLessonLastStep(1),
                    Title          = LessonNames.ResourceManager.GetString("Lesson1", CultureInfo.CurrentCulture),
                    ImageUrl       = "/img/basics.png",
                    CurrentCulture = CultureInfo.CurrentCulture.Name
                },
                new LessonDTO
                {
                    Number         = 2,
                    LastStep       = storage.GetLessonLastStep(2),
                    Title          = LessonNames.ResourceManager.GetString("Lesson2", CultureInfo.CurrentCulture),
                    ImageUrl       = "/img/elementary.png",
                    CurrentCulture = CultureInfo.CurrentCulture.Name
                },
                new LessonDTO
                {
                    Number         = 3,
                    LastStep       = storage.GetLessonLastStep(3),
                    Title          = LessonNames.ResourceManager.GetString("Lesson3", CultureInfo.CurrentCulture),
                    ImageUrl       = "/img/intermediate.png",
                    CurrentCulture = CultureInfo.CurrentCulture.Name
                },
                new LessonDTO
                {
                    Number         = 4,
                    LastStep       = storage.GetLessonLastStep(4),
                    Title          = LessonNames.ResourceManager.GetString("Lesson4", CultureInfo.CurrentCulture),
                    ImageUrl       = "/img/advanced.png",
                    CurrentCulture = CultureInfo.CurrentCulture.Name
                },
                //new LessonDTO
                //{
                //    Number = 5,
                //    LastStep = storage.GetLessonLastStep(5),
                //    Title = "Understand <code>GridView</code> and loading data from <code>IQueryable</code>.",
                //    ImageUrl = "/img/professional.png"
                //}
            };
            return(base.Load());
        }
Example #3
0
        public override Task Init()
        {
            var storage = new LessonProgressStorage(Context.GetAspNetCoreContext());

            Lessons = new List <LessonDTO>
            {
                new LessonDTO
                {
                    Number   = 1,
                    LastStep = storage.GetLessonLastStep(1),
                    Title    = "Understand basic principles of DotVVM and MVVM pattern.",
                    ImageUrl = "/img/basics.png"
                },
                new LessonDTO
                {
                    Number   = 2,
                    LastStep = storage.GetLessonLastStep(2),
                    Title    = "Learn how to use the <code>Repeater</code> control and how to work with collections.",
                    ImageUrl = "/img/elementary.png"
                },
                new LessonDTO
                {
                    Number   = 3,
                    LastStep = storage.GetLessonLastStep(3),
                    Title    =
                        "Try out working with advanced form controls like <code>ComboBox</code> and <code>RadioButton</code>.",
                    ImageUrl = "/img/intermediate.png"
                },
                new LessonDTO
                {
                    Number   = 4,
                    LastStep = storage.GetLessonLastStep(4),
                    Title    = "Learn how validation works and <code>DataContext</code> works.",
                    ImageUrl = "/img/advanced.png"
                },
                //new LessonDTO
                //{
                //    Number = 5,
                //    LastStep = storage.GetLessonLastStep(5),
                //    Title = "Understand <code>GridView</code> and loading data from <code>IQueryable</code>.",
                //    ImageUrl = "/img/professional.png"
                //}
            };

            return(base.Init());
        }