Bugfixes, "Verbesserungen"

This commit is contained in:
ms
2019-09-25 10:01:04 +02:00
parent d07cbe0676
commit c0d894546a
18 changed files with 292 additions and 155 deletions

View File

@@ -1,16 +1,16 @@
Public Class frmHostBearbeiten
Public Shared IP As String = ""
Public host As New Host
Public host As New cHost
Private Sub frmHostBearbeiten_Load(sender As Object, e As EventArgs) Handles Me.Load
lblSuchfilter.Visible = Main.SucheAktiv
host = New Host
host = New cHost
host.gethost(IP)
fillform(host)
End Sub
Public Function fillform(host As Host, Optional ByVal Linked As Boolean = False)
Public Function fillform(host As cHost, Optional ByVal Linked As Boolean = False)
If Linked = False Then ''''''''''''''''''
TxtIP.Text = host.IPAdresse
TxtHost.Text = host.HOST
@@ -35,7 +35,7 @@
TxtLink.Text = host.LINK
Dim ds As New DataSet
Host.getSlaves(host.IPAdresse, ds)
cHost.getSlaves(host.IPAdresse, ds)
If ds.Tables(0).Rows.Count > 0 Then
ShowSlavesPanel(True, ds)
Else
@@ -49,7 +49,7 @@
End Function
Public Function LoadFromExternal(IPtoLoad As String)
Dim host As New Host
Dim host As New cHost
host.gethost(IPtoLoad)
fillform(host)
End Function
@@ -123,23 +123,27 @@
If sender.name = "CmdIPUp" Then
If Main.SelectedDGVIndex + 1 < (meh.Rows.Count - 1) Then Main.SelectedDGVIndex = Main.SelectedDGVIndex + 1
newip = meh.Rows(Main.SelectedDGVIndex).Cells("IPAdresse").Value
If Main.FirstDisplayedDGVEntry + 1 <= endhost Then Main.FirstDisplayedDGVEntry = Main.FirstDisplayedDGVEntry + 1
'If Main.SelectedDGVIndex + 1 < (meh.Rows.Count - 1) Then Main.SelectedDGVIndex = Main.SelectedDGVIndex + 1
'newip = meh.Rows(Main.SelectedDGVIndex).Cells("IPAdresse").Value
'If Main.FirstDisplayedDGVEntry + 1 <= endhost Then Main.FirstDisplayedDGVEntry = Main.FirstDisplayedDGVEntry + 1
If Main.SelectedDGVIndex + 1 <= Class1.dtSuchergebnis.Rows.Count - 1 Then Main.SelectedDGVIndex = Main.SelectedDGVIndex + 1
newip = Class1.dtSuchergebnis.Rows(Main.SelectedDGVIndex).Item("IPAdresse")
End If
If sender.name = "CmdIPDown" Then
If sender.name = "CmdIPDown" Then
'If Main.SelectedDGVIndex - 1 >= 0 Then Main.SelectedDGVIndex = Main.SelectedDGVIndex - 1
'newip = meh.Rows(Main.SelectedDGVIndex).Cells("IPAdresse").Value
'If Main.FirstDisplayedDGVEntry - 1 >= 1 Then Main.FirstDisplayedDGVEntry = Main.FirstDisplayedDGVEntry - 1
If Main.SelectedDGVIndex - 1 >= 0 Then Main.SelectedDGVIndex = Main.SelectedDGVIndex - 1
newip = meh.Rows(Main.SelectedDGVIndex).Cells("IPAdresse").Value
If Main.FirstDisplayedDGVEntry - 1 >= 1 Then Main.FirstDisplayedDGVEntry = Main.FirstDisplayedDGVEntry - 1
newip = Class1.dtSuchergebnis.Rows(Main.SelectedDGVIndex).Item("IPAdresse")
End If
End If
host = New Host
host = New cHost
host.gethost(newip)
fillform(host)
End Sub
@@ -159,9 +163,11 @@
Private Sub CmdLink_Click(sender As Object, e As EventArgs) Handles CmdLink.Click
Dim NETNAME As String = host.NETNAME
Dim Netzwerk As String = host.Netzwerk
Dim NWStandort As String = host.NWSTANDORT
host.gethost(TxtLinkedWith.Text)
host.NETNAME = NETNAME
host.Netzwerk = Netzwerk
host.NWSTANDORT = NWStandort
fillform(host, True)
End Sub
@@ -225,14 +231,25 @@
If e.KeyValue = Keys.Enter Then
Dim Netz As String = Class1.ip2ipnet(TxtIP.Text)
Dim NewHost As String = TxtHost.Text
host = New Host
host = New cHost
host.gethost(Netz & NewHost)
fillform(host)
If IPzuIndex(host.IPAdresse) Then Main.SelectedDGVIndex = IPzuIndex(host.IPAdresse)
End If
Catch
End Try
End Sub
Private Function IPzuIndex(IP As String) As Integer
For i As Integer = 0 To Class1.dtSuchergebnis.Rows.Count
If Class1.dtSuchergebnis.Rows(i).Item("IPAdresse") = IP Then
Return i
Exit Function
End If
Next
Return -1
End Function
Private Sub ChkKennwortAnzeigen_CheckedChanged(sender As Object, e As EventArgs) Handles ChkKennwortAnzeigen.CheckedChanged
If ChkKennwortAnzeigen.Checked Then
TxtKennwort.PasswordChar = ""
@@ -250,13 +267,13 @@
End Sub
Private Sub CmdReset_Click(sender As Object, e As EventArgs) Handles CmdReset.Click
host = New Host
host = New cHost
host.gethost(TxtIP.Text)
fillform(host)
End Sub
Private Sub CmdCopy_Click(sender As Object, e As EventArgs) Handles CmdCopy.Click
Dim ZielHost As New Host
Dim ZielHost As New cHost
ZielHost = host
Dim ip As String
Class1.Host2IP(TxtHost.Text, host.NWSTANDORT, host.NETNAME, ip)
@@ -270,7 +287,7 @@
Private Sub CmdDelete_Click(sender As Object, e As EventArgs) Handles CmdDelete.Click
fillHost()
host.DeleteHost()
host = New Host
host = New cHost
host.gethost(TxtIP.Text)
fillform(host)
End Sub
@@ -299,7 +316,7 @@
End Sub
Private Sub GeheZuToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles GeheZuToolStripMenuItem.Click
Dim host As New Host
Dim host As New cHost
host.gethost(TxtLinkedWith.Text)
fillform(host)
End Sub
@@ -311,4 +328,6 @@
Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.DoubleClick
Clipboard.SetText(host.IPAdresse)
End Sub
End Class