spAddUpdate_SharingPart

Parameters

Parameter Parameter Type Mode Description
@PKID int INOUT
@SiteContentID int IN
@CurrentUsersID int IN
@SharingCaption nvarchar(100) IN
@EmailTemplateID int IN
@ShowEmail bit IN
@ShowDelicious bit IN
@ShowDigg bit IN
@ShowFacebook bit IN
@ShowNewsvine bit IN
@ShowYahoo bit IN
@Guid uniqueidentifier IN

Definition

Copy


            CREATE PROCEDURE [dbo].[spAddUpdate_SharingPart]
            (
                @PKID                int output,
                @SiteContentID        int,    
                @CurrentUsersID        int,
                @SharingCaption        nvarchar(100)    ,
                @EmailTemplateID    int,
                @ShowEmail            bit,
                @ShowDelicious        bit,
                @ShowDigg            bit,
                @ShowFacebook        bit,
                @ShowNewsvine        bit,
                @ShowYahoo            bit,
                @Guid                uniqueidentifier
            )
            AS

            begin transaction

            if (@PKID<=0)

            begin

                INSERT INTO SharingPart
                (
                [SiteContentID],
                [CreateID],
                [UpdateID],
                [SharingCaption],
                [EmailTemplateID],
                [ShowEmail],
                [ShowDelicious],
                [ShowDigg],
                [ShowFacebook],
                [ShowNewsvine],
                [ShowYahoo],
                [Guid]
                )
                VALUES
                (
                @SiteContentID,
                @CurrentUsersID,
                @CurrentUsersID,
                @SharingCaption,
                @EmailTemplateID,
                @ShowEmail,
                @ShowDelicious,
                @ShowDigg,
                @ShowFacebook,
                @ShowNewsvine,
                @ShowYahoo,
                @Guid
                )

                SELECT @PKID = @@Identity

                exec spAuditThis @CurrentUsersID, 1, @Guid, 37
            end 
            else 
            begin

                UPDATE SharingPart SET
                    [UpdateDate]        =getutcdate(),
                    [UpdateID]            =@CurrentUsersID,
                    [SharingCaption]    =@SharingCaption,
                    [ShowEmail]            =@ShowEmail,
                    [ShowDelicious]        =@ShowDelicious,
                    [ShowDigg]            =@ShowDigg,
                    [ShowFacebook]        =@ShowFacebook,
                    [ShowNewsvine]        =@ShowNewsvine,
                    [ShowYahoo]            =@ShowYahoo,
                    [EmailTemplateID]    =@EmailTemplateID
                WHERE ID=@PKID

                exec spAuditThis @CurrentUsersID, 2, @Guid, 37
            end

            commit transaction