20.01.2015 Views

Teach Yourself e.net - Syspro

Teach Yourself e.net - Syspro

Teach Yourself e.net - Syspro

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Sample Applications<br />

string XmlTransform, string XslIn, ref string ContentType) {<br />

try {<br />

if (XmlTransform == "C") {<br />

return <strong>Syspro</strong>Query(Uid, BusObject, XmlIn);<br />

} else if (XmlTransform == "S") {<br />

ContentType = "text/html";<br />

return Transform(<strong>Syspro</strong>Query(Uid, BusObject, XmlIn), \<br />

XslIn);<br />

} else {<br />

return <strong>Syspro</strong>Query(Uid, BusObject, XmlIn);<br />

}<br />

}<br />

catch (Exception Exc) {<br />

return ("" +<br />

Exc.Message + "" +<br />

"" +<br />

"");<br />

}<br />

}<br />

Please note that there are no 'optional' variables in C#, and so the above C# sample code<br />

differs from the VB code in it's variable declarations.<br />

Look through the above functions and take note of flow of data within the "try" statement.<br />

We can specify whether a server side or client side transformation of the XmlOut string<br />

will take place, the default setting not using the transformation function option.<br />

The following code sample demonstrates the use of the Transaction.Build calling function.<br />

10–45

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!