<cfcomponent>
<!--- this function runs sql and returns a data table --->
<cffunction name="getDataTable" access="private" returntype="any" output="false">
<cfargument name="sql" type="string" required="true">
<cfset var path = expandPath('./BenefitsOnlineData.dll')>
<cfset var theDLL = createObject("dotnet", "BenefitsOnlineData.BenefitsOnlineData", path )>
<cfset var dataTable = theDLL.GetDataTable( arguments.sql )>
<cfreturn dataTable>
</cffunction>
<!--- get data from an employee table --->
<cffunction name="getEmployeeData" access="remote" output="false">
<!--- standard parameters generated by CFGRID --->
<cfargument name="page" required="yes">
<cfargument name="pageSize" required="yes">
<cfargument name="gridsortcolumn" required="yes">
<cfargument name="gridsortdirection" required="yes">
<cfset var sql = "SELECT FirstName, LastName FROM EmployeeTable">
<cfset var dataTable = getDataTable( sql )>
<!--- convert it to a format cfgrid can interpret and return the results --->
<cfreturn queryconvertforgrid(dataTable, arguments.page, arguments.pagesize ) />
</cffunction>
</cfcomponent>
|