USP_DATAFORMTEMPLATE_EDITLOAD_EVENTPRICELIST
The load procedure used by the edit dataform template "Event Price List Edit Data 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. |
@TSLONG | bigint | INOUT | Output parameter indicating the TSLONG value of the record being edited. This is used to manage multi-user concurrency issues when multiple users access the same record. |
@NAME | nvarchar(100) | INOUT | Name |
@ISCUSTOM | bit | INOUT | Create custom prices for this event |
@PRICES | xml | INOUT | Prices |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_EVENTPRICELIST
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@TSLONG bigint = 0 output,
@NAME nvarchar(100) = null output,
@ISCUSTOM bit = null output,
@PRICES xml = null output
)
as
set nocount on;
set @DATALOADED = 0
set @TSLONG = 0
select
@DATALOADED = 1,
@TSLONG = TSLONG,
@NAME = NAME
from dbo.EVENT
where ID = @ID
set @PRICES = dbo.UFN_EVENT_GETEVENTPRICES_TOITEMLISTXML(@ID);
if @PRICES is null
begin
set @ISCUSTOM = 0;
declare @PROGRAMID uniqueidentifier;
select @PROGRAMID = PROGRAMID from dbo.EVENT where ID = @ID;
set @PRICES = (select newid() as [ID], [PRICETYPECODEID], [FACEPRICE], [SEQUENCE]
from dbo.[UFN_PROGRAM_GETPRICES](@PROGRAMID)
order by SEQUENCE
for xml raw('ITEM'),type,elements,root('PRICES'),BINARY BASE64);
end
else
begin
set @ISCUSTOM = 1;
end
return 0;