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.
71 lines
2.3 KiB
71 lines
2.3 KiB
Imports System.Data
|
|
Imports System.Data.SqlTypes
|
|
Imports System.Data.SqlClient
|
|
Imports PluginContracts
|
|
|
|
Public Class clsPlugin
|
|
|
|
Dim PluginRechte As DataTable
|
|
Dim rechte_gelesen As Boolean = False
|
|
|
|
Public Function get_path() As String
|
|
|
|
Dim connection As New SqlConnection()
|
|
Dim da As New SqlDataAdapter("Select beschreibung from pluginparameter where pluginparamnr=1", connection)
|
|
Dim CB As SqlCommandBuilder = New SqlCommandBuilder(da)
|
|
Dim ds As New DataSet()
|
|
Try
|
|
connection.ConnectionString = Globals.sConnectionstring
|
|
connection.Open()
|
|
da.Fill(ds, "params")
|
|
Return ds.Tables(0).Rows(0).Item(0)
|
|
Catch ex As Exception
|
|
Return ""
|
|
End Try
|
|
CB = Nothing
|
|
ds = Nothing
|
|
da = Nothing
|
|
connection.Close()
|
|
connection = Nothing
|
|
Return True
|
|
End Function
|
|
|
|
|
|
Public Function Check_Berechtigungen(pluginname As String) As Boolean
|
|
If rechte_gelesen = False Then get_pluginrechte()
|
|
For Each r As DataRow In PluginRechte.Rows
|
|
If r(0) = pluginname Then
|
|
Return True
|
|
Exit Function
|
|
End If
|
|
|
|
Next
|
|
Return False
|
|
End Function
|
|
|
|
Public Function get_pluginrechte() As String
|
|
|
|
Dim connection As New SqlConnection()
|
|
Dim da As New SqlDataAdapter("SELECT dbo.Plugin.Beschreibung, dbo.plugin.Bezeichnung FROM dbo.Plugin INNER JOIN dbo.PluginBerechtigung ON dbo.Plugin.PluginNr = dbo.PluginBerechtigung.PluginNr WHERE (dbo.Plugin.aktiv = 1) AND (dbo.PluginBerechtigung.aktiv = 1) AND (dbo.PluginBerechtigung.Mitarbeiternr = " + Globals.Mitarbeiternr.ToString + ")", connection)
|
|
Dim CB As SqlCommandBuilder = New SqlCommandBuilder(da)
|
|
Dim ds As New DataSet()
|
|
Try
|
|
connection.ConnectionString = Globals.sConnectionstring
|
|
connection.Open()
|
|
da.Fill(ds, "rechte")
|
|
Me.PluginRechte = ds.Tables(0).Copy
|
|
Return "Rechte vorhanden"
|
|
Catch ex As Exception
|
|
Return ""
|
|
End Try
|
|
CB = Nothing
|
|
ds = Nothing
|
|
da = Nothing
|
|
connection.Close()
|
|
connection = Nothing
|
|
rechte_gelesen = True
|
|
End Function
|
|
|
|
|
|
End Class
|