USP_DATAFORMTEMPLATE_EDIT_REGISTRANTUNIFIED_2

The save procedure used by the edit dataform template "Registrant Unified Edit Form".

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN The input ID parameter indicating the ID of the record being edited.
@CURRENTAPPUSERID uniqueidentifier IN Input parameter indicating the ID of the current user.
@CHANGEAGENTID uniqueidentifier IN Input parameter indicating the ID of the change agent invoking the procedure.
@DATEPURCHASED datetime IN Date
@PACKAGEREGISTRATIONS xml IN Packages
@PACKAGESPRICES xml IN
@SINGLEEVENTREGISTRATIONS xml IN Single events
@WAIVEBENEFITS bit IN Waive benefits
@REGISTRANTMAPPINGS xml IN Guests
@DELETEDREGISTRANTREGISTRATIONMAPS xml IN Deleted registrant registration mappings
@REGISTRATIONTYPECODE tinyint IN

Definition

Copy


                    CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDIT_REGISTRANTUNIFIED_2
                    (
                        @ID uniqueidentifier,
                        @CURRENTAPPUSERID uniqueidentifier,
                        @CHANGEAGENTID uniqueidentifier = null,
                        @DATEPURCHASED datetime,
                        @PACKAGEREGISTRATIONS xml,
                        @PACKAGESPRICES xml,
                        @SINGLEEVENTREGISTRATIONS xml,
                        @WAIVEBENEFITS bit,
                        @REGISTRANTMAPPINGS xml,
                        @DELETEDREGISTRANTREGISTRATIONMAPS xml,
            @REGISTRATIONTYPECODE tinyint
                    )
                    as
                        set nocount on;

                        declare @CURRENTDATE datetime;

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

                        set @CURRENTDATE = getdate();

                        declare @EVENTID uniqueidentifier;
                        declare @CONSTITUENTID uniqueidentifier;

                        select
                            @ID = coalesce(REGISTRANT.GUESTOFREGISTRANTID, REGISTRANT.ID), --Get the host if the selected ID is for a guest

                            @EVENTID = REGISTRANT.EVENTID,
                            @CONSTITUENTID = REGISTRANT.CONSTITUENTID
                        from
                            dbo.REGISTRANT
                        where
                            REGISTRANT.ID = @ID;

                        begin try
                            exec dbo.USP_REGISTRANT_UNIFIEDUPDATE
                                @ID = @ID output,
                                @CURRENTAPPUSERID = @CURRENTAPPUSERID,
                                @SECURITYCONTEXTFORMINSTANCEID = '39530e0b-d3b3-4d17-b36a-4772da0e195f', --Data form instance ID for this for

                                @CHANGEAGENTID = @CHANGEAGENTID,
                                @CURRENTDATE = @CURRENTDATE,
                                @EVENTID = @EVENTID,
                                @CONSTITUENTID = @CONSTITUENTID,
                                @DATEPURCHASED = @DATEPURCHASED,
                                @PACKAGEREGISTRATIONS = @PACKAGEREGISTRATIONS,
                                @PACKAGESPRICES = @PACKAGESPRICES,
                                @SINGLEEVENTREGISTRATIONS = @SINGLEEVENTREGISTRATIONS,
                                @WAIVEBENEFITS = @WAIVEBENEFITS,
                                @REGISTRANTMAPPINGS = @REGISTRANTMAPPINGS,
                                @DELETEDREGISTRANTREGISTRATIONMAPS = @DELETEDREGISTRANTREGISTRATIONMAPS,
                                @ISADD = 0,
                @ISWALKIN = @REGISTRATIONTYPECODE;
                        end try

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

                        return 0;