Fixed logic to add ROImages so that adding a duplicate record will not cause the code to crash.

Fixed the layout of the Tag Panel so that the Step Type can be changed,
This commit is contained in:
Rich
2015-07-23 16:25:26 +00:00
parent 5f117cf611
commit 03d5bb04f8
2 changed files with 116 additions and 57 deletions

View File

@@ -10850,7 +10850,6 @@ GO
IF (@@Error = 0) PRINT 'Procedure Creation: vesp_ListItemsAfterLastChanged Succeeded'
ELSE PRINT 'Procedure Creation: vesp_ListItemsAfterLastChanged Error on Creation'
GO
GO
/****** Object: StoredProcedure [ve_GetShortPath] ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[ve_GetShortPath]') AND OBJECTPROPERTY(id,N'IsScalarFunction') = 1)
@@ -10934,4 +10933,66 @@ GO
IF (@@Error = 0) PRINT 'ScalarFunction Creation: ve_GetShortPath Succeeded'
ELSE PRINT 'ScalarFunction Creation: ve_GetShortPath Error on Creation'
GO
PRINT '20150616 - Uses VarChar(4) for Siblings!'
/****** Object: StoredProcedure [addROImage] ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[addROImage]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE addROImage;
GO
/*****************************************************************************
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
Copyright 2012 - Volian Enterprises, Inc. All rights reserved.
*****************************************************************************/
CREATE PROCEDURE [dbo].[addROImage]
(
@RODbID int,
@FileName nvarchar(255),
@Content varbinary(MAX),
@Config nvarchar(MAX)=null,
@DTS datetime,
@UserID nvarchar(100),
@newImageID int output,
@newLastChanged timestamp output
)
WITH EXECUTE AS OWNER
AS
BEGIN TRY -- Try Block
BEGIN TRANSACTION
IF exists(select * from ROImages where @rodbid = rodbid and @FileName=FileName and @DTS = DTS)
BEGIN
select @newImageID = ImageID from ROImages where @rodbid = rodbid and @FileName=FileName and @DTS = DTS
END
ELSE
BEGIN
INSERT INTO [ROImages]
(
[RODbID],
[FileName],
[Content],
[Config],
[DTS],
[UserID]
)
VALUES
(
@RODbID,
@FileName,
@Content,
@Config,
@DTS,
@UserID
)
SELECT @newImageID= SCOPE_IDENTITY()
END
SELECT @newLastChanged=[LastChanged]
FROM [ROImages] WHERE [ImageID]=@newImageID
IF( @@TRANCOUNT > 0 ) COMMIT
END TRY
BEGIN CATCH -- Catch Block
IF( @@TRANCOUNT = 1 ) ROLLBACK -- Only rollback if top level
ELSE IF( @@TRANCOUNT > 1 ) COMMIT -- Otherwise commit. Top level will rollback
EXEC vlnErrorHandler
END CATCH
IF (@@Error = 0) PRINT 'Procedure Creation: addROImage Succeeded'
ELSE PRINT 'Procedure Creation: addROImage Error on Creation'
GO
PRINT '20150722 Fixed AddROImage for WCN'