//------------------------------------------------------------------------------ // HELPER FUNCTION FOR InitDegreePlan // Adds the courses from the query to the list of courses that need to be scheduled //------------------------------------------------------------------------------ private void planBuilder(DataTable dt) { bool CORE_CLASS = true; List <Job> courseNums = new List <Job>(); foreach (DataRow row in dt.Rows) { // Need to store more information that we get from the DT Job job = new Job((int)row.ItemArray[0], (int)row.ItemArray[1], CORE_CLASS); courseNums.Add(job); } myPlan = new DegreePlan(courseNums); }
//------------------------------------------------------------------------------ // retrieves the degree plan we seek. input hard coded from the driver but in // the future it should be taken from the UI. // query admissionrequiredcourses //------------------------------------------------------------------------------ public void InitDegreePlan(int majorID, int schoolID) { string query = "select CourseID from AdmissionRequiredCourses where MajorID =" + majorID + " and SchoolID = " + schoolID + " order by CourseID ASC "; DataTable dt = DBPlugin.ExecuteToDT(query); List <Job> courseNums = new List <Job>(); foreach (DataRow row in dt.Rows) { Job job = new Job((int)row.ItemArray[0]); courseNums.Add(job); } myPlan = new DegreePlan(courseNums); }