All pastes #281796 Raw Edit

Doc

public text v1 · immutable
#281796 ·published 2006-12-17 01:45 UTC
rendered paste body
<cfcomponent name="AppCustManager.cfc" hint="I am the CFC that handles functionality dealing with the AppCust Settings.">

	<cffunction name="init" hint="AppCust Constructor" access="public" output="false" returntype="appCust.com.AppCustManager">
		<cfreturn this />
	</cffunction>
	
	<cffunction name="getLabs" hint="I get all the labs" access="public" returntype="query" output="false">
		<cfset var local = structNew() />
		<cfquery name="local.qryGetLabs" datasource="#request.dsn#">
			SELECT 	LabID
			FROM		LabDef
			ORDER BY LabID
		</cfquery>
		<cfreturn local.qryGetLabs />
	</cffunction>
	
	<cffunction name="getDefaults" hint="I get all the defaults" access="public" returntype="query" output="false">
		<cfargument name="lab" type="string" required="true" />
		<cfset var local = structNew() />
		<cfquery name="local.qryGetDefaults" datasource="#request.dsn#">
			SELECT 	AD.ID, AD.appCust, AD.Datatype, AD.DefaultValue, AD.Description, AD.Removed, AO.ID as overrideID, AO.appCust, AO.labID, AO.overrideValue 
		 	FROM 		appCustDefaults AD LEFT JOIN (SELECT * FROM appCustOverrides WHERE LabID = <cfqueryparam value="#arguments.lab#" cfsqltype="CF_SQL_VARCHAR">) AO
		 	ON 			AD.appCust = AO.appCust
			WHERE		AD.Removed = 0
		 	ORDER BY AD.AppCust, AO.ID desc, AD.ID, AO.appCust, AD.AppCust ASC
		</cfquery>
		<cfreturn local.qryGetDefaults />
	</cffunction>

	<cffunction name="getOverrides" hint="I get all the overrides" access="public" returntype="query" output="false">
    <cfargument name="lab" type="string" required="true" />
    <cfset var local = structNew() />
    <!--- Call webservice to get all overrides for this lab --->
    <cfinvoke webservice ="http://localhost/Labtest/trunk/lts/com/appCustAdmin.cfc?wsdl" 
              method="getOverrides" 
              lab="#arguments.lab#" 
              returnVariable="local.x">
 
    <cfreturn local.x />
  </cffunction>
	
</cfcomponent>