USP_DATAFORMTEMPLATE_EDITLOAD_EVENTSEATINGSETUP
The load procedure used by the edit dataform template "Event Seating Setup Edit 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. |
@SECTIONCOUNT | int | INOUT | No. of sections |
@SUBSECTIONCOUNT | int | INOUT | No. of tables per section |
@SEATCOUNT | int | INOUT | No. of seats per table |
@SUBSECTIONTYPECODE | tinyint | INOUT | Seating layout |
@SUBSECTIONSUSECONTINUOUSNUMBERING | bit | INOUT | Use continuous numbering |
@SEATSUSECONTINUOUSNUMBERING | bit | INOUT | Use continuous numbering |
@SECTIONS | xml | INOUT | |
@SUBSECTIONS | xml | INOUT | |
@SEATS | xml | INOUT | |
@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. |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_EVENTSEATINGSETUP
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@SECTIONCOUNT int = null output,
@SUBSECTIONCOUNT int = null output,
@SEATCOUNT int = null output,
@SUBSECTIONTYPECODE tinyint = null output,
@SUBSECTIONSUSECONTINUOUSNUMBERING bit = null output,
@SEATSUSECONTINUOUSNUMBERING bit = null output,
@SECTIONS xml = null output,
@SUBSECTIONS xml = null output,
@SEATS xml = null output,
@TSLONG bigint = 0 output
)
as
begin
set nocount on;
set @DATALOADED = 0;
set @TSLONG = 0;
if @ID is not null begin
select
@DATALOADED = 1,
@TSLONG = TSLONG,
@SECTIONCOUNT = SECTIONCOUNT,
@SUBSECTIONCOUNT = SUBSECTIONCOUNT,
@SEATCOUNT = SEATCOUNT,
@SUBSECTIONTYPECODE = SUBSECTIONTYPECODE ,
@SUBSECTIONSUSECONTINUOUSNUMBERING = SUBSECTIONSUSECONTINUOUSNUMBERING,
@SEATSUSECONTINUOUSNUMBERING = SEATSUSECONTINUOUSNUMBERING
from
dbo.EVENTSEATING
where
EVENTSEATING.ID = @ID;
if @DATALOADED = 1 begin
set @SECTIONS = dbo.UFN_EVENTSEATING_GETSECTIONS_TOITEMLISTXML(@ID);
set @SUBSECTIONS = dbo.UFN_EVENTSEATING_GETALLSUBSECTIONS(@ID);
set @SEATS = dbo.UFN_EVENTSEATING_GETALLSEATS(@ID);
end
else
begin
if exists(select ID from dbo.EVENT where EVENT.ID = @ID)
set @DATALOADED = 1;
set @SUBSECTIONTYPECODE = 0;
end
end
else
begin
-- Always return 1 here since this is really more of an add/edit form
-- TODO: this needs to be revisited and should not always return 1
set @DATALOADED = 1;
end
return 0
end