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 />

Example 10.13. Transaction.Post Method in ASP.NET C# codebehind<br />

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

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

// Post business object<br />

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

//Parameters:<br />

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

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

//XmlParam:- The parameter xml to be used in post<br />

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

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

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

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

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

XmlParam, string XmlIn) {<br />

string xmlOut;<br />

Encore.Transaction EncorePost = new Encore.Transaction();<br />

xmlOut=EncorePost.Post(Uid, BusObject, XmlParam, XmlIn);<br />

EncorePost = null;<br />

return xmlOut;<br />

}<br />

The Transaction.Post method also uses the Xml Parameter (XmlParam), but in many cases<br />

it is left empty. The following Setup and Transaction functions will also include the<br />

XmlParam variable so that it can be used within the application.<br />

We will now look at sample function code for the Setup Class methods - Add, Update, and<br />

Delete.<br />

10–25

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

Saved successfully!

Ooh no, something went wrong!