public static BH.oM.Environment.SAP.XML.SAP2012Data FromSAPToXML(this oM.Environment.SAP.PropertyDetails sapPropertyDetails) { BH.oM.Environment.SAP.XML.SAP2012Data xmlSAP2012Data = new BH.oM.Environment.SAP.XML.SAP2012Data(); xmlSAP2012Data.DataType = 1; xmlSAP2012Data.PropertyDetails = sapPropertyDetails.ToXML(); return(xmlSAP2012Data); }
public static bool ToXMLFile(string filePath, string fileName, BH.oM.Environment.SAP.XML.SAP2012Data data, bool run = false) { if (!run) { return(false); } XmlSerializerNamespaces xns = new XmlSerializerNamespaces(); XmlSerializer szer = new XmlSerializer(typeof(BH.oM.Environment.SAP.XML.SAP2012Data)); TextWriter ms = new StreamWriter(Path.Combine(filePath, fileName)); szer.Serialize(ms, data, xns); ms.Close(); return(true); }