spDelete_PageContent

Parameters

Parameter Parameter Type Mode Description
@PKID int IN
@CurrentUsersID int IN

Definition

Copy

CREATE PROCEDURE [dbo].[spDelete_PageContent]
(
        @PKID        int,
        @CurrentUsersID    int
)
AS
    declare @Guid uniqueidentifier

    declare @ContentOrder int
    declare @PaneName char(256)
    declare @SitePagesID int

    SELECT 
    @SitePagesID = SitePagesID, 
    @PaneName = PaneName, 
    @ContentOrder = ContentOrder 
    FROM PageContent 
    WHERE 
    ID = @PKID

    begin transaction


        delete FROM PageContent where ID = @PKID

        /*
        TRW - 12/06/2005
        We need to fix the contentorders of the pagecontent records
        that are greater than our deleted part. This is necessary
        because the drag and drop functionality of the page designer
        requires the orders to be correct so that it can handle the 
        requests asynchronously. The drag and drop proc will also
        maintain contentorders accordingly.
        */
        UPDATE PageContent
        SET
        ContentOrder = ContentOrder - 1
        WHERE
        SitePagesID = @SitePagesID
        AND
        PaneName = @PaneName
        AND
        ContentOrder > @ContentOrder

        -- SHL BBIS Bug 329266; Need to update the Site Page's update date because the site has been updated
        -- AND the BBSP Pay Template Process needs to know that the page was updated to do its thing
        update dbo.SitePages
        set UpdateDate = GetUTCdate()
        where ID = @SitePagesID;

        /*select @Guid = Guid from ClientUsers where ID = @PKID

        exec spAuditThis @CurrentUsersID, 3, @Guid, 6*/

    commit