Guest User

Demo watch drag n drop SP

a guest
Jul 13th, 2023
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 1.54 KB | None | 0 0
  1. CREATE OR ALTER PROCEDURE [dbo].[falcon_dragDrop]
  2.    @parameters ExtendedDictionaryParameter readonly,
  3.     @username nvarchar(256)
  4. AS
  5. BEGIN
  6.     declare @elementItemID int, @elementCode nvarchar(128),
  7.            @containerItemID int, @containerCode nvarchar(128)
  8.     select @elementItemID = try_cast(Value2 as int)
  9.            from @parameters where lower([Key])='elementitemid'
  10.     select @elementCode= Value2
  11.            from @parameters where lower([Key])='elementcode'
  12.     select @containerItemID = try_cast(Value2 as int)
  13.            from @parameters where lower([Key])='containeritemid'
  14.     select @containerCode = Value2
  15.            from @parameters where lower([Key])='containercode'
  16.  
  17.  
  18.  
  19.     declare @actionType nvarchar(128) = case
  20.         when @elementCode= 'copyType' then 'copy'
  21.         when @elementCode= 'moveType' then 'move'
  22.         when @elementCode=  'deleteType' then 'delete'
  23.         when @elementCode= 'backType' then 'back'
  24.     end
  25.  
  26.     if(@elementCode='linkedTable1') begin
  27.         -- SELECT 1
  28.         select 1 Result, '' Msg,
  29.            '' icon, '.linkedForm' RefreshContainer,
  30.            '.linkedForm' ReplaceContainer,
  31.            '<div class="as-form" data-code="watch_linkedForm" data-itemID="'+cast(@elementItemID as nvarchar)+'"></div>' ReplaceContainerHtml,
  32.            'copy' [action] -- move, back, delete, copy
  33.  
  34.         return
  35.     end
  36.  
  37.  
  38.     -- SELECT 1
  39.     select 1 Result, '' Msg,
  40.            'fa-cogs' icon, '' RefreshContainer, '' ReplaceContainer, '' ReplaceContainerHtml,
  41.            isnull(@actionType, 'copy') [action] -- move, back, delete, copy
  42.  
  43.     -- SELECT 2 Outer commands
  44.  
  45. END
  46.  
Advertisement
Add Comment
Please, Sign In to add comment