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 GradeSystem GetGradeSystemFromXMLNode(XmlNode node) { if (node.Name != "GradeSystem") { return(null); } double d = Convert.ToDouble(node.Attributes["Maximum"].Value); GradeSystem gs = new GradeSystem(d); foreach (XmlNode v in node.ChildNodes) { var c = GradeTuple.GetGradeTupleFromXMLNode(v); gs.Add(c); } return(gs); }
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); }