Advertisement
Ruslan_Rayanov

CREATE PROCEDURE [dbo].[crud_tst-dyntree_getItems]

Oct 24th, 2020
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. CREATE PROCEDURE [dbo].[crud_tst-dyntree_getItems]
  2. @filters CRUDFilterParameter READONLY,
  3. @sort sql_variant,
  4. @direction nvarchar(8),
  5. @page int,
  6. @pageSize int,
  7. @username nvarchar(32)
  8. AS
  9. BEGIN
  10. declare @langID int
  11. select @langID = try_cast(Value as int) from @filters where [Key]='langID'
  12.  
  13. declare @result TABLE (id int, parentID int, name nvarchar(256), data nvarchar(max))
  14.  
  15.  
  16.  
  17. insert into @result
  18. select id, parentID, name, '{"s":1}' data from tst_cats
  19.  
  20. -- 1 SELECT - сами данные 1
  21. select * from @result
  22. order by id desc
  23.  
  24.  
  25. -- 2 SELECT - кол-во в таблице
  26. select count(*)
  27. from @result
  28.  
  29.  
  30. -- 3 SELECT Дополнительные настройки таблицы
  31. select
  32. iif(@langID=1, 'Interactive tree', 'Интерактивное дерево') Title,
  33. 'dynamicTree' ViewType,
  34. '{ "levelDistance": 100, "setCurrentAsRoot": false, "orientation": "top",
  35. "contHeight":"400px",
  36. "itemFormCode": "tst-dynTreeItem",
  37. "itemFormContainer": ".itemFormDetails"
  38. }' dynamicTreeOptions
  39.  
  40.  
  41. -- 4 SELECT Данные для подвала страницы или данные для Ганта/Канбана (если установлен ViewType в 3 SELECT)
  42.  
  43. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement