USP_DATAFORMTEMPLATE_EDIT_FAF_COMMENTS
The save procedure used by the edit dataform template "FAF Comments Edit 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. |
@EVENTID | uniqueidentifier | IN | Event |
@TEAMFUNDRAISINGTEAMID | uniqueidentifier | IN | Teamfundraisingteam |
@REGISTRANTID | uniqueidentifier | IN | Registrant |
@CLIENTUSERSID | int | IN | Clientusers |
@AUTHORNAME | nvarchar(255) | IN | Authorname |
@COMMENTTEXT | nvarchar(1000) | IN | Commenttext |
@LIKECOUNT | int | IN | Likecount |
@DISLIKECOUNT | int | IN | Dislikecount |
@ROOTCOMMENTID | uniqueidentifier | IN | Rootcomment |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDIT_FAF_COMMENTS
(
@ID uniqueidentifier,
@CHANGEAGENTID uniqueidentifier = null,
@EVENTID uniqueidentifier,
@TEAMFUNDRAISINGTEAMID uniqueidentifier,
@REGISTRANTID uniqueidentifier,
@CLIENTUSERSID int,
@AUTHORNAME nvarchar(255),
@COMMENTTEXT nvarchar(1000),
@LIKECOUNT int,
@DISLIKECOUNT int,
@ROOTCOMMENTID uniqueidentifier
)
as
set nocount on;
if @CHANGEAGENTID is null
exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output
begin try
-- handle updating the data
update dbo.FAFCOMMENTS set
EVENTID = @EVENTID,
TEAMFUNDRAISINGTEAMID = @TEAMFUNDRAISINGTEAMID,
REGISTRANTID = @REGISTRANTID,
CLIENTUSERSID = @CLIENTUSERSID,
AUTHORNAME = @AUTHORNAME,
COMMENTTEXT = @COMMENTTEXT,
LIKECOUNT = @LIKECOUNT,
DISLIKECOUNT = @DISLIKECOUNT,
ROOTCOMMENTID = @ROOTCOMMENTID,
CHANGEDBYID = @CHANGEAGENTID,
DATECHANGED = getdate()
where ID = @ID
end try
begin catch
exec dbo.USP_RAISE_ERROR
return 1
end catch
return 0;