Initial commit
This commit is contained in:
@@ -0,0 +1,146 @@
|
||||
Imports System.IO
|
||||
Imports System.Data.Sql
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Public Class DB
|
||||
|
||||
|
||||
Public dsDaten As New DataSet
|
||||
Public dsdaten1 As New DataSet
|
||||
Public dsdatenblacklist As New DataSet
|
||||
Public dadaten As SqlDataAdapter
|
||||
Public dadatenblacklist As SqlDataAdapter
|
||||
Dim sql As String
|
||||
|
||||
|
||||
|
||||
Public Function Get_DokumentTYP(ByVal dokumenttypnr As Integer) As Boolean
|
||||
Try
|
||||
dsDaten.Tables.Clear()
|
||||
sql = "Select dokumenttypnr, bezeichnung from dokumenttyp where dokumenttypnr=" + dokumenttypnr.ToString
|
||||
dadaten = New SqlDataAdapter(sql, Globals.sConnectionstring)
|
||||
dadaten.Fill(dsDaten, "Dokumenttypen")
|
||||
If dsDaten.Tables(0).Rows.Count < 1 Then Return False Else Return True
|
||||
Catch
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function Get_Mitarbeiter(ByVal Mitarbeiternr As Integer) As Boolean
|
||||
Try
|
||||
dsDaten.Tables.Clear()
|
||||
sql = "Select mitarbeiternr from mitarbeiter where aktiv=1 and mitarbeiternr=" + Mitarbeiternr.ToString
|
||||
dadaten = New SqlDataAdapter(sql, Globals.sConnectionstring)
|
||||
dadaten.Fill(dsDaten, "mitarbeiter")
|
||||
If dsDaten.Tables(0).Rows.Count < 1 Then Return False Else Return True
|
||||
Catch
|
||||
End Try
|
||||
End Function
|
||||
|
||||
'Public Function Get_Doktyp_Ma(ByVal Doktypnr As Integer, ByVal Mitarbeiternr As Integer) As Boolean
|
||||
' Try
|
||||
' dsDaten.Tables.Clear()
|
||||
' sql = "Select dokumenttypnr from dokumenttyp where dokumenttypnr=" + Doktypnr.ToString + " and fachverantwortung=" + Mitarbeiternr.ToString
|
||||
' dadaten = New SqlDataAdapter(sql, Globals.sConnectionstring)
|
||||
' dadaten.Fill(dsDaten, "mitarbeiter")
|
||||
' If dsDaten.Tables(0).Rows.Count < 1 Then Return False Else Return True
|
||||
' Catch
|
||||
' End Try
|
||||
'End Function
|
||||
|
||||
Public Function Get_ov(ByVal ovnr As Integer) As Boolean
|
||||
Try
|
||||
dsDaten.Tables.Clear()
|
||||
sql = "Select office_vorlagenr from office_vorlage where office_vorlagenr=" + ovnr.ToString
|
||||
dadaten = New SqlDataAdapter(sql, Globals.sConnectionstring)
|
||||
dadaten.Fill(dsDaten, "ov")
|
||||
If dsDaten.Tables(0).Rows.Count < 1 Then Return False Else Return True
|
||||
Catch
|
||||
End Try
|
||||
End Function
|
||||
Public Function Update_Doktype(ByVal Doktypnr As Integer, ByVal maneu As Integer) As Boolean
|
||||
Try
|
||||
Dim sqlcmd As New SqlCommand()
|
||||
Dim sqlconn As New SqlConnection(Globals.sConnectionstring)
|
||||
sqlcmd.CommandText = "Update dokumenttyp set owner=" + maneu.ToString + " where dokumenttypnr=" + Doktypnr.ToString
|
||||
sqlcmd.Connection = sqlconn
|
||||
sqlconn.Open()
|
||||
sqlcmd.ExecuteNonQuery()
|
||||
sqlconn.Close()
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function Update_Officevorlage(ByVal ovnr As Integer, ByVal maneu As Integer) As Boolean
|
||||
Try
|
||||
Dim sqlcmd As New SqlCommand()
|
||||
Dim sqlconn As New SqlConnection(Globals.sConnectionstring)
|
||||
sqlcmd.CommandText = "Update office_vorlage set owner=" + maneu.ToString + " where office_vorlagenr=" + ovnr.ToString
|
||||
sqlcmd.Connection = sqlconn
|
||||
sqlconn.Open()
|
||||
sqlcmd.ExecuteNonQuery()
|
||||
sqlconn.Close()
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
Public Class DB_Connection
|
||||
|
||||
''' <summary>
|
||||
''' Liest sämtlcihe CFG-Dateien mit dem Namen "Vertragsverwaltung...". Sind meherere Dateien vorhanden,
|
||||
''' wird ein Auswahldialog zur Datenbank-Selektion angezeigt.
|
||||
''' Standardmässig wird Vertragsverwaltung.cfg als CFG-Datei benutzt.
|
||||
'''
|
||||
''' Die CFG-Datei ist verschlüsselt und wird über die Crypto-Funktionen entschlüsselt.
|
||||
''' </summary>
|
||||
''' <remarks></remarks>
|
||||
Shared Sub New()
|
||||
Dim path As String = ""
|
||||
Dim fc As Integer = 0
|
||||
If fc < 2 Then Globals.ConnectionFilename = "edokaconn.cfg"
|
||||
Dim ofile As System.IO.File
|
||||
Dim oread As System.IO.StreamReader
|
||||
|
||||
oread = ofile.OpenText(ApplicationPath() + "\" + Globals.ConnectionFilename)
|
||||
sConnectionstring = oread.ReadLine
|
||||
sConnectionstring = Crypto.DecryptText(sConnectionstring, "HutterundMueller")
|
||||
sConnectionstring = Left(sConnectionstring, Len(sConnectionstring) - 1)
|
||||
Globals.sConnectionstring = sConnectionstring
|
||||
oread.Close()
|
||||
|
||||
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")
|
||||
path = ds.Tables(0).Rows(0).Item(0)
|
||||
Catch ex As Exception
|
||||
path = ""
|
||||
CB = Nothing
|
||||
End Try
|
||||
|
||||
ds = Nothing
|
||||
da = Nothing
|
||||
connection.Close()
|
||||
connection = Nothing
|
||||
|
||||
Globals.ConnectionFilename = "edokaconn.cfg"
|
||||
oread = ofile.OpenText(path + "\" + Globals.ConnectionFilename)
|
||||
sConnectionstring = oread.ReadLine
|
||||
sConnectionstring = Crypto.DecryptText(sConnectionstring, "HutterundMueller")
|
||||
sConnectionstring = Left(sConnectionstring, Len(sConnectionstring) - 1)
|
||||
Globals.sConnectionstring = sConnectionstring
|
||||
oread.Close()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,103 @@
|
||||
Imports System.IO
|
||||
Imports System.Data.Sql
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Public Class DB
|
||||
|
||||
|
||||
|
||||
Public dsDaten As New DataSet
|
||||
Public dsdaten1 As New DataSet
|
||||
Public dadaten1 As New SqlDataAdapter
|
||||
Public dadaten As SqlDataAdapter
|
||||
Dim sql As String
|
||||
|
||||
Public Sub Get_Funktionsgruppe()
|
||||
Try
|
||||
dsDaten.Clear()
|
||||
sql = " SELECT funktionsgruppenr, bezeichnung from funktionsgruppe"
|
||||
dadaten = New SqlDataAdapter(sql, Globals.sConnectionstring)
|
||||
dadaten.Fill(dsDaten, "Funktionsgruppe")
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Sub Get_Dokumenttyp_Funktionsgruppe(dokumenttypnr As Integer)
|
||||
dsdaten1.Clear()
|
||||
sql = " SELECT * from dokumentaufhebung where aktiv=1 and dokumenttypnr=" + dokumenttypnr.ToString
|
||||
dadaten1 = New SqlDataAdapter(sql, Globals.sConnectionstring)
|
||||
dadaten1.Fill(dsdaten1, "DokumenttypFunktionsgruppe")
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Sub Update_Daten()
|
||||
'Try
|
||||
' Dim cb As New SqlCommandBuilder(dadatendocm)
|
||||
' dadatendocm.Update(dsdatendocm, dsdatendocm.Tables(0).TableName)
|
||||
' MsgBox("Änderungen wurden gespeichert")
|
||||
'Catch ex As Exception
|
||||
' MsgBox("Felher: " + ex.Message)
|
||||
'End Try
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
Public Class DB_Connection
|
||||
|
||||
''' <summary>
|
||||
''' Liest sämtlcihe CFG-Dateien mit dem Namen "Vertragsverwaltung...". Sind meherere Dateien vorhanden,
|
||||
''' wird ein Auswahldialog zur Datenbank-Selektion angezeigt.
|
||||
''' Standardmässig wird Vertragsverwaltung.cfg als CFG-Datei benutzt.
|
||||
'''
|
||||
''' Die CFG-Datei ist verschlüsselt und wird über die Crypto-Funktionen entschlüsselt.
|
||||
''' </summary>
|
||||
''' <remarks></remarks>
|
||||
Shared Sub New()
|
||||
Dim path As String = ""
|
||||
Dim fc As Integer = 0
|
||||
If fc < 2 Then Globals.ConnectionFilename = "edokaconn.cfg"
|
||||
Dim ofile As System.IO.File
|
||||
Dim oread As System.IO.StreamReader
|
||||
|
||||
oread = ofile.OpenText(ApplicationPath() + "\" + Globals.ConnectionFilename)
|
||||
sConnectionstring = oread.ReadLine
|
||||
sConnectionstring = Crypto.DecryptText(sConnectionstring, "HutterundMueller")
|
||||
sConnectionstring = Left(sConnectionstring, Len(sConnectionstring) - 1)
|
||||
Globals.sConnectionstring = sConnectionstring
|
||||
oread.Close()
|
||||
|
||||
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")
|
||||
path = ds.Tables(0).Rows(0).Item(0)
|
||||
Catch ex As Exception
|
||||
path = ""
|
||||
CB = Nothing
|
||||
End Try
|
||||
|
||||
ds = Nothing
|
||||
da = Nothing
|
||||
connection.Close()
|
||||
connection = Nothing
|
||||
|
||||
Globals.ConnectionFilename = "edokaconn.cfg"
|
||||
oread = ofile.OpenText(path + "\" + Globals.ConnectionFilename)
|
||||
sConnectionstring = oread.ReadLine
|
||||
sConnectionstring = Crypto.DecryptText(sConnectionstring, "HutterundMueller")
|
||||
sConnectionstring = Left(sConnectionstring, Len(sConnectionstring) - 1)
|
||||
Globals.sConnectionstring = sConnectionstring
|
||||
oread.Close()
|
||||
Globals.conn.sConnectionString = Globals.sConnectionstring
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' Dieser Code wurde von einem Tool generiert.
|
||||
' Laufzeitversion:4.0.30319.42000
|
||||
'
|
||||
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
' der Code erneut generiert wird.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
|
||||
'-Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||
'Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||
'mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
|
||||
'''<summary>
|
||||
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||
'''</summary>
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||
Friend Module Resources
|
||||
|
||||
Private resourceMan As Global.System.Resources.ResourceManager
|
||||
|
||||
Private resourceCulture As Global.System.Globalization.CultureInfo
|
||||
|
||||
'''<summary>
|
||||
''' Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||
Get
|
||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Plugin_Aufhebung.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||
''' Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
Set
|
||||
resourceCulture = value
|
||||
End Set
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user