USP_DATAFORMTEMPLATE_ADD_REGISTRATION_WAIVER
The save procedure used by the add dataform template "Registration Waiver Add Form".
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | INOUT | The output parameter indicating the ID of the record added. |
@CHANGEAGENTID | uniqueidentifier | IN | Input parameter indicating the ID of the change agent invoking the procedure. |
@EVENTID | uniqueidentifier | IN | Event |
@WAIVERTEXT | nvarchar(max) | IN | Waiver Text |
@ISCURRENT | bit | IN | Current waiver |
@SEQUENCE | int | IN | Sequence |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_ADD_REGISTRATION_WAIVER
(
@ID uniqueidentifier = null output,
@CHANGEAGENTID uniqueidentifier = null,
@EVENTID uniqueidentifier = null,
@WAIVERTEXT nvarchar(max) = 'Enter your organization?s waiver statement',
@ISCURRENT bit = 1,
@SEQUENCE int = 0
)
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_DATAFORMTEMPLATE_VIEW_REGISTRATION_WAIVER @ID=@EVENTID, @SEQUENCE=@SEQUENCE output
-- handle inserting the data
insert into dbo.REGISTRATIONWAIVER
(ID, EVENTID, WAIVERTEXT, ADDEDBYID, CHANGEDBYID, DATEADDED, DATECHANGED, ISCURRENT, SEQUENCE)
values
(@ID, @EVENTID, @WAIVERTEXT, @CHANGEAGENTID, @CHANGEAGENTID, @CURRENTDATE, @CURRENTDATE, @ISCURRENT, @SEQUENCE+1)
end try
begin catch
exec dbo.USP_RAISE_ERROR
return 1
end catch
return 0