20.01.2015 Views

Teach Yourself e.net - Syspro

Teach Yourself e.net - Syspro

Teach Yourself e.net - Syspro

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Sample Applications<br />

Example 10.9. Query.Query Method in ASP.NET C# codebehind<br />

//*******************************************************<br />

//- <strong>Syspro</strong>Query does the actual call to the specified<br />

// Query business object.<br />

//*******************************************************<br />

//Parameters:<br />

//Uid:- GUID returned by Logon<br />

//BusObject:- business object used to do query<br />

//XmlIn:- The xml to be used in query<br />

//*******************************************************<br />

//Returns:- The XML returned by the business object.<br />

//*******************************************************<br />

string <strong>Syspro</strong>Query(string Uid, string BusObject, \<br />

string XmlIn) {<br />

string xmlOut;<br />

Encore.Query EncoreQuery = new Encore.Query();<br />

xmlOut = EncoreQuery.Query(Uid, BusObject, XmlIn);<br />

EncoreQuery = null;<br />

return xmlOut;<br />

}<br />

As you can see, the functions are fairly simple. At this stage of programming we are not<br />

worried about building Xml strings or creating or using a UserID. Other parts of the<br />

application will create and maintain these variables. The next sample code presents the<br />

function using the Transaction.Build method.<br />

10–21

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

Saved successfully!

Ooh no, something went wrong!