public User(string name, string studentNumber, double maximum) { Name = name; StudentNumber = studentNumber; Maximum = maximum; Semesters = new SemesterCollection(); GradeSystem = new GradeSystem(Maximum, true); Lecture.GradeSystem = GradeSystem; }
public static SemesterCollection GetSemesterCollectionFromXMLNode(XmlNode node) { if (node.Name != "SemesterCollection") { return(null); } SemesterCollection result = new SemesterCollection(); foreach (XmlNode n in node.ChildNodes) { var v = Semester.GetSemesterFromXMLNode(n); result.Add(v); } return(result); }
public static User GetUserFromXMLNode(XmlNode node) { if (node.Name != "User") { return(null); } string name = node.Attributes["Name"].Value; string studentNumber = node.Attributes["StudentNumber"].Value; double max = Convert.ToDouble(node.Attributes["Maximum"].Value); GradeSystem gs = GradeSystem.GetGradeSystemFromXMLNode(node["GradeSystem"]); SemesterCollection sc = SemesterCollection.GetSemesterCollectionFromXMLNode(node["SemesterCollection"]); User user = new User(name, studentNumber, max); user.GradeSystem = gs; user.Semesters = sc; return(user); }