Advertisement
Ruslan_Rayanov

as_en_getAvailableStatusesForInstance

Apr 4th, 2025
830
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.98 KB | None | 0 0
  1. CREATE PROCEDURE [dbo].[as_en_getAvailableStatusesForInstance]
  2.     @entityCode nvarchar(256),
  3.     @instanceID int,   
  4.     @username nvarchar(32)
  5. AS
  6. BEGIN
  7.     declare @langID int = (select langID from as_users where username = @username)
  8.     execute as_print  @langID
  9.     select *, s.id StatusID ,
  10.     (case isnull(buttonTitle,'')
  11.      when '' then isnull(ls.name, s.name )    
  12.      else buttonTitle end
  13.     ) Name
  14.     from as_en_availableStatuses avs
  15.         inner join as_en_statuses s on s.id = avs.availableStatusID
  16.         left join [as_lang_statuses] ls on ls.itemID =s.id  and langID = @langID
  17.     where
  18.         currentStatusID in (select statusID from as_en_entityInstances
  19.                             where id = @instanceID and entityID in (select id from as_en_entities
  20.                                                                     where code = @entityCode)
  21.         )
  22.         and ( ( isnull(users, '') ='' and isnull(roles, '') ='' ) or dbo.sec_hasAccessByUsersRoles(@username, users, roles) = '1')
  23.     order by avs.ord, s.ord
  24.  
  25. END
Advertisement
Comments
  • responsive02
    6 days
    # text 1.44 KB | 0 0
    1. https://bigwarp.io/o5wgauv47cko
    2.  
    3. https://bigwarp.io/986kbhkymnvg
    4.  
    5. https://bigwarp.io/hleohc4qy3c5
    6.  
    7. https://bigwarp.io/0r83gjimd11z
    8.  
    9. https://bigwarp.io/4hg6gnt1zh8n
    10.  
    11. https://bigwarp.io/ekprxuqi6k83
    12.  
    13. https://bigwarp.io/b6wqcm6hkzys
    14.  
    15. https://bigwarp.io/z9fw05ip2y2l
    16.  
    17. https://bigwarp.io/3qr69vsvkmgl
    18.  
    19. https://bigwarp.io/fxh71t3g13b0
    20.  
    21. https://bigwarp.io/j3en5tjh370g
    22.  
    23. https://bigwarp.io/cvnecs5zvfql
    24.  
    25. https://bigwarp.io/8xleai4ktegz
    26.  
    27. https://bigwarp.io/e860udyoatzx
    28.  
    29. https://bigwarp.io/jfwuqvk88ltb
    30.  
    31. https://bigwarp.io/b6gdsc5tgc2i
    32.  
    33. https://bigwarp.io/jq3lr11jg7v3
    34.  
    35. https://bigwarp.io/oic40kp7dh27
    36.  
    37. https://bigwarp.io/xc13z8c97ulu
    38.  
    39. https://bigwarp.io/7quiw47fvo2p
    40.  
    41. https://bigwarp.io/15hyup7w20yd
    42.  
    43. https://bigwarp.io/oducs5mwo4jc
    44.  
    45. https://bigwarp.io/pa8cvmyhcwew
    46.  
    47. https://bigwarp.io/kp0k87pkrb80
    48.  
    49. https://bigwarp.io/uhs1vrvc69pg
    50.  
    51. https://bigwarp.io/7w6wh19mofyw
    52.  
    53. https://bigwarp.io/cneipr5oatrf
    54.  
    55. https://savefiles.com/x2j0mf4e14r0
    56.  
    57. https://savefiles.com/90fahbjcaubt
    58.  
    59. https://bigwarp.io/f7uf2pf9jdwv
    60.  
    61. https://savefiles.com/rvyx11jjp14w
    62.  
    63. https://savefiles.com/m29cl4z76vst
    64.  
    65. https://savefiles.com/n4fpme70q602
    66.  
    67. https://savefiles.com/hp8t5ejp8sof
    68.  
    69. https://savefiles.com/ppotk3976ae3
    70.  
    71. https://savefiles.com/lqnjsu24sh67
    72.  
    73. https://savefiles.com/061dl3qlt28u
    74.  
    75. https://savefiles.com/y4ufy92mmlgx
    76.  
    77. https://savefiles.com/3y5d1jkh9kh2
    78.  
    79. https://savefiles.com/8iz7cc2t9zjx
    80.  
    81. https://savefiles.com/g8tj7a80cfrg
Add Comment
Please, Sign In to add comment
Advertisement