<cfcomponent displayName="UI">
<cffunction name="getCategories" access="package" returntype="query">
<!--- getCategories body --->
<cfquery name="rsCategories" datasource="Northwind"
cachedwithin=#CreateTimeSpan(7,0,0,0)#>
SELECT CategoryID, CategoryName FROM Categories
</cfquery>
<cfreturn rsCategories />
</cffunction>
<cffunction name="getSuppliers" access="package" returntype="query">
<!--- getSuppliers body --->
<cfquery name="rsSuppliers" datasource="Northwind"
cachedwithin=#CreateTimeSpan(7,0,0,0)#>
SELECT SupplierID, CompanyName FROM Suppliers
</cfquery>
<cfreturn rsSuppliers />
</cffunction>
<cffunction name="getRegions" access="package" returntype="query">
<!--- getRegions body --->
<cfquery name="rsRegions" datasource="Northwind"
cachedwithin=#CreateTimeSpan(7,0,0,0)#>
SELECT RegionID, RegionDescription FROM Region
</cfquery>
<cfreturn rsRegions />
</cffunction>
<cffunction name="getEmployees" access="package" returntype="query">
<!--- getEmployees body --->
<cfquery name="rsEmployees" datasource="Northwind"
cachedwithin=#CreateTimeSpan(7,0,0,0)#>
SELECT EmployeeID, LastName + ', ' + FirstName as EmployeeName FROM
Employees
</cfquery>
<cfreturn rsEmployees />
</cffunction>
<cffunction name="getAll" access="remote" returntype="struct">
<!--- getAll body --->
<cfscript>
returnObj = StructNew();
returnObj.Categories = this.getCategories();
returnObj.Suppliers = this.getSuppliers();
returnObj.Regions = this.getRegions();
returnObj.Employees = this.getEmployees();
return returnObj;
</cfscript>
</cffunction>
</cfcomponent>