Skip to content

Commit

Permalink
Added Reordering of the DISPLAY_ORDER Columns (#3742)
Browse files Browse the repository at this point in the history
Reordered the display order following the insertion/deletion of the PIMS_DSP_CHKLST_ITEM_TYPE table.
  • Loading branch information
dfilteau authored Jan 25, 2024
1 parent 8d2bf7f commit ad7e621
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Alter the data in the PIMS_DSP_CHKLST_ITEM_TYPE table.
Author Date Comment
------------ ----------- -----------------------------------------------------
Doug Filteau 2024-Jan-10 Initial version
Doug Filteau 2024-Jan-24 Added reordering of display orders
----------------------------------------------------------------------------- */

SET XACT_ABORT ON
Expand All @@ -28,6 +29,12 @@ IF @@ROWCOUNT = 1
DELETE
FROM PIMS_DSP_CHKLST_ITEM_TYPE
WHERE DSP_CHKLST_ITEM_TYPE_CODE = @CurrCd;
-- Reorder the display order of the items that follow 'SGNDXFRPPH'
UPDATE PIMS_DSP_CHKLST_ITEM_TYPE
SET DISPLAY_ORDER = DISPLAY_ORDER - 1
, CONCURRENCY_CONTROL_NUMBER = CONCURRENCY_CONTROL_NUMBER + 1
WHERE DISPLAY_ORDER > 23
AND DSP_CHKLST_SECTION_TYPE_CODE = N'SALEINFO'
END
GO
IF @@ERROR <> 0 SET NOEXEC ON
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Alter the data in the PIMS_DSP_CHKLST_ITEM_TYPE table.
Author Date Comment
------------ ----------- -----------------------------------------------------
Doug Filteau 2024-Jan-10 Initial version
Doug Filteau 2024-Jan-24 Added reordering of display orders
----------------------------------------------------------------------------- */

SET XACT_ABORT ON
Expand All @@ -28,6 +29,12 @@ IF @@ROWCOUNT = 0
INSERT INTO PIMS_DSP_CHKLST_ITEM_TYPE (DSP_CHKLST_SECTION_TYPE_CODE, DSP_CHKLST_ITEM_TYPE_CODE, DESCRIPTION, DISPLAY_ORDER, HINT)
VALUES
(N'DIRCTSAL', N'SGNDXFRPPH', N'Signed Transfer Closed PPH Between Gov. Agencies', 24, 'Signed Transfer of Discontinued and Closed Provincial Public Highway Lands To The Minister Responsible');
-- Reorder the display order of the items that follow 'SGNDXFRPPH'
UPDATE PIMS_DSP_CHKLST_ITEM_TYPE
SET DISPLAY_ORDER = DISPLAY_ORDER + 1
, CONCURRENCY_CONTROL_NUMBER = CONCURRENCY_CONTROL_NUMBER + 1
WHERE DISPLAY_ORDER >= 24
AND DSP_CHKLST_SECTION_TYPE_CODE = N'SALEINFO';
END
GO
IF @@ERROR <> 0 SET NOEXEC ON
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Alter the data in the PIMS_DSP_CHKLST_ITEM_TYPE table.
Author Date Comment
------------ ----------- -----------------------------------------------------
Doug Filteau 2024-Jan-10 Initial version
Doug Filteau 2024-Jan-24 Added reordering of display orders
----------------------------------------------------------------------------- */

SET XACT_ABORT ON
Expand All @@ -28,6 +29,12 @@ IF @@ROWCOUNT = 1
DELETE
FROM PIMS_DSP_CHKLST_ITEM_TYPE
WHERE DSP_CHKLST_ITEM_TYPE_CODE = @CurrCd;
-- Reorder the display order of the items that follow 'SGNDXFRPPH'
UPDATE PIMS_DSP_CHKLST_ITEM_TYPE
SET DISPLAY_ORDER = DISPLAY_ORDER - 1
, CONCURRENCY_CONTROL_NUMBER = CONCURRENCY_CONTROL_NUMBER + 1
WHERE DISPLAY_ORDER > 23
AND DSP_CHKLST_SECTION_TYPE_CODE = N'SALEINFO'
END
GO
IF @@ERROR <> 0 SET NOEXEC ON
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Alter the data in the PIMS_DSP_CHKLST_ITEM_TYPE table.
Author Date Comment
------------ ----------- -----------------------------------------------------
Doug Filteau 2024-Jan-10 Initial version
Doug Filteau 2024-Jan-24 Added reordering of display orders
----------------------------------------------------------------------------- */

SET XACT_ABORT ON
Expand All @@ -28,6 +29,12 @@ IF @@ROWCOUNT = 0
INSERT INTO PIMS_DSP_CHKLST_ITEM_TYPE (DSP_CHKLST_SECTION_TYPE_CODE, DSP_CHKLST_ITEM_TYPE_CODE, DESCRIPTION, DISPLAY_ORDER, HINT)
VALUES
(N'DIRCTSAL', N'SGNDXFRPPH', N'Signed Transfer Closed PPH Between Gov. Agencies', 24, 'Signed Transfer of Discontinued and Closed Provincial Public Highway Lands To The Minister Responsible');
-- Reorder the display order of the items that follow 'SGNDXFRPPH'
UPDATE PIMS_DSP_CHKLST_ITEM_TYPE
SET DISPLAY_ORDER = DISPLAY_ORDER + 1
, CONCURRENCY_CONTROL_NUMBER = CONCURRENCY_CONTROL_NUMBER + 1
WHERE DISPLAY_ORDER >= 24
AND DSP_CHKLST_SECTION_TYPE_CODE = N'SALEINFO';
END
GO
IF @@ERROR <> 0 SET NOEXEC ON
Expand Down

0 comments on commit ad7e621

Please sign in to comment.