Beispiel #1
0
        public static void addCourseToCourseCollection(Course course)
        {
            var database = new SqliteDataService();

            database.Initialize();
            database.AddCourse(course);
            Courses.Add(course);
            database.Close();
        }
Beispiel #2
0
        private void InitializeData()
        {
            var  db      = new SqliteDataService();
            bool addData = db.Initialize();

            if (addData)
            {
                var thisMonth = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
                db.AddTerm(new Term {
                    Title = "Term 1", StartDate = thisMonth, EndDate = thisMonth.AddMonths(4).AddDays(-1)
                });
                db.AddCourse(new Course
                {
                    TermId              = 1,
                    Title               = "Sample Course",
                    StartDate           = thisMonth,
                    EndDate             = thisMonth.AddMonths(1).AddDays(-1),
                    Status              = "In Progress",
                    InstructorName      = "Isaac Heist",
                    InstructorPhone     = "555-444-3333",   //change before submitting
                    InstructorEmail     = "*****@*****.**", //change before submitting
                    Notes               = "This is only a Test",
                    EnableNotifications = true
                });
                db.AddAssessment(new Assessment
                {
                    CourseId            = 1,
                    Title               = "Sample",
                    StartDate           = thisMonth.AddMonths(1).AddDays(-1),
                    EndDate             = thisMonth.AddMonths(1),
                    Type                = "Performance",
                    EnableNotifications = true
                });
                db.AddAssessment(new Assessment
                {
                    CourseId            = 1,
                    Title               = "Sample 2",
                    StartDate           = thisMonth.AddMonths(2).AddDays(-1),
                    EndDate             = thisMonth.AddMonths(2),
                    Type                = "Objective",
                    EnableNotifications = true
                });
            }
        }