SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'WMAN_Impresoras_GetInfo') )
DROP PROCEDURE WMAN_Impresoras_GetInfo
GO

CREATE PROCEDURE WMAN_Impresoras_GetInfo
AS
BEGIN

	SELECT id_repo, id_repo Id2, descripcion, tipo_impresora, id_papel 
	FROM   SECUREPO
	ORDER BY id_repo

	RETURN

END
GO

---------------------------------------------------------------------------------
---------------------------------------------------------------------------------

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'WMAN_Impresoras_PutInfo') )
DROP PROCEDURE WMAN_Impresoras_PutInfo
GO

CREATE PROCEDURE WMAN_Impresoras_PutInfo
	@id_repo INT,
	@tipo_impresora INT,
	@id_papel INT
AS
BEGIN
	DECLARE @MensajeError VARCHAR(255) = ''

	-- Editar

	UPDATE SECUREPO
	SET    tipo_impresora = @tipo_impresora,
		   id_papel = @id_papel
	WHERE  id_repo = @id_repo

	SELECT @id_repo AS Id
	
	RETURN

	ERROR:
		RAISERROR (@MensajeError, 16, 1)

END
GO