예제 #1
0
        // Add Course
        public static async Task <bool> Add(CourseModel course, string year = null, string term = null)
        {
            var courselist = await GetCourseList(year, term);

            if (CanAdd(course, courselist))
            {
                courselist.Add(course);
                SQLiteService.InsertCourse(course.id, course.name, course.classroom, course.period, course.day, course.sectionStart, course.sectionEnd, course.lessonIds);
                return(true);
            }
            else
            {
                Tools.ShowMsgAtFrame("有课程冲突");
                return(false);
            }
        }