Benutzerberechtigungen eingebaut

This commit is contained in:
ms
2019-08-19 09:32:57 +02:00
parent 43c151d184
commit f470bce279
19 changed files with 610 additions and 154 deletions

View File

@@ -16,9 +16,12 @@ Public Class Class1
Public Shared AlleStandorte As New List(Of String)
Public Shared LoggedOnUser As New cBenutzer
Public Shared LoggedOnUserRights As New List(Of cBerechtigungen)
Public Shared LoggedOnUserisAdmin As Boolean = False
Public Shared DebugMode As Boolean = False
Public Shared DebugText As String = ""
Public Shared GroupUsers As List(Of cBenutzer)
Public Shared Sub EnableDoubleBuffered(ByVal dgv As DataGridView)
Dim dgvType As Type = dgv.[GetType]()
Dim pi As PropertyInfo = dgvType.GetProperty("DoubleBuffered",
@@ -42,7 +45,7 @@ Public Class Class1
If Main.sAppPath Like "*\bin\Debug" Or Startparameter = "debug" Then
DebugMode = True
Class1.DBConString = "Server=DEVELOPER\DEVSQL;Initial Catalog=Doku;User ID=sa;Password=BmWr501956;Connection Timeout=5;"
Class1.DBConString = "Server=DEVELOPER.verag.ost.dmn\DEVSQL;Initial Catalog=Doku;User ID=sa;Password=BmWr501956;Connection Timeout=5;"
Class1.FilePath = "\\192.168.0.253\backup\temp_Sebastian\DokuTest"
Else
Class1.DBConString = "Server=192.168.0.94\SQLEXPRESS;Initial Catalog=Doku;User ID=sa;Password=BmWr501956;Connection Timeout=5;"

View File

@@ -19,7 +19,7 @@ Public Class cBenutzer
Function FillWithLoggedOnUser(Optional ByVal dcabfrage As Boolean = False)
Function FillWithLoggedOnUser(Optional ByVal dcabfrage As Boolean = False, Optional ByVal LDAPa As String = "") '"LDAP://DC=VERAG,DC=OST,DC=DMN")
Try
userPrincipalName = System.DirectoryServices.AccountManagement.UserPrincipal.Current.UserPrincipalName
Name = System.DirectoryServices.AccountManagement.UserPrincipal.Current.Name
@@ -29,18 +29,18 @@ Public Class cBenutzer
BenutzeranmeldeName = Environment.UserDomainName & "\" & Environment.UserName
If dcabfrage = True Then
FillFromDC(userPrincipalName, "userPrincipalName")
'Class1.DebugText = userPrincipalName & LDAPa
FillFromDC(userPrincipalName, "userPrincipalName", LDAPa)
End If
End Function
Function FillFromDC(ByVal searchname As String, Optional ByVal searchfilter As String = "distinguishedName", Optional ByVal LDAP As String = "LDAP://DC=VERAG,DC=OST,DC=DMN")
Try
localdistinguishedName = searchname
Me.Domäne = "verag.ost.dmn"
If searchname.Contains("ForeignSecurityPrincipals") Then
'MsgBox("!")
Dim FSlocDirectoryEntry As New DirectoryServices.DirectoryEntry(LDAP)
Dim FSsearcher As New DirectoryServices.DirectorySearcher
With FSsearcher
@@ -49,7 +49,8 @@ Public Class cBenutzer
.PropertiesToLoad.Add("msDS-PrincipalName")
End With
Dim FSResult As DirectoryServices.SearchResult = FSsearcher.FindOne
searchname = blablabla(FSResult, "msDS-PrincipalName")
' MsgBox(FSResult.Properties("msDS-PrincipalName").Count)
searchname = FSResult.Properties("msDS-PrincipalName").Item(0)
Dim DomainName As String = searchname.Substring(0, searchname.IndexOf("\"))
' MsgBox(DomainName)
@@ -61,13 +62,19 @@ Public Class cBenutzer
Case "VERAGNEUHAUS"
Me.Domäne = "VERAGNEUHAUS.local"
LDAP = "LDAP://DC=VERAGNEUHAUS,DC=LOCAL"
Case "VERAGOST"
Me.Domäne = "verag.ost.dmn"
End Select
' MsgBox(searchname)
searchname = searchname.Substring((searchname.IndexOf("\") + 1), searchname.Length - searchname.IndexOf("\") - 1)
searchfilter = "sAMAccountName"
Else
'Me.Domäne = "verag.ost.dmn"
End If
If LDAP = "LDAP://DC=VERAG,DC=OST,DC=DMN" Then Me.Domäne = "verag.ost.dmn"
' MsgBox(searchname & vbCrLf & searchfilter & vbCrLf & Me.Domäne & vbCrLf & LDAP)
Dim locDirectoryEntry As New DirectoryServices.DirectoryEntry(LDAP)
' Dim Searcher1 As New DirectoryServices.DirectorySearcher(locDirectoryEntry, searchfilter & "=" & searchname)
@@ -87,7 +94,7 @@ Public Class cBenutzer
.PropertiesToLoad.Add("userPrincipalName")
End With
Dim Result As DirectoryServices.SearchResult = Searcher.FindOne
Dim Result As DirectoryServices.SearchResult = searcher.FindOne
Me.Nachname = blablabla(Result, "sn")
@@ -158,5 +165,5 @@ End Class
Public Class cSharedClasses
Public Shared LoggedOnUser As New cBenutzer
' Public Shared LoggedOnUser As New cBenutzer
End Class

View File

@@ -120,5 +120,16 @@ Public Class cBerechtigungen
End If
End Function
Public Shared Function BenutzerBerechtigungfuerID(ByVal Benutzer As String, ByVal ID As String)
Dim ds As New DataSet
SQL.SQL2DS("SELECT ZUGRIFF FROM TbL_Berechtigungen WHERE BENUTZERANMELDENAME = '" & Benutzer & "' AND ID = '" & ID & "'", ds)
If ds.Tables(0).Rows.Count > 0 Then
Return ds.Tables(0).Rows(0).Item(0).ToString
Else
' MsgBox("Keine Berechtigung gefunden")
Return "0"
End If
End Function
End Class

View File

@@ -11,6 +11,7 @@ Public Class cEintrag
Property Linked As Boolean = False
Property LinkedWith As String = ""
Property ID As String = ""
Property Berechtigung As String = ""
Property NewID As Boolean = False

View File

@@ -1,3 +0,0 @@
Public Class cGlobalVariables
End Class

View File

@@ -167,7 +167,6 @@
</Compile>
<Compile Include="Classes\cBenutzer.vb" />
<Compile Include="Classes\cBerechtigungen.vb" />
<Compile Include="Classes\cGlobalVariables.vb" />
<Compile Include="Classes\Class1.vb" />
<Compile Include="Administration\CSVImportieren.Designer.vb">
<DependentUpon>CSVImportieren.vb</DependentUpon>
@@ -306,6 +305,12 @@
<Compile Include="uscntr_Slaves.vb">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="uscntr_INFO.Designer.vb">
<DependentUpon>uscntr_INFO.vb</DependentUpon>
</Compile>
<Compile Include="uscntr_INFO.vb">
<SubType>UserControl</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Administration\NetzwerkHinzu.resx">
@@ -384,6 +389,9 @@
<EmbeddedResource Include="uscntr_Firewalleinstellungen.resx">
<DependentUpon>uscntr_Firewalleinstellungen.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="uscntr_INFO.resx">
<DependentUpon>uscntr_INFO.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="uscntr_Slaves.resx">
<DependentUpon>uscntr_Slaves.vb</DependentUpon>
</EmbeddedResource>

View File

@@ -5,17 +5,33 @@ Public Class Login
Property BenutzeranmeldeName As String = ""
Private Sub Login_Load(sender As Object, e As EventArgs) Handles MyBase.Load
cSharedClasses.LoggedOnUser.FillWithLoggedOnUser(True)
Dim LDAP As String = ReturnLDAP(Environment.UserDomainName)
Class1.LoggedOnUser.FillWithLoggedOnUser(True, LDAP)
Class1.DebugText = LDAP
' Class1.DebugText &= Environment.UserDomainName & vbCrLf
'Class1.DebugText &= ReturnLDAP(Environment.UserDomainName) & vbCrLf
Class1.CheckDebug()
Try
userPrincipalName = System.DirectoryServices.AccountManagement.UserPrincipal.Current.UserPrincipalName
Catch
Catch ex As Exception
MsgBox("Login_Load: " & ex.Message)
End Try
BenutzeranmeldeName = Environment.UserDomainName & "\" & Environment.UserName
' MsgBox(userPrincipalName & vbCrLf & BenutzeranmeldeName)
End Sub
Private Function ReturnLDAP(ByVal DomainName As String) As String
Select Case DomainName
Case "IMEX"
Return "LDAP://DC=IMEX,DC=LOCAL"
Case "VERAGNEUHAUS"
Return "LDAP://DC=VERAGNEUHAUS,DC=LOCAL"
Case "VERAGOST"
Return "LDAP://DC=VERAG,DC=OST,DC=DMN"
End Select
End Function
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
lblInfo.Text = ""
Login()
@@ -35,20 +51,39 @@ Public Class Login
Public Function Abfrage(user As String, Optional ByVal txt As Boolean = False)
Dim locGroups As List(Of String) = GetUserGroupMembership(user)
Dim gefunden As Boolean = False
' Dim debugtext As String = ""
Class1.LoggedOnUser.FillWithLoggedOnUser(True)
Class1.GroupUsers = uscntr_Benutzer.LoadAllGroupmembers()
'showusersinlist()
For Each group As String In locGroups
If group = "CN=SG_Doku_User_FULL" Then
Class1.LoggedOnUser.FillWithLoggedOnUser(True)
For Each usr As cBenutzer In Class1.GroupUsers
'MsgBox(usr.msDSPrincipalName & vbCrLf & cSharedClasses.LoggedOnUser.msDSPrincipalName)
If usr.msDSPrincipalName.ToString = Class1.LoggedOnUser.msDSPrincipalName.ToString Then
' MsgBox("Treffer!")
Class1.LoggedOnUserRights = cBerechtigungen.ReadAll(Class1.LoggedOnUser.BenutzeranmeldeName)
gefunden = True
'Main.Show()
Class1.GroupUsers = uscntr_Benutzer.LoadAllGroupmembers()
showusersinlist()
ShowMain()
Me.Hide()
Exit For
End If
Next
'For Each group As String In locGroups
' debugtext &= group & vbCrLf
' If group = "CN=SG_Doku_User_FULL" Then
' Class1.LoggedOnUser.FillWithLoggedOnUser(True)
' Class1.LoggedOnUserRights = cBerechtigungen.ReadAll(Class1.LoggedOnUser.BenutzeranmeldeName)
' gefunden = True
' 'Main.Show()
' 'Class1.GroupUsers = uscntr_Benutzer.LoadAllGroupmembers()
' 'showusersinlist()
' ShowMain()
' Me.Hide()
' End If
'Next
' MsgBox(debugtext)
If gefunden = True Then
Exit Function
Else
Me.WindowState = Me.WindowState.Normal
@@ -120,9 +155,22 @@ Public Class Login
Debug.WriteLine("User nicht gefunden!")
End If
'Dim locDirectorySearcher3 As New DirectoryServices.DirectorySearcher(locDirectoryEntry, "msDS-PrincipalName=" & locUsername)
'Dim locSearchResult3 As DirectoryServices.SearchResult = locDirectorySearcher3.FindOne
'If locSearchResult3 IsNot Nothing Then
' Dim locUserEntry As New DirectoryServices.DirectoryEntry(locSearchResult3.Path)
' Dim locGroups As Object = locUserEntry.Invoke("Groups")
' For Each locGroupObj As Object In DirectCast(locGroups, IEnumerable)
' Dim locGroupEntry As New DirectoryServices.DirectoryEntry(locGroupObj)
' locResult.Add(locGroupEntry.Name)
' Next
'Else
' Debug.WriteLine("User nicht gefunden!")
'End If
Catch ex As Exception
MessageBox.Show(ex.Message, "GetUserGroupMembership", MessageBoxButtons.OK, MessageBoxIcon.Error)
MessageBox.Show("GetUserGroupMembership: " & ex.Message, "GetUserGroupMembership", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
Return locResult
End Function
@@ -156,15 +204,18 @@ Public Class Login
For Each right As cBerechtigungen In Class1.LoggedOnUserRights
If right.Standort = "DokuAdmin" And right.Zugriff = "Y" Then
main.BenutzerToolStripMenuItem.Enabled = True : Exit For
Class1.LoggedOnUserisAdmin = True
main.BenutzerToolStripMenuItem.Enabled = True
main.NetzwerkeToolStripMenuItem.Enabled = True
Exit For
Else
main.BenutzerToolStripMenuItem.Enabled = False
main.NetzwerkeToolStripMenuItem.Enabled = False
End If
Next
main.Show()
End Function

View File

@@ -96,6 +96,7 @@ Partial Class Main
Me.TimerUhrzeit = New System.Windows.Forms.Timer(Me.components)
Me.TimerUpdate = New System.Windows.Forms.Timer(Me.components)
Me.TimerWillkommen = New System.Windows.Forms.Timer(Me.components)
Me.ToolStripMenuItemINFO = New System.Windows.Forms.ToolStripMenuItem()
Me.Panel2.SuspendLayout()
Me.Panel4.SuspendLayout()
Me.PanType.SuspendLayout()
@@ -316,7 +317,7 @@ Partial Class Main
'MenuStrip1
'
Me.MenuStrip1.BackColor = System.Drawing.SystemColors.GradientActiveCaption
Me.MenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripMenuItem1, Me.ToolStripMenuItem2})
Me.MenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripMenuItem1, Me.ToolStripMenuItem2, Me.ToolStripMenuItemINFO})
Me.MenuStrip1.Location = New System.Drawing.Point(0, 0)
Me.MenuStrip1.Name = "MenuStrip1"
Me.MenuStrip1.Size = New System.Drawing.Size(1477, 24)
@@ -333,48 +334,48 @@ Partial Class Main
'NetzwerkeToolStripMenuItem
'
Me.NetzwerkeToolStripMenuItem.Name = "NetzwerkeToolStripMenuItem"
Me.NetzwerkeToolStripMenuItem.Size = New System.Drawing.Size(177, 22)
Me.NetzwerkeToolStripMenuItem.Size = New System.Drawing.Size(180, 22)
Me.NetzwerkeToolStripMenuItem.Text = "Tabellen bearbeiten"
'
'AnsichtDruckenToolStripMenuItem
'
Me.AnsichtDruckenToolStripMenuItem.Name = "AnsichtDruckenToolStripMenuItem"
Me.AnsichtDruckenToolStripMenuItem.Size = New System.Drawing.Size(177, 22)
Me.AnsichtDruckenToolStripMenuItem.Size = New System.Drawing.Size(180, 22)
Me.AnsichtDruckenToolStripMenuItem.Text = "Drucken"
'
'ExportToolStripMenuItem
'
Me.ExportToolStripMenuItem.Name = "ExportToolStripMenuItem"
Me.ExportToolStripMenuItem.Size = New System.Drawing.Size(177, 22)
Me.ExportToolStripMenuItem.Size = New System.Drawing.Size(180, 22)
Me.ExportToolStripMenuItem.Text = "Export"
'
'ImportToolStripMenuItem
'
Me.ImportToolStripMenuItem.Name = "ImportToolStripMenuItem"
Me.ImportToolStripMenuItem.Size = New System.Drawing.Size(177, 22)
Me.ImportToolStripMenuItem.Size = New System.Drawing.Size(180, 22)
Me.ImportToolStripMenuItem.Text = "Import"
'
'BenutzerToolStripMenuItem
'
Me.BenutzerToolStripMenuItem.Name = "BenutzerToolStripMenuItem"
Me.BenutzerToolStripMenuItem.Size = New System.Drawing.Size(177, 22)
Me.BenutzerToolStripMenuItem.Size = New System.Drawing.Size(180, 22)
Me.BenutzerToolStripMenuItem.Text = "Benutzer"
'
'ToolStripSeparator1
'
Me.ToolStripSeparator1.Name = "ToolStripSeparator1"
Me.ToolStripSeparator1.Size = New System.Drawing.Size(174, 6)
Me.ToolStripSeparator1.Size = New System.Drawing.Size(177, 6)
'
'UpdateToolStripMenuItem
'
Me.UpdateToolStripMenuItem.Name = "UpdateToolStripMenuItem"
Me.UpdateToolStripMenuItem.Size = New System.Drawing.Size(177, 22)
Me.UpdateToolStripMenuItem.Size = New System.Drawing.Size(180, 22)
Me.UpdateToolStripMenuItem.Text = "Update"
'
'ExitToolStripMenuItem
'
Me.ExitToolStripMenuItem.Name = "ExitToolStripMenuItem"
Me.ExitToolStripMenuItem.Size = New System.Drawing.Size(177, 22)
Me.ExitToolStripMenuItem.Size = New System.Drawing.Size(180, 22)
Me.ExitToolStripMenuItem.Text = "Exit"
'
'ToolStripMenuItem2
@@ -777,6 +778,13 @@ Partial Class Main
Me.TimerWillkommen.Enabled = True
Me.TimerWillkommen.Interval = 5000
'
'ToolStripMenuItemINFO
'
Me.ToolStripMenuItemINFO.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right
Me.ToolStripMenuItemINFO.Name = "ToolStripMenuItemINFO"
Me.ToolStripMenuItemINFO.Size = New System.Drawing.Size(24, 20)
Me.ToolStripMenuItemINFO.Text = "?"
'
'Main
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@@ -886,4 +894,5 @@ Partial Class Main
Friend WithEvents TimerWillkommen As Timer
Friend WithEvents btnTest3 As Button
Friend WithEvents ToolStripMenuItem2 As ToolStripMenuItem
Friend WithEvents ToolStripMenuItemINFO As ToolStripMenuItem
End Class

View File

@@ -35,7 +35,7 @@ Public Class Main
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
LblUhrzeit.Text = "Willkommen " & cSharedClasses.LoggedOnUser.Name
LblUhrzeit.Text = "Willkommen " & Class1.LoggedOnUser.Name
Class1.EnableDoubleBuffered(DgVMain)
@@ -188,7 +188,16 @@ Public Class Main
Catch ex As Exception
MsgBox("DataadapterFill LstStandOrtLoad(): " & ex.Message)
End Try
LstStandort.SelectedItem = "Verag_SUB"
'MsgBox(LstStandort.Items.Count)
If Class1.LoggedOnUser.Domäne = "verag.ost.dmn" Then
LstStandort.SelectedItem = "Verag_SUB"
' MsgBox("Hier")
Else
LstStandort.SelectedIndex = 0
'MsgBox("Dort")
End If
Dim dsa As New DataSet()
SQL.SQL2DS("select distinct Rubrik from tbl_allgemein", dsa)
@@ -348,6 +357,21 @@ Public Class Main
Suchparameter = "TYPE = '" & LstType.SelectedItem & "' AND (Type LIKE'" & suchbegriff & "'OR FQDN LIKE'" & suchbegriff & "'OR QINFO LIKE'" & suchbegriff & "'OR IPAdresse LIKE'" & suchbegriff & "'OR Modell LIKE'" & suchbegriff & "'OR Standort LIKE'" & suchbegriff & "')"
End If
'''BERECHTIGUNGEN ABFRAGEN'''
Suchparameter &= "AND ("
'For Each ber As cBerechtigungen In Class1.LoggedOnUserRights
' If Not ber.Zugriff = "0" Then
' Suchparameter &= "NWSTANDORT =" & ber.Standort & " OR "
' End If
'Next
For Each ShownStandort In Class1.Standorte
Suchparameter &= "NWSTANDORT ='" & ShownStandort & "' OR "
Next
Suchparameter = Suchparameter.Substring(0, Suchparameter.Length - 3)
Suchparameter &= ")"
''''''''''''''''''''''''''''''''''''''''''''
If Not ChkFreieHosts.Checked Then
'AND (DHCP = '0' OR DHCP is Null)
Suchparameter &= " and FQDN is not NULL"
@@ -412,10 +436,12 @@ Public Class Main
NetzwerkInfoAnzeige()
Else
Suchparameter = "(TITEL LIKE'" & suchbegriff & "'OR INFO LIKE'" & suchbegriff & "'OR LINK LIKE'" & suchbegriff & "')"
Dim dataadapter As New SqlDataAdapter("select * from TbL_Allgemein where " & Suchparameter & "", con)
con.Open()
dataadapter.Fill(ds)
con.Close()
'Dim dataadapter As New SqlDataAdapter("select * from TbL_Allgemein where " & Suchparameter & "", con)
'con.Open()
'dataadapter.Fill(ds)
'con.Close()
SQL.SQL2DS("select * from TbL_Allgemein left join TbL_Berechtigungen on TbL_Allgemein.ID = TbL_Berechtigungen.Standort where ((Benutzeranmeldename = '" & Class1.LoggedOnUser.BenutzeranmeldeName & "' AND not Zugriff = '0') OR (Zugriff is null )) AND (Rubrik = '" & LstAllgemein.SelectedItem & "') AND " & Suchparameter & "", ds)
dgvfill(ds, "Allgemein")
' MsgBox("keine Wahl")
@@ -557,6 +583,10 @@ Public Class Main
.Columns("Link").Visible = False
.Columns("LinkedWith").Visible = False
.Columns("Titel").Width = 150
.Columns("Zugriff").Visible = False
.Columns("Standort").Visible = False
.Columns("ID1").Visible = False
.Columns("Benutzeranmeldename").Visible = False
.Sort(DgVMain.Columns("Titel"), System.ComponentModel.ListSortDirection.Ascending)
If ChKZugangsdaten.Checked = False Then
.Columns("Benutzer").Visible = False
@@ -758,7 +788,8 @@ Public Class Main
frm.Panel1.Enabled = False : frm.PanFirewall.Enabled = False
End If
AddHandler frm.FormClosing, Function()
Me.BringToFront()
dgvload_filter(Suchbegriff)
End Function
frm.Show()
@@ -768,11 +799,14 @@ Public Class Main
Eintrag.ID = Class1.DBNull2emptyString(DgVMain.CurrentRow.Cells("ID").Value)
Eintrag.rubrik = Class1.DBNull2emptyString(DgVMain.CurrentRow.Cells("Rubrik").Value)
Eintrag.Titel = Class1.DBNull2emptyString(DgVMain.CurrentRow.Cells("Titel").Value)
Eintrag.Berechtigung = Class1.DBNull2emptyString(DgVMain.CurrentRow.Cells("Zugriff").Value)
Eintrag.getFromSQL()
Dim frm As New frmAllgemeinEintrag
frm.Eintrag = Eintrag
frm.Text = Eintrag.Titel
frm.btnBerechtigungen.Enabled = Class1.LoggedOnUserisAdmin
AddHandler frm.FormClosing, Function()
Me.BringToFront()
dgvload(Tabelle)
LstAllgemein.SelectedItem = Eintrag.rubrik
DgVMain.Rows(SelectedDGVIndex).Selected = True
@@ -1059,23 +1093,18 @@ Public Class Main
End Sub
Public Function CheckUpdate(starter As String)
dbload()
Dim RemoteVersion As String = ""
LblVersion.Text = "Version: " & Version
Try
con.Close()
conadmin.Open()
cmdadmin.CommandText = "SELECT prog_aktuelleVersion FROM ADMIN.dbo.tblProgramme WHERE prog_codename= '" & My.Resources.Programmcode & "'"
reader = cmdadmin.ExecuteReader()
Do While reader.Read()
RemoteVersion = reader("prog_aktuelleVersion")
Loop
reader.Close()
conadmin.Close()
Dim ds As New DataSet
SQL.SQL2DS("SELECT prog_aktuelleVersion FROM ADMIN.dbo.tblProgramme WHERE prog_codename= '" & My.Resources.Programmcode & "'", ds)
If ds.Tables(0).Rows.Count Then
RemoteVersion = ds.Tables(0).Rows(0).Item(0).ToString
End If
Catch ex As Exception
'reader.Close()
MsgBox("Kann RemoteVersion nicht abfragen." & ex.Message)
TimerUpdate.Enabled = False
conadmin.Close()
Exit Function
End Try
@@ -1134,14 +1163,21 @@ Public Class Main
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnNeu.Click
Neu = True
Dim Eintrag As New EintragBearbeiten
Dim frm As New frmAllgemeinEintrag
frm.Text = "Neuer Eintrag"
'Eintrag.Titel = Class1.DBNull2emptyString((DgVMain.CurrentRow.Cells("Titel").Value))
If Class1.DBNull2emptyString((DgVMain.CurrentRow.Cells("Rubrik").Value)) = "" Then
Eintrag.rubrik = Class1.DBNull2emptyString((DgVMain.Rows(0).Cells("Rubrik").Value))
frm.Eintrag.rubrik = Class1.DBNull2emptyString((DgVMain.Rows(0).Cells("Rubrik").Value))
Else
Eintrag.rubrik = Class1.DBNull2emptyString((DgVMain.CurrentRow.Cells("Rubrik").Value))
frm.Eintrag.rubrik = Class1.DBNull2emptyString((DgVMain.CurrentRow.Cells("Rubrik").Value))
End If
Eintrag.Show()
AddHandler frm.FormClosing, Function()
Me.BringToFront()
dgvload(Tabelle)
LstAllgemein.SelectedItem = frm.Eintrag.rubrik
DgVMain.Rows(SelectedDGVIndex).Selected = True
End Function
frm.Show()
End Sub
Private Sub TimerWillkommen_Tick(sender As Object, e As EventArgs) Handles TimerWillkommen.Tick
@@ -1165,6 +1201,14 @@ Public Class Main
End Sub
Private Sub ToolStripMenuItemINFO_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItemINFO.Click
Dim frm As New frmLeer
frm.Text = "INFO"
Dim usrcntrl As New uscntr_INFO
usrcntrl.Dock = DockStyle.Fill : frm.PanMain.Controls.Add(usrcntrl)
frm.Show()
End Sub
Private Sub ObjektLöschenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ObjektLöschenToolStripMenuItem.Click
If Tabelle = "TbL_Netzwerkclients" Then

View File

@@ -169,7 +169,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die 0.0.1.30 ähnelt.
''' Sucht eine lokalisierte Zeichenfolge, die 0.0.1.31 ähnelt.
'''</summary>
Friend ReadOnly Property Version() As String
Get

View File

@@ -131,7 +131,7 @@
<value>..\Resources\Link.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Version" xml:space="preserve">
<value>0.0.1.30</value>
<value>0.0.1.31</value>
</data>
<data name="Link" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Link.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>

View File

@@ -26,6 +26,11 @@ Partial Class frmAllgemeinEintrag
Me.CmdTest = New System.Windows.Forms.Button()
Me.Panel2 = New System.Windows.Forms.Panel()
Me.TxtInfo = New System.Windows.Forms.TextBox()
Me.Panel4 = New System.Windows.Forms.Panel()
Me.PanContr = New System.Windows.Forms.Panel()
Me.CmdLink = New System.Windows.Forms.Button()
Me.CmdDateien = New System.Windows.Forms.Button()
Me.CmdAbbrechen = New System.Windows.Forms.Button()
Me.PanWrite = New System.Windows.Forms.Panel()
Me.btnBerechtigungen = New System.Windows.Forms.Button()
Me.Label7 = New System.Windows.Forms.Label()
@@ -33,13 +38,10 @@ Partial Class frmAllgemeinEintrag
Me.TxtBenutzername = New System.Windows.Forms.TextBox()
Me.TxtKennwort = New System.Windows.Forms.TextBox()
Me.Label6 = New System.Windows.Forms.Label()
Me.CmdLink = New System.Windows.Forms.Button()
Me.LblLink = New System.Windows.Forms.Label()
Me.CmdDateien = New System.Windows.Forms.Button()
Me.TxtLink = New System.Windows.Forms.TextBox()
Me.CmdDelete = New System.Windows.Forms.Button()
Me.CmdSave = New System.Windows.Forms.Button()
Me.CmdAbbrechen = New System.Windows.Forms.Button()
Me.CmdReset = New System.Windows.Forms.Button()
Me.Panelhinten = New System.Windows.Forms.Panel()
Me.PanTop = New System.Windows.Forms.Panel()
@@ -47,14 +49,12 @@ Partial Class frmAllgemeinEintrag
Me.TxtTitel = New System.Windows.Forms.TextBox()
Me.Label3 = New System.Windows.Forms.Label()
Me.TxtRubrik = New System.Windows.Forms.TextBox()
Me.Panel4 = New System.Windows.Forms.Panel()
Me.PanContr = New System.Windows.Forms.Panel()
Me.Panel2.SuspendLayout()
Me.Panel4.SuspendLayout()
Me.PanContr.SuspendLayout()
Me.PanWrite.SuspendLayout()
Me.Panelhinten.SuspendLayout()
Me.PanTop.SuspendLayout()
Me.Panel4.SuspendLayout()
Me.PanContr.SuspendLayout()
Me.SuspendLayout()
'
'CmdTest
@@ -62,7 +62,7 @@ Partial Class frmAllgemeinEintrag
Me.CmdTest.BackColor = System.Drawing.SystemColors.ControlLightLight
Me.CmdTest.FlatAppearance.BorderColor = System.Drawing.Color.DimGray
Me.CmdTest.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.CmdTest.Location = New System.Drawing.Point(15, 10)
Me.CmdTest.Location = New System.Drawing.Point(12, 10)
Me.CmdTest.Name = "CmdTest"
Me.CmdTest.Size = New System.Drawing.Size(94, 23)
Me.CmdTest.TabIndex = 108
@@ -77,7 +77,7 @@ Partial Class frmAllgemeinEintrag
Me.Panel2.Dock = System.Windows.Forms.DockStyle.Fill
Me.Panel2.Location = New System.Drawing.Point(0, 100)
Me.Panel2.Name = "Panel2"
Me.Panel2.Size = New System.Drawing.Size(790, 591)
Me.Panel2.Size = New System.Drawing.Size(642, 590)
Me.Panel2.TabIndex = 108
'
'TxtInfo
@@ -87,9 +87,69 @@ Partial Class frmAllgemeinEintrag
Me.TxtInfo.Multiline = True
Me.TxtInfo.Name = "TxtInfo"
Me.TxtInfo.ScrollBars = System.Windows.Forms.ScrollBars.Both
Me.TxtInfo.Size = New System.Drawing.Size(790, 426)
Me.TxtInfo.Size = New System.Drawing.Size(642, 425)
Me.TxtInfo.TabIndex = 3
'
'Panel4
'
Me.Panel4.BackColor = System.Drawing.SystemColors.GradientInactiveCaption
Me.Panel4.Controls.Add(Me.PanContr)
Me.Panel4.Controls.Add(Me.PanWrite)
Me.Panel4.Dock = System.Windows.Forms.DockStyle.Bottom
Me.Panel4.Location = New System.Drawing.Point(0, 425)
Me.Panel4.Name = "Panel4"
Me.Panel4.Size = New System.Drawing.Size(642, 165)
Me.Panel4.TabIndex = 110
'
'PanContr
'
Me.PanContr.BackColor = System.Drawing.SystemColors.GradientInactiveCaption
Me.PanContr.Controls.Add(Me.CmdLink)
Me.PanContr.Controls.Add(Me.CmdTest)
Me.PanContr.Controls.Add(Me.CmdDateien)
Me.PanContr.Controls.Add(Me.CmdAbbrechen)
Me.PanContr.Dock = System.Windows.Forms.DockStyle.Right
Me.PanContr.Location = New System.Drawing.Point(479, 0)
Me.PanContr.Name = "PanContr"
Me.PanContr.Size = New System.Drawing.Size(163, 165)
Me.PanContr.TabIndex = 110
'
'CmdLink
'
Me.CmdLink.BackColor = System.Drawing.SystemColors.ControlLightLight
Me.CmdLink.FlatAppearance.BorderColor = System.Drawing.Color.DimGray
Me.CmdLink.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.CmdLink.Location = New System.Drawing.Point(3, 81)
Me.CmdLink.Name = "CmdLink"
Me.CmdLink.Size = New System.Drawing.Size(90, 23)
Me.CmdLink.TabIndex = 102
Me.CmdLink.Text = "Link öffnen"
Me.CmdLink.UseVisualStyleBackColor = False
'
'CmdDateien
'
Me.CmdDateien.BackColor = System.Drawing.SystemColors.ControlLightLight
Me.CmdDateien.FlatAppearance.BorderColor = System.Drawing.Color.DimGray
Me.CmdDateien.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.CmdDateien.Location = New System.Drawing.Point(3, 51)
Me.CmdDateien.Name = "CmdDateien"
Me.CmdDateien.Size = New System.Drawing.Size(90, 23)
Me.CmdDateien.TabIndex = 98
Me.CmdDateien.Text = "Dateien"
Me.CmdDateien.UseVisualStyleBackColor = False
'
'CmdAbbrechen
'
Me.CmdAbbrechen.BackColor = System.Drawing.SystemColors.ControlLightLight
Me.CmdAbbrechen.FlatAppearance.BorderColor = System.Drawing.Color.DimGray
Me.CmdAbbrechen.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.CmdAbbrechen.Location = New System.Drawing.Point(60, 130)
Me.CmdAbbrechen.Name = "CmdAbbrechen"
Me.CmdAbbrechen.Size = New System.Drawing.Size(90, 23)
Me.CmdAbbrechen.TabIndex = 9
Me.CmdAbbrechen.Text = "Schließen"
Me.CmdAbbrechen.UseVisualStyleBackColor = False
'
'PanWrite
'
Me.PanWrite.BackColor = System.Drawing.SystemColors.GradientInactiveCaption
@@ -107,7 +167,7 @@ Partial Class frmAllgemeinEintrag
Me.PanWrite.Dock = System.Windows.Forms.DockStyle.Left
Me.PanWrite.Location = New System.Drawing.Point(0, 0)
Me.PanWrite.Name = "PanWrite"
Me.PanWrite.Size = New System.Drawing.Size(587, 165)
Me.PanWrite.Size = New System.Drawing.Size(473, 165)
Me.PanWrite.TabIndex = 109
'
'btnBerechtigungen
@@ -115,7 +175,7 @@ Partial Class frmAllgemeinEintrag
Me.btnBerechtigungen.BackColor = System.Drawing.SystemColors.ControlLightLight
Me.btnBerechtigungen.FlatAppearance.BorderColor = System.Drawing.Color.DimGray
Me.btnBerechtigungen.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnBerechtigungen.Location = New System.Drawing.Point(203, 91)
Me.btnBerechtigungen.Location = New System.Drawing.Point(380, 80)
Me.btnBerechtigungen.Name = "btnBerechtigungen"
Me.btnBerechtigungen.Size = New System.Drawing.Size(90, 23)
Me.btnBerechtigungen.TabIndex = 109
@@ -134,7 +194,7 @@ Partial Class frmAllgemeinEintrag
'ChkKennwortAnzeigen
'
Me.ChkKennwortAnzeigen.AutoSize = True
Me.ChkKennwortAnzeigen.Location = New System.Drawing.Point(393, 9)
Me.ChkKennwortAnzeigen.Location = New System.Drawing.Point(223, 48)
Me.ChkKennwortAnzeigen.Name = "ChkKennwortAnzeigen"
Me.ChkKennwortAnzeigen.Size = New System.Drawing.Size(70, 17)
Me.ChkKennwortAnzeigen.TabIndex = 6
@@ -150,7 +210,7 @@ Partial Class frmAllgemeinEintrag
'
'TxtKennwort
'
Me.TxtKennwort.Location = New System.Drawing.Point(299, 26)
Me.TxtKennwort.Location = New System.Drawing.Point(11, 65)
Me.TxtKennwort.Name = "TxtKennwort"
Me.TxtKennwort.PasswordChar = Global.Microsoft.VisualBasic.ChrW(42)
Me.TxtKennwort.Size = New System.Drawing.Size(282, 20)
@@ -159,48 +219,24 @@ Partial Class frmAllgemeinEintrag
'Label6
'
Me.Label6.AutoSize = True
Me.Label6.Location = New System.Drawing.Point(296, 9)
Me.Label6.Location = New System.Drawing.Point(8, 49)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(55, 13)
Me.Label6.TabIndex = 91
Me.Label6.Text = "Kennwort:"
'
'CmdLink
'
Me.CmdLink.BackColor = System.Drawing.SystemColors.ControlLightLight
Me.CmdLink.FlatAppearance.BorderColor = System.Drawing.Color.DimGray
Me.CmdLink.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.CmdLink.Location = New System.Drawing.Point(15, 94)
Me.CmdLink.Name = "CmdLink"
Me.CmdLink.Size = New System.Drawing.Size(90, 23)
Me.CmdLink.TabIndex = 102
Me.CmdLink.Text = "Link öffnen"
Me.CmdLink.UseVisualStyleBackColor = False
'
'LblLink
'
Me.LblLink.AutoSize = True
Me.LblLink.Location = New System.Drawing.Point(8, 49)
Me.LblLink.Location = New System.Drawing.Point(8, 88)
Me.LblLink.Name = "LblLink"
Me.LblLink.Size = New System.Drawing.Size(85, 13)
Me.LblLink.TabIndex = 92
Me.LblLink.Text = "Link zum Dienst:"
'
'CmdDateien
'
Me.CmdDateien.BackColor = System.Drawing.SystemColors.ControlLightLight
Me.CmdDateien.FlatAppearance.BorderColor = System.Drawing.Color.DimGray
Me.CmdDateien.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.CmdDateien.Location = New System.Drawing.Point(15, 65)
Me.CmdDateien.Name = "CmdDateien"
Me.CmdDateien.Size = New System.Drawing.Size(90, 23)
Me.CmdDateien.TabIndex = 98
Me.CmdDateien.Text = "Dateien"
Me.CmdDateien.UseVisualStyleBackColor = False
'
'TxtLink
'
Me.TxtLink.Location = New System.Drawing.Point(11, 65)
Me.TxtLink.Location = New System.Drawing.Point(11, 104)
Me.TxtLink.Name = "TxtLink"
Me.TxtLink.Size = New System.Drawing.Size(282, 20)
Me.TxtLink.TabIndex = 7
@@ -210,7 +246,7 @@ Partial Class frmAllgemeinEintrag
Me.CmdDelete.BackColor = System.Drawing.SystemColors.ControlLightLight
Me.CmdDelete.FlatAppearance.BorderColor = System.Drawing.Color.DimGray
Me.CmdDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.CmdDelete.Location = New System.Drawing.Point(11, 91)
Me.CmdDelete.Location = New System.Drawing.Point(380, 23)
Me.CmdDelete.Name = "CmdDelete"
Me.CmdDelete.Size = New System.Drawing.Size(90, 23)
Me.CmdDelete.TabIndex = 97
@@ -222,31 +258,19 @@ Partial Class frmAllgemeinEintrag
Me.CmdSave.BackColor = System.Drawing.SystemColors.ControlLightLight
Me.CmdSave.FlatAppearance.BorderColor = System.Drawing.Color.DimGray
Me.CmdSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.CmdSave.Location = New System.Drawing.Point(393, 91)
Me.CmdSave.Location = New System.Drawing.Point(380, 109)
Me.CmdSave.Name = "CmdSave"
Me.CmdSave.Size = New System.Drawing.Size(90, 23)
Me.CmdSave.TabIndex = 8
Me.CmdSave.Text = "Speichern"
Me.CmdSave.UseVisualStyleBackColor = False
'
'CmdAbbrechen
'
Me.CmdAbbrechen.BackColor = System.Drawing.SystemColors.ControlLightLight
Me.CmdAbbrechen.FlatAppearance.BorderColor = System.Drawing.Color.DimGray
Me.CmdAbbrechen.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.CmdAbbrechen.Location = New System.Drawing.Point(98, 130)
Me.CmdAbbrechen.Name = "CmdAbbrechen"
Me.CmdAbbrechen.Size = New System.Drawing.Size(90, 23)
Me.CmdAbbrechen.TabIndex = 9
Me.CmdAbbrechen.Text = "Schließen"
Me.CmdAbbrechen.UseVisualStyleBackColor = False
'
'CmdReset
'
Me.CmdReset.BackColor = System.Drawing.SystemColors.ControlLightLight
Me.CmdReset.FlatAppearance.BorderColor = System.Drawing.Color.DimGray
Me.CmdReset.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.CmdReset.Location = New System.Drawing.Point(107, 91)
Me.CmdReset.Location = New System.Drawing.Point(380, 51)
Me.CmdReset.Name = "CmdReset"
Me.CmdReset.Size = New System.Drawing.Size(90, 23)
Me.CmdReset.TabIndex = 94
@@ -260,7 +284,7 @@ Partial Class frmAllgemeinEintrag
Me.Panelhinten.Dock = System.Windows.Forms.DockStyle.Fill
Me.Panelhinten.Location = New System.Drawing.Point(0, 0)
Me.Panelhinten.Name = "Panelhinten"
Me.Panelhinten.Size = New System.Drawing.Size(790, 691)
Me.Panelhinten.Size = New System.Drawing.Size(642, 690)
Me.Panelhinten.TabIndex = 110
'
'PanTop
@@ -273,7 +297,7 @@ Partial Class frmAllgemeinEintrag
Me.PanTop.Dock = System.Windows.Forms.DockStyle.Top
Me.PanTop.Location = New System.Drawing.Point(0, 0)
Me.PanTop.Name = "PanTop"
Me.PanTop.Size = New System.Drawing.Size(790, 100)
Me.PanTop.Size = New System.Drawing.Size(642, 100)
Me.PanTop.TabIndex = 107
'
'Label1
@@ -308,47 +332,24 @@ Partial Class frmAllgemeinEintrag
Me.TxtRubrik.Size = New System.Drawing.Size(618, 20)
Me.TxtRubrik.TabIndex = 1
'
'Panel4
'
Me.Panel4.Controls.Add(Me.PanContr)
Me.Panel4.Controls.Add(Me.PanWrite)
Me.Panel4.Dock = System.Windows.Forms.DockStyle.Bottom
Me.Panel4.Location = New System.Drawing.Point(0, 426)
Me.Panel4.Name = "Panel4"
Me.Panel4.Size = New System.Drawing.Size(790, 165)
Me.Panel4.TabIndex = 110
'
'PanContr
'
Me.PanContr.BackColor = System.Drawing.SystemColors.GradientInactiveCaption
Me.PanContr.Controls.Add(Me.CmdLink)
Me.PanContr.Controls.Add(Me.CmdTest)
Me.PanContr.Controls.Add(Me.CmdDateien)
Me.PanContr.Controls.Add(Me.CmdAbbrechen)
Me.PanContr.Dock = System.Windows.Forms.DockStyle.Right
Me.PanContr.Location = New System.Drawing.Point(590, 0)
Me.PanContr.Name = "PanContr"
Me.PanContr.Size = New System.Drawing.Size(200, 165)
Me.PanContr.TabIndex = 110
'
'frmAllgemeinEintrag
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(790, 691)
Me.ClientSize = New System.Drawing.Size(642, 690)
Me.Controls.Add(Me.Panelhinten)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.Name = "frmAllgemeinEintrag"
Me.Text = "frmAllgemeinEintrag"
Me.Panel2.ResumeLayout(False)
Me.Panel2.PerformLayout()
Me.Panel4.ResumeLayout(False)
Me.PanContr.ResumeLayout(False)
Me.PanWrite.ResumeLayout(False)
Me.PanWrite.PerformLayout()
Me.Panelhinten.ResumeLayout(False)
Me.PanTop.ResumeLayout(False)
Me.PanTop.PerformLayout()
Me.Panel4.ResumeLayout(False)
Me.PanContr.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub

View File

@@ -7,7 +7,8 @@
Private Sub frmAllgemeinEintrag_Load(sender As Object, e As EventArgs) Handles Me.Load
CmdTest.Visible = Class1.DebugMode
FillIn()
If GetRights() = "R" Then
If Eintrag.Berechtigung = "R" Then
' MsgBox("nur Leserecht")
PanTop.Enabled = False : TxtInfo.Enabled = False : PanWrite.Enabled = False
End If
End Sub
@@ -72,10 +73,138 @@
frm.Show()
End Sub
Function GetRights() As String
Berechtigung.Benutzeranmeldename = Class1.LoggedOnUser.BenutzeranmeldeName
Berechtigung.Standort = Eintrag.ID
Berechtigung.getFromSQL()
Return Berechtigung.Zugriff
Private Sub CmdAbbrechen_Click(sender As Object, e As EventArgs) Handles CmdAbbrechen.Click
Me.Close()
End Sub
Private Sub CmdDateien_Click(sender As Object, e As EventArgs) Handles CmdDateien.Click
openfilepath()
End Sub
Private Function openfilepath(Optional ByVal returnonlypath As Boolean = False)
Dim ds As New DataSet()
Dim islinked As Integer
Dim LinkedWith As String = ""
Dim path As String = ""
Try
'dbload()
'con.Open()
'Dim sda As New SqlDataAdapter("SELECT * FROM TbL_Allgemein WHERE " & abfrage & "", con)
'sda.Fill(ds)
'con.Close()
SQL.SQL2DS("SELECT * FROM TbL_Allgemein WHERE Rubrik='" & Eintrag.rubrik & "' AND Titel='" & Eintrag.Titel & "'", ds)
Dim Info As String = ds.Tables(0).Rows(0).Item("Info")
If IsDBNull(ds.Tables(0).Rows(0).Item("Linked")) Then
islinked = "0"
ElseIf Not IsDBNull(ds.Tables(0).Rows(0).Item("Linked")) Then
islinked = ds.Tables(0).Rows(0).Item("Linked")
End If
If IsDBNull(ds.Tables(0).Rows(0).Item("LinkedWith")) Then
LinkedWith = ""
ElseIf Not IsDBNull(ds.Tables(0).Rows(0).Item("LinkedWith")) Then
LinkedWith = ds.Tables(0).Rows(0).Item("LinkedWith")
End If
If islinked = "1" Then
Dim dslinked As New DataSet()
SQL.SQL2DS("SELECT * FROM Tbl_Allgemein WHERE LinkedWith='" & LinkedWith & "'", dslinked)
path = Class1.FilePath & "\" & dslinked.Tables(0).Rows(0).Item("Rubrik") & "\" & dslinked.Tables(0).Rows(0).Item("Titel") '& "\" & dslinked.Tables(0).Rows(0).Item("Host")
Else
'MsgBox("not linked")
path = Class1.FilePath & "\" & Eintrag.rubrik & "\" & Eintrag.Titel '& "\" & SenderHost
End If
Catch ex As Exception
MsgBox("openfilepath() Tbl_Allgemein: " & ex.Message)
End Try
''Pfad öffnen:
If returnonlypath = True Then
Return path
Exit Function
End If
Try
If IO.Directory.Exists(path) Then
Process.Start(path)
Else
IO.Directory.CreateDirectory(path)
Process.Start(path)
End If
Catch ex As Exception
End Try
End Function
Private Sub CmdDelete_Click(sender As Object, e As EventArgs) Handles CmdDelete.Click
Dim path As String
path = openfilepath(True) 'Class1.FilePath & "\" & Rubrik & "\" & Titel
If MsgBox("Eintrag wirklich löschen?", MsgBoxStyle.OkCancel) = MsgBoxResult.Ok Then
If MessageBox.Show("Dazugehörigen Ordner im Dateisystem löschen?", "Dateien löschen", MessageBoxButtons.YesNo) = DialogResult.Yes Then
deleteFiles(path, Eintrag.rubrik)
ElseIf DialogResult.No Then
Exit Sub
End If
SQL.DeleteSQL("TbL_Allgemein", "ID = '" & Eintrag.ID & "'")
' Main.LstStandortLoad()
Me.Close()
Else
Exit Sub
End If
End Sub
Private Function deleteFiles(path As String, Rubrik As String)
Dim rubrikpath As String = Class1.FilePath & "\" & Rubrik
Try
If IO.Directory.Exists(path) Then
Dim files As String() = IO.Directory.GetFiles(path)
For Each file As String In files
IO.File.Delete(file)
Next
IO.Directory.Delete(path, True)
Else
'MsgBox("Kein Ordner zum Löschen gefunden: wird übersprungen.")
End If
Catch ex As Exception
MsgBox("Beim Löschen der Dateien: " & ex.Message)
End Try
''Überprüfen, ob letzter Eintrag der Rubrik bzw. ob Odner der Rubrik leer ist:
Try
If IO.Directory.Exists(rubrikpath) Then
Dim files As String() = IO.Directory.GetFiles(rubrikpath)
Dim folder As String() = IO.Directory.GetDirectories(rubrikpath)
Dim out As String = ""
For Each row As String In files
out &= row
Next
For Each row As String In folder
out &= row
Next
If out IsNot "" Then
Exit Function
Else
IO.Directory.Delete(rubrikpath, True)
End If
Else
'MsgBox("Kein Ordner zum Löschen gefunden: wird übersprungen.")
End If
Catch ex As Exception
MsgBox("Beim Löschen der Dateien: " & ex.Message)
End Try
End Function
Private Sub CmdReset_Click(sender As Object, e As EventArgs) Handles CmdReset.Click
FillIn()
End Sub
End Class

View File

@@ -167,7 +167,7 @@
Private Sub Hostbearbeiten_Closing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
'abfrage_aenderungenspeichern()
Main.dgvload_filter(Main.Suchbegriff)
' Main.dgvload_filter(Main.Suchbegriff)
End Sub
Private Sub CmdAbbrechen_Click(sender As Object, e As EventArgs) Handles CmdAbbrechen.Click

View File

@@ -1,5 +1,4 @@
Public Class frmLeer
Property test As String = "Meh auch hier (Remote)"
End Class

View File

@@ -16,11 +16,11 @@
Function ZeigeBerechtigung()
Select Case Berechtigung.Zugriff
Case "0"
btnNope.BackColor = Color.Red
btnNope.BackColor = Color.Red : btnNope.PerformClick()
Case "R"
btnLesen.BackColor = Color.Yellow
btnLesen.BackColor = Color.Yellow : btnLesen.PerformClick()
Case "W"
btnSchreiben.BackColor = Color.Green
btnSchreiben.BackColor = Color.Green : btnSchreiben.PerformClick()
End Select
End Function

64
Dokumentation/uscntr_INFO.Designer.vb generated Normal file
View File

@@ -0,0 +1,64 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class uscntr_INFO
Inherits System.Windows.Forms.UserControl
'UserControl überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Wird vom Windows Form-Designer benötigt.
Private components As System.ComponentModel.IContainer
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.lblText = New System.Windows.Forms.Label()
Me.Panel1 = New System.Windows.Forms.Panel()
Me.Panel1.SuspendLayout()
Me.SuspendLayout()
'
'lblText
'
Me.lblText.AutoSize = True
Me.lblText.Location = New System.Drawing.Point(3, 0)
Me.lblText.Name = "lblText"
Me.lblText.Size = New System.Drawing.Size(39, 13)
Me.lblText.TabIndex = 0
Me.lblText.Text = "Label1"
'
'Panel1
'
Me.Panel1.Controls.Add(Me.lblText)
Me.Panel1.Location = New System.Drawing.Point(4, 4)
Me.Panel1.Name = "Panel1"
Me.Panel1.Size = New System.Drawing.Size(490, 275)
Me.Panel1.TabIndex = 1
'
'uscntr_INFO
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.AutoSize = True
Me.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink
Me.Controls.Add(Me.Panel1)
Me.Name = "uscntr_INFO"
Me.Size = New System.Drawing.Size(497, 282)
Me.Panel1.ResumeLayout(False)
Me.Panel1.PerformLayout()
Me.ResumeLayout(False)
End Sub
Friend WithEvents lblText As Label
Friend WithEvents Panel1 As Panel
End Class

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,12 @@
Public Class uscntr_INFO
Private Sub uscntr_INFO_Load(sender As Object, e As EventArgs) Handles Me.Load
Dim ben As cBenutzer = Class1.LoggedOnUser
lblText.Text = ben.BenutzeranmeldeName & vbCrLf &
ben.Vorname & " " & ben.Nachname & vbCrLf &
ben.Mail & vbCrLf &
ben.Domäne & vbCrLf &
ben.distinguishedName & vbCrLf &
vbCrLf &
Class1.DebugText
End Sub
End Class