set up to load schoolwork

This commit is contained in:
Tim Young 2017-08-05 19:35:15 -05:00
parent 6467013f52
commit f49705ec11

View File

@ -99,8 +99,11 @@ namespace EduNetworkBuilder
}
}
public void Load(XmlNode TheNode)
public static List<SchoolworkClass> Load(XmlNode TheNode)
{
SchoolworkClass currentOne = new SchoolworkClass();
List<SchoolworkClass> ThisList = new List<SchoolworkClass>();
bool AddedList = false;
foreach (XmlNode Individual in TheNode.ChildNodes)
{
XmlNodeType myNodetype = Individual.NodeType;
@ -110,44 +113,48 @@ namespace EduNetworkBuilder
{
case "EduNetworkBuilderSchoolwork":
case "schoolwork":
Load(Individual);
ThisList.AddRange(Load(Individual));
AddedList = true;
break;
case "id":
UInt64 tID;
UInt64.TryParse(Individual.InnerText, out tID);
ThisID = tID;
currentOne.ThisID = tID;
break;
case "name":
Name = Individual.InnerText;
currentOne.Name = Individual.InnerText;
break;
case "description":
Description = Individual.InnerText;
currentOne.Description = Individual.InnerText;
break;
case "class":
Class = Individual.InnerText;
currentOne.Class = Individual.InnerText;
break;
case "duedate":
DateTime.TryParse(Individual.InnerText, out DueDate);
DateTime.TryParse(Individual.InnerText, out currentOne.DueDate);
break;
case "savedate":
DateTime.TryParse(Individual.InnerText, out SaveDate);
DateTime.TryParse(Individual.InnerText, out currentOne.SaveDate);
break;
case "ismaster":
bool.TryParse(Individual.InnerText, out isMaster);
bool.TryParse(Individual.InnerText, out currentOne.isMaster);
break;
case "isgraded":
bool.TryParse(Individual.InnerText, out IsGraded);
bool.TryParse(Individual.InnerText, out currentOne.IsGraded);
break;
case "issubmitted":
bool.TryParse(Individual.InnerText, out IsSumbitted);
bool.TryParse(Individual.InnerText, out currentOne.IsSumbitted);
break;
case "network":
theProject = new Network();
theProject.Load(Individual, "",false,true);
currentOne.theProject = new Network();
currentOne.theProject.Load(Individual, "",false,true);
break;
}
}
}
if (!AddedList) ThisList.Add(currentOne);
return ThisList;
}
public void Save(string filename)