You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
296 lines
15 KiB
296 lines
15 KiB
Alter Table LizenzVertragselementApplikation add Hyperlink_Vertrag varchar(8000)
|
|
go
|
|
UPDATE dbo.Vertragspartner SET aktiv=0, mutiert_am=GETDATE() WHERE vertragspartnernr<>1 AND aktiv=1
|
|
go
|
|
UPDATE person SET aktiv=0, Mutiert_am=GETDATE() WHERE Vertragspartnernr<>1 AND aktiv=1
|
|
go
|
|
UPDATE ApplikationKontakt SET aktiv=0, mutiert_am = GETDATE() WHERE aktiv=1 AND personnr IN (SELECT personnr FROM person WHERE vertragspartnernr <> 1)
|
|
go
|
|
ALTER TABLE Dokument ADD Hyperlink VARCHAR(8000)
|
|
go
|
|
update dokument set hyperlink=''
|
|
go
|
|
update LizenzVertragselementApplikation set Hyperlink_Vertrag=''
|
|
go
|
|
go
|
|
/****** Object: StoredProcedure [dbo].[sp_get_vertragspartner] Script Date: 10.08.2018 07:43:07 ******/
|
|
DROP PROCEDURE [dbo].[sp_get_vertragspartner]
|
|
GO
|
|
|
|
/****** Object: StoredProcedure [dbo].[sp_get_vertragspartner] Script Date: 10.08.2018 07:43:07 ******/
|
|
SET ANSI_NULLS ON
|
|
GO
|
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
GO
|
|
|
|
|
|
-- =============================================
|
|
-- Author: <Stefan Hutter>
|
|
-- Create date: <09.03.2009>
|
|
-- Description: <Liefert eine Liste der Vertragspartner>
|
|
-- =============================================
|
|
CREATE PROCEDURE [dbo].[sp_get_vertragspartner]
|
|
@mitarbeiternr INT,
|
|
@suchstring VARCHAR(255)
|
|
AS
|
|
BEGIN
|
|
SET NOCOUNT ON;
|
|
SET @suchstring='%'+@suchstring+'%'
|
|
SELECT VertragspartnerNr ,NameZ1 + ' ' + NameZ2 + ', ' + PLZ + ' ' + Ort AS Description, aktiv
|
|
FROM dbo.Vertragspartner
|
|
WHERE dbo.vertragspartner.securitylevelnr <= dbo.get_securitylevel(@mitarbeiternr) AND
|
|
(namez1 LIKE @suchstring OR namez2 LIKE @suchstring OR ort LIKE @suchstring)
|
|
AND dbo.Vertragspartner.VertragspartnerNr=1
|
|
ORDER BY namez1,namez2, ort
|
|
END
|
|
|
|
GO
|
|
|
|
DROP PROCEDURE [dbo].[sp_get_lizenz_vertragselement_applikation]
|
|
GO
|
|
|
|
/****** Object: StoredProcedure [dbo].[sp_get_lizenz_vertragselement_applikation] Script Date: 10.08.2018 09:49:34 ******/
|
|
SET ANSI_NULLS ON
|
|
GO
|
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
-- =============================================
|
|
-- Author: <Author,,Name>
|
|
-- Create date: <Create Date,,>
|
|
-- Description: <Description,,>
|
|
-- =============================================
|
|
CREATE PROCEDURE [dbo].[sp_get_lizenz_vertragselement_applikation]
|
|
@mitarbeiternr AS INTEGER,
|
|
@lizenznr AS INTEGER
|
|
AS
|
|
BEGIN
|
|
SET NOCOUNT ON;
|
|
SELECT dbo.VertragselementApplikation.VertragselementApplikationnr, dbo.Vertragspartner.VertragspartnerNr,
|
|
dbo.Vertragspartner.NameZ1 + ', ' + dbo.Vertragspartner.Ort AS Vertragspartner, dbo.LizenzvertragselementApplikation.Hyperlink_Vertrag AS Vertragselement, -- dbo.Vertragselement.Bezeichnung AS Vertragselement,
|
|
dbo.Applikation.ApplikationNr,
|
|
dbo.Applikation.Bezeichnung AS Applikation, dbo.ApplikationVersion.ApplikationVersionNr, dbo.ApplikationVersion.Version, dbo.LizenzVertragselementApplikation.Aktiv,
|
|
dbo.LizenzVertragselementApplikation.Erstellt_am, dbo.LizenzVertragselementApplikation.Mutiert_am, dbo.LizenzVertragselementApplikation.Mutierer,
|
|
dbo.VertragselementApplikation.BezeichnungLizenverwaltung, dbo.LizenzVertragselementApplikation.Lizenznr,
|
|
dbo.LizenzVertragselementApplikation.LizenzVEApplNr, dbo.LizenzVertragselementApplikation.Bemerkung
|
|
INTO #tmp1
|
|
FROM dbo.VertragselementApplikation INNER JOIN
|
|
dbo.Vertragselement ON dbo.VertragselementApplikation.Vertragselementnr = dbo.Vertragselement.Vertragselementnr INNER JOIN
|
|
dbo.Vertragspartner ON dbo.Vertragselement.VertragspartnerNr = dbo.Vertragspartner.VertragspartnerNr INNER JOIN
|
|
dbo.Applikation ON dbo.VertragselementApplikation.Applikationnr = dbo.Applikation.ApplikationNr INNER JOIN
|
|
dbo.LizenzVertragselementApplikation ON
|
|
dbo.VertragselementApplikation.VertragselementApplikationnr = dbo.LizenzVertragselementApplikation.VertragselementApplikationNr LEFT OUTER JOIN
|
|
dbo.ApplikationVersion ON dbo.VertragselementApplikation.ApplikationVersionNr = dbo.ApplikationVersion.ApplikationVersionNr
|
|
WHERE dbo.LizenzVertragselementApplikation.Lizenznr=@lizenznr AND vertragselementapplikation.VertragselementApplikationnr=-9999
|
|
|
|
INSERT INTO #tmp1
|
|
SELECT dbo.VertragselementApplikation.VertragselementApplikationnr, 0 AS Vertragspartnernr, '' AS Vertragspartner, dbo.LizenzvertragselementApplikation.Hyperlink_Vertrag AS Vertragselement, --'' AS Vertragselement,
|
|
dbo.Applikation.ApplikationNr,
|
|
dbo.Applikation.Bezeichnung AS Applikation, dbo.ApplikationVersion.ApplikationVersionNr, dbo.ApplikationVersion.Version,
|
|
dbo.LizenzVertragselementApplikation.Aktiv, dbo.LizenzVertragselementApplikation.Erstellt_am, dbo.LizenzVertragselementApplikation.Mutiert_am,
|
|
dbo.LizenzVertragselementApplikation.Mutierer, dbo.VertragselementApplikation.BezeichnungLizenverwaltung, dbo.LizenzVertragselementApplikation.Lizenznr,
|
|
dbo.LizenzVertragselementApplikation.LizenzVEApplNr,dbo.LizenzVertragselementApplikation.Bemerkung
|
|
FROM dbo.VertragselementApplikation INNER JOIN
|
|
dbo.Applikation ON dbo.VertragselementApplikation.Applikationnr = dbo.Applikation.ApplikationNr INNER JOIN
|
|
dbo.LizenzVertragselementApplikation ON
|
|
dbo.VertragselementApplikation.VertragselementApplikationnr = dbo.LizenzVertragselementApplikation.VertragselementApplikationNr LEFT OUTER JOIN
|
|
dbo.ApplikationVersion ON dbo.VertragselementApplikation.ApplikationVersionNr = dbo.ApplikationVersion.ApplikationVersionNr
|
|
WHERE (dbo.LizenzVertragselementApplikation.Lizenznr = @lizenznr) AND (dbo.VertragselementApplikation.Vertragselementnr = - 99)
|
|
|
|
SELECT * FROM #tmp1
|
|
DROP TABLE #tmp1
|
|
END
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
|
DROP PROCEDURE [dbo].[sp_get_vertragselement_applikation]
|
|
GO
|
|
|
|
/****** Object: StoredProcedure [dbo].[sp_get_vertragselement_applikation] Script Date: 11.08.2018 10:33:17 ******/
|
|
SET ANSI_NULLS ON
|
|
GO
|
|
|
|
SET QUOTED_IDENTIFIER OFF
|
|
GO
|
|
|
|
|
|
CREATE PROCEDURE [dbo].[sp_get_vertragselement_applikation]
|
|
@KeyValue INT,
|
|
@mitarbeiternr INT
|
|
AS
|
|
-- SELECT dbo.VertragselementApplikation.VertragselementApplikationnr,
|
|
-- dbo.VertragselementApplikation.Vertragselementnr,
|
|
-- dbo.VertragselementApplikation.Applikationnr,
|
|
-- dbo.Vertragselement.Bezeichnung as Vertragselement, dbo.Applikation.Bezeichnung AS Applikation,
|
|
-- dbo.VertragselementApplikation.Bemerkung, dbo.VertragselementApplikation.Aktiv,
|
|
-- dbo.VertragselementApplikation.Erstellt_am, dbo.VertragselementApplikation.Mutiert_am,
|
|
-- dbo.VertragselementApplikation.Mutierer
|
|
-- into #tmp1
|
|
-- FROM dbo.VertragselementApplikation INNER JOIN
|
|
-- dbo.Vertragselement ON dbo.VertragselementApplikation.Vertragselementnr = dbo.Vertragselement.Vertragselementnr INNER JOIN
|
|
-- dbo.Applikation ON dbo.VertragselementApplikation.Applikationnr = dbo.Applikation.ApplikationNr
|
|
-- where dbo.vertragselementapplikation.applikationnr=@keyvalue and
|
|
-- dbo.vertragselement.SecurityLevelnr<=dbo.Get_SecurityLevel(@mitarbeiternr) and
|
|
-- dbo.vertragselementapplikation.aktiv=1
|
|
-- order by dbo.applikation.bezeichnung
|
|
|
|
|
|
--insert into #tmp1
|
|
-- SELECT - 99 AS vertragselementapplikationsnr, dbo.Vertragselement.Vertragselementnr, dbo.Applikation.ApplikationNr, dbo.Vertragselement.Bezeichnung AS Vertragselement,
|
|
-- dbo.Applikation.Bezeichnung AS Applikation, 'Lizenzelemnt' AS bemekrung, 1 AS aktiv, dbo.Vertragselement.Erstellt_am, dbo.Vertragselement.Mutiert_am,
|
|
-- dbo.Vertragselement.Mutierer
|
|
-- FROM dbo.Vertragselement INNER JOIN
|
|
-- dbo.Applikation ON dbo.Vertragselement.ApplikationNr = dbo.Applikation.ApplikationNr INNER JOIN
|
|
-- dbo.Vertragstyp ON dbo.Vertragselement.VertragstypNr = dbo.Vertragstyp.Vertragstypnr
|
|
-- WHERE (dbo.Vertragselement.Aktiv = 1) AND (dbo.Vertragstyp.AlsLizenz = 1) and
|
|
-- dbo.vertragselement.SecurityLevelnr<=dbo.Get_SecurityLevel(@mitarbeiternr)
|
|
-- and dbo.applikation.applikationnr=@keyvalue
|
|
--DROP TABLE #tmp1
|
|
|
|
|
|
|
|
SELECT dbo.VertragselementApplikation.VertragselementApplikationnr, 0 AS Vertragselementnr, dbo.VertragselementApplikation.Applikationnr, ISNULL(dbo.LizenzVertragselementApplikation.Hyperlink_Vertrag,'') AS Vertragselement,
|
|
dbo.Applikation.Bezeichnung AS Applikation, 'Lizenzelement' AS Bemerkung, 1 AS Aktiv, dbo.LizenzVertragselementApplikation.Erstellt_am, dbo.LizenzVertragselementApplikation.Mutiert_am,
|
|
dbo.LizenzVertragselementApplikation.Mutierer
|
|
INTO #tmp1
|
|
FROM dbo.LizenzVertragselementApplikation INNER JOIN
|
|
dbo.VertragselementApplikation ON dbo.LizenzVertragselementApplikation.VertragselementApplikationNr = dbo.VertragselementApplikation.VertragselementApplikationnr INNER JOIN
|
|
dbo.Applikation ON dbo.VertragselementApplikation.Applikationnr = dbo.Applikation.ApplikationNr
|
|
|
|
WHERE (dbo.VertragselementApplikation.Applikationnr = @keyvalue) AND dbo.VertragselementApplikation.aktiv=1 AND dbo.LizenzVertragselementApplikation.aktiv=1
|
|
AND ISNULL(dbo.LizenzVertragselementApplikation.Hyperlink_Vertrag,'')<>''
|
|
|
|
|
|
|
|
|
|
SELECT DISTINCT * FROM #tmp1 WHERE VertragselementApplikationnr >-1
|
|
DROP TABLE #tmp1
|
|
|
|
GO
|
|
|
|
|
|
DROP PROCEDURE [dbo].[sp_get_lizenz_vertragselement_applikation]
|
|
GO
|
|
|
|
/****** Object: StoredProcedure [dbo].[sp_get_lizenz_vertragselement_applikation] Script Date: 11.08.2018 17:24:53 ******/
|
|
SET ANSI_NULLS ON
|
|
GO
|
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
-- =============================================
|
|
-- Author: <Author,,Name>
|
|
-- Create date: <Create Date,,>
|
|
-- Description: <Description,,>
|
|
-- =============================================
|
|
CREATE PROCEDURE [dbo].[sp_get_lizenz_vertragselement_applikation]
|
|
@mitarbeiternr AS INTEGER,
|
|
@lizenznr AS INTEGER
|
|
AS
|
|
BEGIN
|
|
SET NOCOUNT ON;
|
|
--SELECT dbo.VertragselementApplikation.VertragselementApplikationnr, dbo.Vertragspartner.VertragspartnerNr,
|
|
-- dbo.Vertragspartner.NameZ1 + ', ' + dbo.Vertragspartner.Ort AS Vertragspartner, dbo.LizenzvertragselementApplikation.Hyperlink_Vertrag AS Vertragselement, -- dbo.Vertragselement.Bezeichnung AS Vertragselement,
|
|
-- dbo.Applikation.ApplikationNr,
|
|
-- dbo.Applikation.Bezeichnung AS Applikation, dbo.ApplikationVersion.ApplikationVersionNr, dbo.ApplikationVersion.Version, dbo.LizenzVertragselementApplikation.Aktiv,
|
|
-- dbo.LizenzVertragselementApplikation.Erstellt_am, dbo.LizenzVertragselementApplikation.Mutiert_am, dbo.LizenzVertragselementApplikation.Mutierer,
|
|
-- dbo.VertragselementApplikation.BezeichnungLizenverwaltung, dbo.LizenzVertragselementApplikation.Lizenznr,
|
|
-- dbo.LizenzVertragselementApplikation.LizenzVEApplNr, dbo.LizenzVertragselementApplikation.Bemerkung
|
|
--INTO #tmp1
|
|
--FROM dbo.VertragselementApplikation INNER JOIN
|
|
-- dbo.Vertragselement ON dbo.VertragselementApplikation.Vertragselementnr = dbo.Vertragselement.Vertragselementnr INNER JOIN
|
|
-- dbo.Vertragspartner ON dbo.Vertragselement.VertragspartnerNr = dbo.Vertragspartner.VertragspartnerNr INNER JOIN
|
|
-- dbo.Applikation ON dbo.VertragselementApplikation.Applikationnr = dbo.Applikation.ApplikationNr INNER JOIN
|
|
-- dbo.LizenzVertragselementApplikation ON
|
|
-- dbo.VertragselementApplikation.VertragselementApplikationnr = dbo.LizenzVertragselementApplikation.VertragselementApplikationNr LEFT OUTER JOIN
|
|
-- dbo.ApplikationVersion ON dbo.VertragselementApplikation.ApplikationVersionNr = dbo.ApplikationVersion.ApplikationVersionNr
|
|
--WHERE dbo.LizenzVertragselementApplikation.Lizenznr=@lizenznr AND vertragselementapplikation.VertragselementApplikationnr=-9999
|
|
|
|
--INSERT INTO #tmp1
|
|
SELECT dbo.VertragselementApplikation.VertragselementApplikationnr, 0 AS Vertragspartnernr, '' AS Vertragspartner, dbo.LizenzvertragselementApplikation.Hyperlink_Vertrag AS Vertragselement, --'' AS Vertragselement,
|
|
dbo.Applikation.ApplikationNr,
|
|
dbo.Applikation.Bezeichnung AS Applikation, dbo.ApplikationVersion.ApplikationVersionNr, dbo.ApplikationVersion.Version,
|
|
dbo.LizenzVertragselementApplikation.Aktiv, dbo.LizenzVertragselementApplikation.Erstellt_am, dbo.LizenzVertragselementApplikation.Mutiert_am,
|
|
dbo.LizenzVertragselementApplikation.Mutierer, dbo.VertragselementApplikation.BezeichnungLizenverwaltung, dbo.LizenzVertragselementApplikation.Lizenznr,
|
|
dbo.LizenzVertragselementApplikation.LizenzVEApplNr,dbo.LizenzVertragselementApplikation.Bemerkung
|
|
FROM dbo.VertragselementApplikation INNER JOIN
|
|
dbo.Applikation ON dbo.VertragselementApplikation.Applikationnr = dbo.Applikation.ApplikationNr INNER JOIN
|
|
dbo.LizenzVertragselementApplikation ON
|
|
dbo.VertragselementApplikation.VertragselementApplikationnr = dbo.LizenzVertragselementApplikation.VertragselementApplikationNr LEFT OUTER JOIN
|
|
dbo.ApplikationVersion ON dbo.VertragselementApplikation.ApplikationVersionNr = dbo.ApplikationVersion.ApplikationVersionNr
|
|
WHERE (dbo.LizenzVertragselementApplikation.Lizenznr = @lizenznr) AND (dbo.VertragselementApplikation.Vertragselementnr = - 99)
|
|
|
|
--SELECT * FROM #tmp1
|
|
--DROP TABLE #tmp1
|
|
END
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|
|
|
|
DROP PROCEDURE [dbo].[sp_get_dokumente]
|
|
GO
|
|
|
|
/****** Object: StoredProcedure [dbo].[sp_get_dokumente] Script Date: 12.08.2018 13:42:04 ******/
|
|
SET ANSI_NULLS ON
|
|
GO
|
|
|
|
SET QUOTED_IDENTIFIER ON
|
|
GO
|
|
|
|
|
|
CREATE PROCEDURE [dbo].[sp_get_dokumente]
|
|
---------------------------------------------------------------------------------
|
|
-- Stored procedure that will select all rows from the table 'Kuendigungsfrist'
|
|
-- Returns: @iErrorCode int
|
|
---------------------------------------------------------------------------------
|
|
@keyvalue INT,
|
|
@doktype INT,
|
|
@mitarbeiternr INT
|
|
AS
|
|
SELECT 0 AS DokIcon, dbo.Dokument.DokumentNr, dbo.Dokument.KeyValue, dbo.Dokumenttyp.Bezeichnung AS Dokumenttyp, dbo.Dokument.Bezeichnung AS Bezeichnung, dbo.Dokument.Beschreibung,
|
|
dbo.Dokument.Filename, dbo.Dokument.OriginalFilename_incl_Path, dbo.Dokument.Version, dbo.Dokument.VersionsNr, dbo.Dokument.Versionsdatum,
|
|
dbo.Dokument.Erstellt_am, dbo.Dokument.Mutiert_am, dbo.Dokument.Mutierer, dbo.Dokument.Aktiv, dbo.Dokument.SecurityLevelNr, dbo.dokument.hyperlink
|
|
FROM dbo.Dokument INNER JOIN
|
|
dbo.Dokumenttyp ON dbo.Dokument.DokumenttypNr = dbo.Dokumenttyp.Dokumenttypnr
|
|
WHERE dbo.dokument.SecurityLevelnr<=dbo.Get_SecurityLevel(@mitarbeiternr) AND Keyvalue = @keyvalue AND doktype=@doktype
|
|
ORDER BY dbo.dokument.erstellt_am DESC
|
|
|
|
|
|
|
|
RETURN
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
|