Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }