USP_DATAFORMTEMPLATE_EDITLOAD_COPYITINERARY
The load procedure used by the edit dataform template "Copy Itinerary 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. |
@THISID | uniqueidentifier | INOUT | |
@RESERVATIONID | uniqueidentifier | INOUT | Reservation |
@COPYITINERARYID | uniqueidentifier | INOUT | Itinerary |
@ITEMSEXIST | bit | INOUT | |
@NAME | nvarchar(100) | INOUT | |
@IGNORECONFLICTS | bit | INOUT | Ignore itinerary resource conflicts when saving |
@ARRIVALDATE | datetime | INOUT | Arrival date |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_COPYITINERARY
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@TSLONG bigint = 0 output,
@THISID uniqueidentifier = null output,
@RESERVATIONID uniqueidentifier = null output,
@COPYITINERARYID uniqueidentifier = null output,
@ITEMSEXIST bit = null output,
@NAME nvarchar(100) = null output,
@IGNORECONFLICTS bit = null output,
@ARRIVALDATE datetime = null output
)
as
set @ITEMSEXIST = 0
set @THISID = @ID
set nocount on;
set @DATALOADED = 0
set @TSLONG = 0
select
@DATALOADED = 1,
@TSLONG = ITINERARY.TSLONG,
@RESERVATIONID = ITINERARY.RESERVATIONID,
@NAME = ITINERARY.NAME,
@IGNORECONFLICTS = 0,
@ARRIVALDATE = RESERVATION.ARRIVALDATE
from dbo.ITINERARY
inner join dbo.RESERVATION
on ITINERARY.RESERVATIONID = RESERVATION.ID
where ITINERARY.ID = @ID
if exists (select 1 from dbo.ITINERARYITEM where ITINERARYID = @ID)
set @ITEMSEXIST = 1
return 0;