-- ================================================================================================================
-- Stored Procedures generated by LLBLGen v1.21.2003.712 Final on Sonntag, 4. Februar 2018, 11:23:59
-- For the Low Level Business Logic Layer for the database 'tim'
-- ================================================================================================================
SET NOCOUNT ON
GO
USE [tim]
GO

-- ========================================================================================================
-- [Stored Procedures generated for table:  Parameter]
GO

-- //// Insert Stored procedure.
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[pr_Parameter_Insert]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[pr_Parameter_Insert]
GO

---------------------------------------------------------------------------------
-- Stored procedure that will insert 1 row in the table 'Parameter'
-- Gets: @iParameterNR int
-- Gets: @sBezeichnung varchar(255)
-- Gets: @sInhalt varchar(1024)
-- Gets: @baktiv bit
-- Gets: @daerstellt_am datetime
-- Gets: @damutiert_am datetime
-- Gets: @imutierer int
-- Returns: @iErrorCode int
---------------------------------------------------------------------------------
CREATE PROCEDURE [dbo].[pr_Parameter_Insert]
	@iParameterNR int,
	@sBezeichnung varchar(255),
	@sInhalt varchar(1024),
	@baktiv bit,
	@daerstellt_am datetime,
	@damutiert_am datetime,
	@imutierer int,
	@iErrorCode int OUTPUT
AS
SET NOCOUNT ON
-- INSERT a new row in the table.
INSERT [dbo].[Parameter]
(
	[ParameterNR],
	[Bezeichnung],
	[Inhalt],
	[aktiv],
	[erstellt_am],
	[mutiert_am],
	[mutierer]
)
VALUES
(
	@iParameterNR,
	@sBezeichnung,
	@sInhalt,
	@baktiv,
	@daerstellt_am,
	@damutiert_am,
	@imutierer
)
-- Get the Error Code for the statement just executed.
SELECT @iErrorCode=@@ERROR
GO


-- //// Update Stored procedure for updating one single row.
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[pr_Parameter_Update]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[pr_Parameter_Update]
GO

---------------------------------------------------------------------------------
-- Stored procedure that will update an existing row in the table 'Parameter'
-- Gets: @iParameterNR int
-- Gets: @sBezeichnung varchar(255)
-- Gets: @sInhalt varchar(1024)
-- Gets: @baktiv bit
-- Gets: @daerstellt_am datetime
-- Gets: @damutiert_am datetime
-- Gets: @imutierer int
-- Returns: @iErrorCode int
---------------------------------------------------------------------------------
CREATE PROCEDURE [dbo].[pr_Parameter_Update]
	@iParameterNR int,
	@sBezeichnung varchar(255),
	@sInhalt varchar(1024),
	@baktiv bit,
	@daerstellt_am datetime,
	@damutiert_am datetime,
	@imutierer int,
	@iErrorCode int OUTPUT
AS
SET NOCOUNT ON
-- UPDATE an existing row in the table.
UPDATE [dbo].[Parameter]
SET 
	[Bezeichnung] = @sBezeichnung,
	[Inhalt] = @sInhalt,
	[aktiv] = @baktiv,
	[erstellt_am] = @daerstellt_am,
	[mutiert_am] = @damutiert_am,
	[mutierer] = @imutierer
WHERE
	[ParameterNR] = @iParameterNR
-- Get the Error Code for the statement just executed.
SELECT @iErrorCode=@@ERROR
GO


-- //// Delete Stored procedure using Primary Key.
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[pr_Parameter_Delete]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[pr_Parameter_Delete]
GO

---------------------------------------------------------------------------------
-- Stored procedure that will delete an existing row from the table 'Parameter'
-- using the Primary Key. 
-- Gets: @iParameterNR int
-- Returns: @iErrorCode int
---------------------------------------------------------------------------------
CREATE PROCEDURE [dbo].[pr_Parameter_Delete]
	@iParameterNR int,
	@iErrorCode int OUTPUT
AS
SET NOCOUNT ON
-- DELETE an existing row from the table.
DELETE FROM [dbo].[Parameter]
WHERE
	[ParameterNR] = @iParameterNR
-- Get the Error Code for the statement just executed.
SELECT @iErrorCode=@@ERROR
GO


-- //// Select Stored procedure, based on Primary Key.
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[pr_Parameter_SelectOne]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[pr_Parameter_SelectOne]
GO

---------------------------------------------------------------------------------
-- Stored procedure that will select an existing row from the table 'Parameter'
-- based on the Primary Key.
-- Gets: @iParameterNR int
-- Returns: @iErrorCode int
---------------------------------------------------------------------------------
CREATE PROCEDURE [dbo].[pr_Parameter_SelectOne]
	@iParameterNR int,
	@iErrorCode int OUTPUT
AS
SET NOCOUNT ON
-- SELECT an existing row from the table.
SELECT
	[ParameterNR],
	[Bezeichnung],
	[Inhalt],
	[aktiv],
	[erstellt_am],
	[mutiert_am],
	[mutierer]
FROM [dbo].[Parameter]
WHERE
	[ParameterNR] = @iParameterNR
-- Get the Error Code for the statement just executed.
SELECT @iErrorCode=@@ERROR
GO


-- //// Select All Stored procedure.
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[pr_Parameter_SelectAll]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[pr_Parameter_SelectAll]
GO

---------------------------------------------------------------------------------
-- Stored procedure that will select all rows from the table 'Parameter'
-- Returns: @iErrorCode int
---------------------------------------------------------------------------------
CREATE PROCEDURE [dbo].[pr_Parameter_SelectAll]
	@iErrorCode int OUTPUT
AS
SET NOCOUNT ON
-- SELECT all rows from the table.
SELECT
	[ParameterNR],
	[Bezeichnung],
	[Inhalt],
	[aktiv],
	[erstellt_am],
	[mutiert_am],
	[mutierer]
FROM [dbo].[Parameter]
ORDER BY 
	[ParameterNR] ASC
-- Get the Error Code for the statement just executed.
SELECT @iErrorCode=@@ERROR
GO


-- [End of Stored Procedures for table:     Parameter]
-- ========================================================================================================
GO
