USP_DATAFORMTEMPLATE_ADD_ITINERARYITEMCUSTOMITEM

The save procedure used by the add dataform template "Itinerary Item Custom Item Add Data Form".

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier INOUT The output parameter indicating the ID of the record added.
@ITINERARYID uniqueidentifier IN Input parameter indicating the context ID for the record being added.
@CHANGEAGENTID uniqueidentifier IN Input parameter indicating the ID of the change agent invoking the procedure.
@NAME nvarchar(100) IN Name
@STARTDATE date IN Start date
@ENDDATE date IN End date
@STARTTIME UDT_HOURMINUTE IN Start time
@ENDTIME UDT_HOURMINUTE IN End time
@NOTES nvarchar(500) IN Notes
@LOCATIONID uniqueidentifier IN Location
@MARKLOCATIONBUSY bit IN Mark location unavailable to other groups
@RESOURCES xml IN Supplies/Equipment resources
@IGNORECONFLICTS bit IN Ignore conflicts when saving
@STAFFRESOURCES xml IN Staffing resources
@LOCATIONPRICE money IN Price

Definition

Copy

                CREATE procedure dbo.USP_DATAFORMTEMPLATE_ADD_ITINERARYITEMCUSTOMITEM
                (
                    @ID uniqueidentifier = null output,
                    @ITINERARYID uniqueidentifier,
                    @CHANGEAGENTID uniqueidentifier = null,
                    @NAME nvarchar(100) = null,
                    @STARTDATE date = null,
                    @ENDDATE date = null,
                    @STARTTIME dbo.UDT_HOURMINUTE = null,
                    @ENDTIME dbo.UDT_HOURMINUTE = null,
                    @NOTES nvarchar(500) = null,
                    @LOCATIONID uniqueidentifier = null,
                    @MARKLOCATIONBUSY bit = null,
                    @RESOURCES xml = null,
                    @IGNORECONFLICTS bit = null,
                    @STAFFRESOURCES xml = null,
                    @LOCATIONPRICE money = null
                )
                as

                set nocount on;

                if @ID is null
                    set @ID = newid()

                if @CHANGEAGENTID is null  
                    exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output

                declare @CURRENTDATE datetime
                    set @CURRENTDATE = getdate()

                begin try

                    exec dbo.USP_ITINERARYITEMCUSTOMITEM_ADD @ID, @CHANGEAGENTID, @CURRENTDATE, @ITINERARYID,
                        @NAME, @STARTDATE, @ENDDATE, @STARTTIME, @ENDTIME, @NOTES, @LOCATIONID,
                        @MARKLOCATIONBUSY, @RESOURCES, @IGNORECONFLICTS, @STAFFRESOURCES, @LOCATIONPRICE;

                end try
                begin catch
                    exec dbo.USP_RAISE_ERROR
                    return 1
                end catch

                return 0