コード例 #1
0
 public CourseViewModel()
 {
     Unit = new Unit();
     Centre = new Centre();
     Tutor = new Person();
     Verifier = new Person();
     Students = new List<Person>();
 }
コード例 #2
0
        protected void CreateUnits()
        {
            Unit IntroductionToFacePainting = new Unit
            {
                Name = "1 - Introduction to Face Painting",
                Sessions = new List<Session>
                {
                    new Session{ Name = "Session 1" },
                    new Session{ Name = "Session 2" },
                    new Session{ Name = "Session 3" },
                    new Session{ Name = "Session 4" },
                    new Session{ Name = "Session 5" },
                    new Session{ Name = "Session 6" },
                },
                Modules = new List<Module>
                {
                    new Module{ Name = "Health & Safety" },
                    new Module{ Name = "Communications" },
                    new Module{ Name = "Design" },
                    new Module{ Name = "Technique" }
                }
            };
            MvcApplication.CurrentSession.Store(IntroductionToFacePainting);

            Unit IntermediateFacePainting = new Unit
            {
                Name = "2 - Intermediate Face Painting",
                Sessions = new List<Session>
                {
                    new Session{ Name = "Session 1" },
                    new Session{ Name = "Session 2" },
                    new Session{ Name = "Session 3" },
                    new Session{ Name = "Session 4" },
                    new Session{ Name = "Session 5" },
                    new Session{ Name = "Session 6" },
                },
                Modules = new List<Module>
                {
                    new Module{ Name = "Health & Safety" },
                    new Module{ Name = "Communications" },
                    new Module{ Name = "Design" },
                    new Module{ Name = "Technique" }
                }
            };
            MvcApplication.CurrentSession.Store(IntermediateFacePainting);

            Unit DesignDevelopment = new Unit
            {
                Name = "3 - Design Development",
                Sessions = new List<Session>
                {
                    new Session{ Name = "Session 1" },
                    new Session{ Name = "Session 2" },
                    new Session{ Name = "Session 3" },
                    new Session{ Name = "Session 4" },
                    new Session{ Name = "Session 5" },
                    new Session{ Name = "Session 6" },
                },
                Modules = new List<Module>
                {
                    new Module{ Name = "Health & Safety" },
                    new Module{ Name = "Communications" },
                    new Module{ Name = "Design" },
                    new Module{ Name = "Technique" }
                }
            };
            MvcApplication.CurrentSession.Store(DesignDevelopment);

            Unit FacePaintingAtEventsVolunteerProgramme = new Unit
            {
                Name = "4 - Face Painting at Events Volunteer Programme",
                Sessions = new List<Session>
                {
                    new Session{ Name = "Session 1" },
                    new Session{ Name = "Session 2" },
                    new Session{ Name = "Session 3" },
                    new Session{ Name = "Session 4" },
                    new Session{ Name = "Session 5" },
                    new Session{ Name = "Session 6" },
                },
                Modules = new List<Module>
                {
                    new Module{ Name = "Health & Safety" },
                    new Module{ Name = "Communications" },
                    new Module{ Name = "Design" },
                    new Module{ Name = "Technique" }
                }
            };
            MvcApplication.CurrentSession.Store(FacePaintingAtEventsVolunteerProgramme);

            MvcApplication.CurrentSession.SaveChanges();
        }