DROP PROCEDURE  IF EXISTS uspGetErettsegiTipusokForComboBox 
GO

CREATE PROCEDURE uspGetErettsegiTipusokForComboBox
@pIntezmenyId INT
  ,@pTanevId INT
AS
BEGIN
  SET NOCOUNT ON;

  SELECT Tipus.ID ID
    ,DictionaryItem.C_NAME Nev
  FROM T_ERETTSEGITIPUS_OSSZES Tipus
  LEFT JOIN T_DICTIONARYITEMBASE_OSSZES DictionaryItem ON DictionaryItem.ID = Tipus.ID
    AND DictionaryItem.TOROLT = 'F'
  WHERE Tipus.TOROLT = 'F'
    AND Tipus.C_ALINTEZMENYID = @pIntezmenyId
    AND Tipus.C_ALTANEVID = @pTanevId
    AND DictionaryItem.C_TANEVID = @pTanevId
  ORDER BY DictionaryItem.C_ORDER ASC
    ,Nev ASC
END
GO


