USP_DATAFORMTEMPLATE_VIEW_REGISTRANTCOST
The load procedure used by the view dataform template "Registrant Cost View Form"
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN | The input ID parameter used to load the fields defined on the form. |
@DATALOADED | bit | INOUT | Output parameter indicating whether or not data was actually loaded. |
@COST | money | INOUT | COST |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_VIEW_REGISTRANTCOST
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@COST money = null output
)
as
set nocount on;
select
@DATALOADED = 1,
@COST = coalesce(EVENTPRICE.COST, 0) * coalesce(REGISTRANTREGISTRATION.QUANTITY, 0)
from dbo.REGISTRANTREGISTRATION
inner join dbo.EVENTPRICE on EVENTPRICE.ID = REGISTRANTREGISTRATION.EVENTPRICEID
where REGISTRANTREGISTRATION.REGISTRANTID = @ID
if not @DATALOADED = 1
select
@DATALOADED = 1,
@COST = 0;