/// <summary> /// Gets the Current Term of the Current Date /// </summary> /// <returns>Term Object</returns> /// <summary> /// Takes in a Terms Code and returns the Term Object associated with it /// </summary> /// <param name="termCode"></param> /// <returns>Term Object</returns> /// <summary> /// Takes in a Date and returns the Term it is in /// </summary> /// <param name="date"></param> /// <returns></returns> /// <summary> /// Returns an array of all colleges /// </summary> /// <returns></returns> public static College[] getAllColleges() { try { ProgramsAndDegrees programsProxy = new ProgramsAndDegrees(); ProgramsAndDegreesEntry[] results = new ProgramsAndDegreesEntry[30]; results = programsProxy.GetAllColleges(webServiceUsername, webServicePassword); College[] colleges = new College[results.Length]; for (int i = 0; i < results.Length; i++) { College c = new College(); c.collegeName = results[i].college.ToString(); c.collegeCode = results[i].collegeCode.ToString(); colleges[i] = c; } return(colleges); } catch (Exception) { return(null); } }
/// <summary> /// Takes in a College Code and returns a Name Identified by that Code /// </summary> /// <param name="collegeCode"></param> /// <returns></returns> public static string getCollegeNameByCollegeCode(string collegeCode) { try { ProgramsAndDegrees programsProxy = new ProgramsAndDegrees(); ProgramsAndDegreesEntry[] results = new ProgramsAndDegreesEntry[30]; results = programsProxy.GetAllColleges(webServiceUsername, webServicePassword); foreach (ProgramsAndDegreesEntry entry in results) { if (entry.collegeCode.Equals(collegeCode)) { return(entry.college); } } } catch (Exception) { return(null); } return(null); }