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.33. Calling the Build Method in ASP.NET C# codebehind<br />

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

//- Build does a build using the special xml string<br />

// provided as input and returns xml/html<br />

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

//Parameters:<br />

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

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

// do query<br />

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

// xsl directive<br />

//'XlTransform:- Parameter will specify if<br />

// server/client side transform is required<br />

//XslIn:- The XLS used to transform the<br />

// incomming xml preferably as a server<br />

// path ie. "c:\......mac.xsl"<br />

//ContentType:- ByRef parameter<br />

// representing the content type to be returned by IIS<br />

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

//Returns:_ Whatever the transform does with<br />

// the xml, used mostly to generate HTML.<br />

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

string Build(string Uid, string BusObject, string XmlIn, \<br />

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

try {<br />

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

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

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

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

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

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

XslIn);<br />

}<br />

else {<br />

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

}<br />

} catch (Exception Exc) {<br />

return "" + Exc.Message + \<br />

" \<br />

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

Saved successfully!

Ooh no, something went wrong!