USP_DATAFORMTEMPLATE_EDIT_ITINERARYITEMEVENT

The save procedure used by the edit dataform template "Itinerary Item Event Edit Data Form".

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN The input ID parameter indicating the ID of the record being edited.
@CHANGEAGENTID uniqueidentifier IN Input parameter indicating the ID of the change agent invoking the procedure.
@ITINERARYID uniqueidentifier IN Itinerary ID
@EVENTID uniqueidentifier IN Event
@ITINERARYITEMSTARTTIME UDT_HOURMINUTE IN Start time
@ITINERARYITEMENDTIME UDT_HOURMINUTE IN End time
@ITINERARYITEMSTARTDATE datetime IN Start date
@ITINERARYITEMENDDATE datetime IN End date
@BLOCKEVENT bit IN Mark event unavailable to other groups
@NOTES nvarchar(500) IN Notes
@RESOURCES xml IN Supplies/Equipment resources
@IGNORECONFLICTS bit IN Ignore conflicts when saving
@STAFFRESOURCES xml IN Staffing resources

Definition

Copy


                CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDIT_ITINERARYITEMEVENT
                (
                    @ID uniqueidentifier,
                    @CHANGEAGENTID uniqueidentifier = null,
                    @ITINERARYID uniqueidentifier,
                    @EVENTID uniqueidentifier,
                    @ITINERARYITEMSTARTTIME dbo.UDT_HOURMINUTE,
                    @ITINERARYITEMENDTIME dbo.UDT_HOURMINUTE,
                    @ITINERARYITEMSTARTDATE datetime,
                    @ITINERARYITEMENDDATE datetime,
                    @BLOCKEVENT bit,
                    @NOTES nvarchar(500),
                    @RESOURCES xml,
                    @IGNORECONFLICTS bit,
                    @STAFFRESOURCES xml
                )
                as
                    set nocount on;

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

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

                    begin try
                        exec dbo.USP_ITINERARYITEMEVENT_EDIT
                            @ID,
                            @CHANGEAGENTID,
                            @ITINERARYID,
                            null,
                            @EVENTID,
                            @ITINERARYITEMSTARTTIME,
                            @ITINERARYITEMENDTIME,
                            @ITINERARYITEMSTARTDATE,
                            @ITINERARYITEMENDDATE,
                            @BLOCKEVENT,
                            @NOTES,
                            @RESOURCES,
                            @IGNORECONFLICTS,
                            @STAFFRESOURCES;
                    end try

                    begin catch
                        exec dbo.USP_RAISE_ERROR
                        return 1
                    end catch

                    return 0;