string path = ValidateUser.GetSavePath();
if( !Directory.Exists(path) )
{
Directory.CreateDirectory(path);
}// end if
string [] s = Directory.GetFileSystemEntries(path);
int i = s.Length;
i++ ;
string SysDate =System.DateTime.Now.ToString();
string SysName = "AA"+"-"+SysDate.Replace("-","").Replace(" ","").Replace(":","")+i.ToString()+"-"+DictName;
string XMLName = path + @"/"+SysName+".xml";
XmlTextWriter xml = new XmlTextWriter(XMLName,System.Text.Encoding.UTF8);
xml.Formatting = Formatting.Indented;
xml.WriteStartDocument( false );
#region
xml.WriteStartElement("JINDUNTBData");
xml.WriteStartElement(DictName);
xml.WriteStartElement("PreSymbol");
xml.WriteString("JXTBZD");
xml.WriteEndElement();
xml.WriteStartElement("OperSym");
xml.WriteString("1");
xml.WriteEndElement();
if(PrimaryValue != "" && PrimaryValue != null && DictA != "" && DictA != null && DictB != "" && DictB != null && DictC != "" && DictC != null)
{
xml.WriteStartElement(DictPrimary);
xml.WriteString(PrimaryValue);
xml.WriteEndElement();
xml.WriteStartElement(ColumA);
xml.WriteString(DictA);
xml.WriteEndElement();
xml.WriteStartElement(ColumB);
xml.WriteString(DictB);
xml.WriteEndElement();
xml.WriteStartElement(ColumC);
xml.WriteString(DictC);
xml.WriteEndElement();
}
else
{
if(PrimaryValue != "" && PrimaryValue != null && DictA != "" && DictA != null && DictB != "" && DictB != null && DictC == "" )
{
xml.WriteStartElement(DictPrimary);
xml.WriteString(PrimaryValue);
xml.WriteEndElement();
xml.WriteStartElement(ColumA);
xml.WriteString(DictA);
xml.WriteEndElement();
xml.WriteStartElement(ColumB);
xml.WriteString(DictB);
xml.WriteEndElement();
}//end if
else
{
if(PrimaryValue != "" && PrimaryValue != null && DictA != "" && DictA != null && DictB == "" && DictC == "" )
{
xml.WriteStartElement(DictPrimary);
xml.WriteString(PrimaryValue);
xml.WriteEndElement();
xml.WriteStartElement(ColumA);
xml.WriteString(DictA);
xml.WriteEndElement();
}//end if
else
{
return;
}// end else if
}//end else if
}//end if
xml.WriteEndElement();
xml.WriteEndElement();
#endregion
xml.Flush();
xml.Close();