<?xml version="1.0" encoding="gb2312"?>
<Tbl_UpdateLogs>
<Table>
<id>32</id>
<title>Added law enforcement agency page</title>
<content>qqqqqq</content>
<module>Organization</module>
<updateTime>2009-07-31T00:00:00+08:00</updateTime>
<operator>Wang Yonggang</operator>
</Table>
<Table>
<id>33</id>
<title>Law Enforcement Personnel Qualification Page</title>
<content>Let it be largely</content>
<module>Organization</module>
<updateTime>2009-07-29T00:00:00+08:00</updateTime>
<operator>Wang Yonggang</operator>
</Table>
<Table>
<id>34</id>
<title>111111</title>
<content>dfdwdd</content>
<module>qwqwq</module>
<updateTime>2009-07-29T00:00:00+08:00</updateTime>
<operator>wyg</operator>
</Table>
<Table>
<id>35</id>
<title>qq</title>
<content>fjdldldsss</content>
<module>qqqqqqq</module>
<updateTime>2009-07-30T00:00:00+08:00</updateTime>
<operator>wyg</operator>
</Table>
<Table>
<id>36</id>
<title>2009222</title>
<content>ddddd</content>
<module>22</module>
<updateTime>2009-07-31T00:00:00+08:00</updateTime>
<operator>wyg</operator>
</Table>
<Table>
<id>37</id>
<title>1234455</title>
<content>ddddddd</content>
<module>11111</module>
<updateTime>2009-07-31T00:00:00+08:00</updateTime>
<operator>wyg</operator>
</Table>
</Tbl_UpdateLogs>
/// <summary>
/// Read the Xml file and get the Value value of all nodes
/// </summary>
/// <param name="fileName">Xml file name</param>
/// <param name="filePath">Stored path</param>
/// <param name="rootName">Xml root node name</param>
/// <returns></returns>
public void ImportXmlFile(string fileName,string filePath,string rootName)
{
string loadPath = (filePath + fileName);
try
{
XmlDocument xmldoc = new XmlDocument();
(loadPath);
//Get all children of the root node <rootName>
XmlNodeList myNodeList = (rootName).ChildNodes;
//Transfer all child nodes of <root node>
foreach (XmlNode myXmlNode in myNodeList)
{
XmlNodeList subNodeList = ;
UpdateLogs updateLog = new UpdateLogs();
foreach (XmlNode subXmlNode in subNodeList)
{
switch ()
{
case "id": //The name of the node, add this condition because <!----> these nodes will also be read.
= (());
break;
case "title":
= ();
break;
case "content":
= ();
break;
case "module":
= ();
break;
case "updateTime":
= (());
break;
case "operator":
= ();
break;
default:
break;
}
}
if (isExstsById(()))
{
UpdateLog(updateLog);
}
else
{
InsertLog(updateLog);
}
}
(loadPath);
BindData();
(typeof(string), "importLog", "<script>alert('Imported successfully!');</script>");
}
catch (Exception ex)
{
(ex);
}
}