﻿/****** Object:  StoredProcedure [dbo].[sp_SetAktivCsengetesiRend]    Script Date: 2016. 05. 31. 9:40:56 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

-- =============================================
-- Author:		Hoffmann Zsolt
-- Create date: 2015-11-25
-- Description:	Aktív csengetésirend beállítás
-- =============================================
CREATE PROCEDURE [sp_SetAktivCsengetesiRend]
	@CsengrendID int,
	@Aktival bit
AS
BEGIN

	SET NOCOUNT ON;

	IF (@Aktival = 1)
	BEGIN
		update [T_CSENGETESIREND] set [C_AKTIV] = 'F';

		update [T_CSENGETESIREND] set [C_AKTIV] = 'T' where [ID] = @CsengrendID;
	END
	ELSE
	BEGIN
		update [T_CSENGETESIREND] set [C_AKTIV] = 'F' where [ID] = @CsengrendID;
	END
END
