//This method is only called when Adding a Class. //DataSetConnector should already exist; if not, it is created and //the DataTables are loaded. public bool AddCourseRecord(CourseRecord cr) { if (XMLDataSetConnector.Instance.AddNewCourseRecordAndSTS( cr.GetStudent().GetID(), cr.GetSection().GetID(), Grade.None)) { courseRecords.Add(cr); return true; } return false; }
public bool ModifyCR(CourseRecord cr, String g) { String expression = "StudentID = '" + cr.GetStudent().GetID() + "' AND "; expression += "SectionID = '" + cr.GetSection().GetID() + "'"; DataRow[] rows = _studentRecords.CRsAndSsToSs.Select(expression); if (rows.Length == 0) return false; StudentRecordsDataSet.CRsAndSsToSsRow r = (StudentRecordsDataSet.CRsAndSsToSsRow)rows[0]; if (r.Grade.Equals(g)) return false; r.Grade = g; UpdateXml(); return true; }
//This method is only called when Dropping a Class. //DataSetConnector should already exist; if not, it is created and //the DataTables are loaded. public bool RemoveCourseRecord(CourseRecord cr) { if (XMLDataSetConnector.Instance.RemoveCourseRecordAndSTS( cr.GetStudent().GetID(), cr.GetSection().GetID())) { courseRecords.Remove(cr); return true; } return false; }