USE DAGAZ	
	IF OBJECT_ID('NET_DEL_TIME') IS NOT NULL
		DROP PROC NET_DEL_TIME

	GO
		CREATE PROC NET_DEL_TIME
	(
	  @pCodTime INT = NULL
	, @pType VARCHAR(30) = NULL
	, @pStatus INT = NULL

	)
	AS 
		
		BEGIN
			SET NOCOUNT ON
	
IF @pType = 'DELETE'		
				DELETE FROM 
										NET_TIME
							WHERE     
										((CodTime  = @pCodTime) );
ELSE
				UPDATE 
										NET_TIME
						SET
										Status =CASE WHEN  Status  = 1 THEN 0 ELSE 1 END
							WHERE     
										((CodTime = @pCodTime) );


	SET NOCOUNT OFF 
	END 

