USP_DATAFORMTEMPLATE_ADD_BBNCEVENTREGISTRATIONBATCHROW

The save procedure used by the add dataform template "NetCommunity Event Registration Batch Row Add Form".

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier INOUT The output parameter indicating the ID of the record added.
@BATCHID 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.
@DONORID uniqueidentifier IN Linked constituent
@LOGGEDINUSER bit IN Blackbaud Internet Solutions user was logged in
@NETCOMMUNITYTRANSACTIONPROCESSORID uniqueidentifier IN Processor
@BBNCTRANID int IN Blackbaud Internet Solutions transaction ID
@ADDEDBY nvarchar(255) IN Added by hidden
@BBNCDONORNAME nvarchar(154) IN Blackbaud Internet Solutions donor name
@REGISTRATIONDATE datetime IN Date
@DONORINFORMATION xml IN Biographical
@DONORADDRESSINFORMATION xml IN Billing address
@DONORADDRESSUPDATE bit IN Address update
@DONORADDRESSADD bit IN Address add
@DONORADDRESSMAKEPRIMARY bit IN Make this new address the primary address
@DONORADDRESSTYPECODEID uniqueidentifier IN Previous address type
@PHONETYPES xml IN Phone type codes hidden
@REGISTRATIONS xml IN Registrations
@GUESTS xml IN Guests
@GIFTINFORMATION xml IN Gift information
@ORIGINPAGENAME nvarchar(1000) IN Blackbaud Internet Solutions page name hidden
@ORIGINPAGEID int IN Blackbaud Internet Solutions page ID hidden
@SEQUENCE int IN Sequence
@DONORADDRESSINFORMATIONALLFIELDS xml IN Billing address all fields
@DONORIDAUTOMATCH nvarchar(255) IN Linked constituent auto-match
@BBNCID int IN Blackbaud Internet Solutions ID
@DONORINFORMATIONALLFIELDS xml IN Biographical all fields
@ORIGINALDONORID uniqueidentifier IN Original donor ID
@DONORSECURITYID uniqueidentifier IN Donor constituent security group
@GUESTSECURITYID uniqueidentifier IN Donor constituent security group
@DONORSITEID uniqueidentifier IN Donor site
@GUESTSITEID uniqueidentifier IN Guest site
@ADDITIONALDONATION xml IN Additional Donation
@UNPAIDEVENTREGISTRATIONPAYMENT bit IN Unpaid event registration payment
@PDACCOUNTSYSTEMID uniqueidentifier IN Account system
@ATTRIBUTECURRENCYID uniqueidentifier IN Attribute currency
@DONORORGANIZATIONID uniqueidentifier IN
@DONORORGANIZATIONIDAUTOMATCH nvarchar(255) IN
@APPEALCAMPAIGNS xml IN
@BATCHSEPARATION xml IN
@TRANSACTIONSOURCE xml IN
@CONSENT xml IN

Definition

Copy


                    CREATE procedure dbo.USP_DATAFORMTEMPLATE_ADD_BBNCEVENTREGISTRATIONBATCHROW
                    (
                        @ID uniqueidentifier = null output,
                        @BATCHID uniqueidentifier,
                        @CHANGEAGENTID uniqueidentifier,
                        @DONORID uniqueidentifier = null,
                        @LOGGEDINUSER bit,
                        @NETCOMMUNITYTRANSACTIONPROCESSORID uniqueidentifier,
                        @BBNCTRANID int,
                        @ADDEDBY nvarchar(255),
                        @BBNCDONORNAME nvarchar(154),
                        @REGISTRATIONDATE datetime,
                        @DONORINFORMATION xml = null,
                        @DONORADDRESSINFORMATION xml = null,
                        @DONORADDRESSUPDATE bit = 1,
                        @DONORADDRESSADD bit = 0,
                        @DONORADDRESSMAKEPRIMARY bit = 0,
                        @DONORADDRESSTYPECODEID uniqueidentifier = null,
                        @PHONETYPES xml = null,
                        @REGISTRATIONS xml = null,
                        @GUESTS xml = null,
                        @GIFTINFORMATION xml = null,
                        @ORIGINPAGENAME nvarchar(1000) = '',
                        @ORIGINPAGEID int = 0,
                        @SEQUENCE int,
                        @DONORADDRESSINFORMATIONALLFIELDS xml = null,
                        @DONORIDAUTOMATCH nvarchar(255) = null,
                        @BBNCID int = 0,
                        @DONORINFORMATIONALLFIELDS xml = null,
                        @ORIGINALDONORID uniqueidentifier = null,
                        @DONORSECURITYID uniqueidentifier = null,
                        @GUESTSECURITYID uniqueidentifier = null,
                        @DONORSITEID uniqueidentifier = null,
                        @GUESTSITEID uniqueidentifier = null,
                        @ADDITIONALDONATION xml = null,
                        @UNPAIDEVENTREGISTRATIONPAYMENT bit = 0,
                        @PDACCOUNTSYSTEMID uniqueidentifier = null,
                        @ATTRIBUTECURRENCYID uniqueidentifier = null,                        
                        @DONORORGANIZATIONID uniqueidentifier = null,
                        @DONORORGANIZATIONIDAUTOMATCH nvarchar(255) = null,
                        @APPEALCAMPAIGNS XML =null,
                        @BATCHSEPARATION xml = null,
                        @TRANSACTIONSOURCE xml = null,
                        @CONSENT xml = null
                    )
                    as
                        set nocount on;

                        declare @CURRENTDATE datetime;

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

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

                        set @CURRENTDATE = getdate();

                        begin try
                            insert into dbo.BBNCDOWNLOADEDTRANSACTION
                            (
                                [ID]
                            )
                            values
                            (
                                @BBNCID
                            );

                            if @DONORIDAUTOMATCH is null
                                set @DONORIDAUTOMATCH = N'';

                            exec dbo.USP_BBNC_ENCRYPTGIFTDATA @GIFTINFORMATION = @GIFTINFORMATION output, @KEYISALREADYOPEN = 1;

                            declare @UPDATEDGIFTINFORMATION as xml ='<GIFTINFORMATIONS/>';
                            set @UPDATEDGIFTINFORMATION.modify('insert sql:variable("@GIFTINFORMATION") as last into (GIFTINFORMATIONS)[1]') ;
                            set @UPDATEDGIFTINFORMATION.modify('insert sql:variable("@APPEALCAMPAIGNS") as last into (GIFTINFORMATIONS)[1]') ;

                            --Adding batch separation values

                            declare @UPDATEDDONORINFORMATION as xml ='<DONORINFORMATIONS/>';
                            set @UPDATEDDONORINFORMATION.modify('insert sql:variable("@DONORINFORMATION") as last into (DONORINFORMATIONS)[1]') ;
                            set @UPDATEDDONORINFORMATION.modify('insert sql:variable("@BATCHSEPARATION") as last into (DONORINFORMATIONS)[1]') ;
                            set @UPDATEDDONORINFORMATION.modify('insert sql:variable("@TRANSACTIONSOURCE") as last into (DONORINFORMATIONS)[1]') ;
                            insert into    dbo.BATCHBBNCEVENTREGISTRATION
                            (
                                [ID], 
                                [BATCHID],
                                [DONORID],
                                [LOGGEDINUSER],
                                [NETCOMMUNITYTRANSACTIONPROCESSORID],
                                [BBNCID],
                                [BBNCTRANID],
                                [ADDEDBY],
                                [BBNCDONORNAME],
                                [REGISTRATIONDATE],
                                [DONORINFORMATION],
                                [DONORINFORMATIONALLFIELDS],
                                [DONORADDRESSINFORMATION],
                                [DONORADDRESSINFORMATIONALLFIELDS],
                                [DONORADDRESSUPDATE],
                                [DONORADDRESSADD],
                                [DONORADDRESSMAKEPRIMARY],
                                [DONORADDRESSTYPECODEID],
                                [PHONETYPES],
                                [REGISTRATIONS],
                                [GUESTS],
                                [GIFTINFORMATION],
                                [ORIGINPAGENAME],
                                [ORIGINPAGEID],
                                [DONORIDAUTOMATCH],
                                [DONORSECURITYID],
                                [GUESTSECURITYID],
                                [DONORSITEID],
                                [GUESTSITEID],
                                [SEQUENCE],
                                [ADDEDBYID],
                                [CHANGEDBYID],
                                [DATEADDED],
                                [DATECHANGED],
                                [ADDITIONALDONATION],
                                [UNPAIDEVENTREGISTRATIONPAYMENT],
                                [PDACCOUNTSYSTEMID],
                                [ATTRIBUTECURRENCYID],
                                [CONSENT]
                            )
                            values
                            (
                                @ID,
                                @BATCHID,
                                @DONORID,
                                @LOGGEDINUSER,
                                @NETCOMMUNITYTRANSACTIONPROCESSORID,
                                @BBNCID,
                                @BBNCTRANID,
                                @ADDEDBY,
                                @BBNCDONORNAME,
                                @REGISTRATIONDATE,
                                @UPDATEDDONORINFORMATION,
                                @DONORINFORMATIONALLFIELDS,
                                @DONORADDRESSINFORMATION,
                                @DONORADDRESSINFORMATIONALLFIELDS,
                                @DONORADDRESSUPDATE,
                                @DONORADDRESSADD,
                                @DONORADDRESSMAKEPRIMARY,
                                @DONORADDRESSTYPECODEID,
                                @PHONETYPES,
                                @REGISTRATIONS,
                                @GUESTS,
                                @UPDATEDGIFTINFORMATION,
                                @ORIGINPAGENAME,
                                @ORIGINPAGEID,
                                @DONORIDAUTOMATCH,
                                @DONORSECURITYID,
                                @GUESTSECURITYID,
                                @DONORSITEID,
                                @GUESTSITEID,
                                @SEQUENCE,
                                @CHANGEAGENTID,
                                @CHANGEAGENTID,
                                @CURRENTDATE,
                                @CURRENTDATE,
                                @ADDITIONALDONATION,
                                @UNPAIDEVENTREGISTRATIONPAYMENT,
                                @PDACCOUNTSYSTEMID,
                                @ATTRIBUTECURRENCYID,
                                @CONSENT
                            );

                            delete from dbo.BBNCUNSUCCESSFULDOWNLOADTRANSACTION
                            where
                                ID = @BBNCID;

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

                        return 0;