示例#1
0
        //------------------------------------------------------------------------------
        //
        // initiates Andrue Cashman's network
        //
        //------------------------------------------------------------------------------
        private void InitNetwork()
        {
            string rawcourses = File.ReadAllText("../../AllCourses.json");
            string rawpreqs   = File.ReadAllText("../../PrereqNetwork.json");

            network = new CourseNetwork(rawcourses, rawpreqs);
            network.BuildNetwork();
        }
示例#2
0
        //------------------------------------------------------------------------------
        //
        // initiates Andrue Cashman's network
        //
        //------------------------------------------------------------------------------
        private void InitNetwork()
        {
            //VARIABLES
            string rawpreqs   = DBPlugin.ExecuteToString("Select CourseID, GroupID, PrerequisiteID from Prerequisite for JSON AUTO");
            string rawcourses = DBPlugin.ExecuteToString("select CourseID from Course for JSON AUTO;");

            //NETWORK BUILD
            network = new CourseNetwork(rawcourses, rawpreqs);
            network.BuildNetwork();
        }
        //------------------------------------------------------------------------------
        // initiates Andrue Cashman's network
        //------------------------------------------------------------------------------
        private void InitNetwork()
        {
            //VARIABLES
            // These queries are so general and non-specific >:(
            // TODO:    Going to have to do a join on courses to receive the Maxcredits so we can store in the course object and then in turn store in the job.
            //          This requires changing the file of the CourseObject and on lines: 498 and around it.
            //          Also gives you a chance to fix this damn query.
            //string rawpreqs = DBPlugin.ExecuteToString("Select CourseID, GroupID, PrerequisiteID, PrerequisiteCourseID from Prerequisite for JSON AUTO");
            string rawpreqs = DBPlugin.ExecuteToString("SELECT p.CourseID, MaxCredit as credits, GroupID, PrerequisiteID, PrerequisiteCourseID " +
                                                       "FROM Prerequisite as p " +
                                                       "LEFT JOIN Course as c ON c.CourseID = p.CourseID " +
                                                       "FOR JSON PATH");
            string rawcourses = DBPlugin.ExecuteToString("SELECT CourseID, MaxCredit as credits " +
                                                         "FROM Course " +
                                                         "FOR JSON PATH");

            //NETWORK BUILD
            network = new CourseNetwork(rawcourses, rawpreqs);
            network.BuildNetwork();
        }