SQL Abfragen angepasst
This commit is contained in:
@@ -29,11 +29,15 @@ Public Class Main
|
||||
|
||||
Private Version As String = My.Resources.Version
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
|
||||
Me.KeyPreview = True
|
||||
|
||||
If sAppPath = "C:\Users\miesenbeck\Documents\Visual Studio 2017\Sebastian Spielwiese\Dokumentation\Dokumentation\bin\Debug" Then
|
||||
If sAppPath = "C:\Users\miesenbeck\Documents\Visual Studio 2017\Sebastian Spielwiese\Dokumentation\Dokumentation\bin\Debug" Or sAppPath = "C:\Users\miesenbeck\source\repos\Doku\Dokumentation\bin\Debug" Then
|
||||
Debug = True
|
||||
LblDEBUGMODE.Visible = True
|
||||
LblDEBUGMODE.ForeColor = Color.Red
|
||||
@@ -363,22 +367,30 @@ Public Class Main
|
||||
Suchparameter &= " and FQDN is not NUll"
|
||||
End If
|
||||
|
||||
'''ABFRAGE DEFINIEREN'''
|
||||
'''
|
||||
'Dim SelSQL4DGV As String = "*"
|
||||
Dim SelSQL4DGV As String = "FQDN, IPAdresse, Modell, Standort, Type, Seriennummer, QINFO, Info, DHCP, Host"
|
||||
If ChKZugangsdaten.Checked Then
|
||||
SelSQL4DGV &= ", Benutzer, Passwort"
|
||||
End If
|
||||
|
||||
'''ABFRAGE RADIOBUTTONS + SUCHPARAMETER'''
|
||||
|
||||
If RadGlobal.Checked Then
|
||||
Dim dataadapter As New SqlDataAdapter("select * from TbL_Netzwerkclients where " & Suchparameter & " order by host", con)
|
||||
Dim dataadapter As New SqlDataAdapter("select " & SelSQL4DGV & " from TbL_Netzwerkclients where " & Suchparameter & " order by host", con)
|
||||
con.Open()
|
||||
dataadapter.Fill(ds)
|
||||
ElseIf RadNurNetzwerk.Checked Then
|
||||
Dim dataadapter As New SqlDataAdapter("select * from TbL_Netzwerkclients where NWSTANDORT = '" & Standort & "' AND NETNAME ='" & Netzwerk & "' AND " & Suchparameter & " order by host", con)
|
||||
Dim dataadapter As New SqlDataAdapter("select " & SelSQL4DGV & " from TbL_Netzwerkclients where NWSTANDORT = '" & Standort & "' AND NETNAME ='" & Netzwerk & "' AND " & Suchparameter & " order by host", con)
|
||||
con.Open()
|
||||
dataadapter.Fill(ds)
|
||||
ElseIf RadStandort.Checked Then
|
||||
Dim dataadapter As New SqlDataAdapter("select * from TbL_Netzwerkclients where NWSTANDORT = '" & Standort & "' AND " & Suchparameter & " order by host", con)
|
||||
Dim dataadapter As New SqlDataAdapter("select " & SelSQL4DGV & " from TbL_Netzwerkclients where NWSTANDORT = '" & Standort & "' AND " & Suchparameter & " order by host", con)
|
||||
con.Open()
|
||||
dataadapter.Fill(ds)
|
||||
ElseIf suchbegriff = "" Then
|
||||
Dim dataadapter As New SqlDataAdapter("select * from TbL_Netzwerkclients order by host", con)
|
||||
Dim dataadapter As New SqlDataAdapter("select " & SelSQL4DGV & " from TbL_Netzwerkclients order by host", con)
|
||||
con.Open()
|
||||
dataadapter.Fill(ds)
|
||||
End If
|
||||
@@ -467,30 +479,30 @@ Public Class Main
|
||||
|
||||
.Columns("QINFO").HeaderText = "Quick-Info"
|
||||
|
||||
.Columns("NWSTANDORT").DisplayIndex = 8
|
||||
' .Columns("NWSTANDORT").DisplayIndex = 8
|
||||
|
||||
If ChKZugangsdaten.Checked = False Then
|
||||
.Columns("Benutzer").Visible = False
|
||||
.Columns("Passwort").Visible = False
|
||||
ElseIf ChKZugangsdaten.Checked = True Then
|
||||
.Columns("Benutzer").Visible = True
|
||||
.Columns("Benutzer").DisplayIndex = 6
|
||||
.Columns("Passwort").Visible = True
|
||||
.Columns("Passwort").DisplayIndex = 7
|
||||
End If
|
||||
'If ChKZugangsdaten.Checked = False Then
|
||||
' .Columns("Benutzer").Visible = False
|
||||
' .Columns("Passwort").Visible = False
|
||||
'ElseIf ChKZugangsdaten.Checked = True Then
|
||||
' .Columns("Benutzer").Visible = True
|
||||
' .Columns("Benutzer").DisplayIndex = 6
|
||||
' .Columns("Passwort").Visible = True
|
||||
' .Columns("Passwort").DisplayIndex = 7
|
||||
'End If
|
||||
|
||||
.Columns("NETNAME").Visible = False
|
||||
.Columns("Netzwerk").Visible = False
|
||||
'' .Columns("NETNAME").Visible = False
|
||||
'.Columns("Netzwerk").Visible = False
|
||||
.Columns("DHCP").Visible = False
|
||||
.Columns("MAC").Visible = False
|
||||
.Columns("LINK").Visible = False
|
||||
.Columns("Linked").Visible = False
|
||||
.Columns("Linked").DisplayIndex = 9
|
||||
.Columns("LinkedWith").Visible = False
|
||||
.Columns("AddIp").Visible = False
|
||||
'.Columns("MAC").Visible = False
|
||||
'.Columns("LINK").Visible = False
|
||||
'.Columns("Linked").Visible = False
|
||||
'.Columns("Linked").DisplayIndex = 9
|
||||
'.Columns("LinkedWith").Visible = False
|
||||
'' .Columns("AddIp").Visible = False
|
||||
.Columns("HOST").Visible = False
|
||||
.Columns("NWSTANDORT").Visible = False
|
||||
.Columns("Info").Width = 250
|
||||
'' .Columns("NWSTANDORT").Visible = False
|
||||
'.Columns("Info").Width = 250
|
||||
|
||||
'.Sort(DgVMain.Columns("Host"), System.ComponentModel.ListSortDirection.Ascending)
|
||||
End With
|
||||
@@ -643,6 +655,8 @@ Public Class Main
|
||||
Private Sub CmdNetzwerkbearbeiten_Click(sender As Object, e As EventArgs) Handles CmdNetzwerkbearbeiten.Click
|
||||
werbinich()
|
||||
Class1.Absender = "Main"
|
||||
NWEdit.StartPosition = FormStartPosition.Manual
|
||||
NWEdit.Location = New Point(Location.X + 300, Location.Y + 300)
|
||||
'NetzwerkBearbeiten.Show()
|
||||
NWEdit.Show()
|
||||
End Sub
|
||||
@@ -677,6 +691,12 @@ Public Class Main
|
||||
End Sub
|
||||
|
||||
Public Function StartHostBearbeiten()
|
||||
HostBearbeiten.StartPosition = FormStartPosition.Manual
|
||||
HostBearbeiten.Location = New Point(Location.X + 150, Location.Y + 150)
|
||||
|
||||
EintragBearbeiten.StartPosition = FormStartPosition.Manual
|
||||
EintragBearbeiten.Location = New Point(Location.X + 150, Location.Y + 150)
|
||||
|
||||
If Tabelle = "TbL_Netzwerkclients" Then
|
||||
|
||||
If LstStandort.SelectedItem = "" Then
|
||||
@@ -688,10 +708,22 @@ Public Class Main
|
||||
Exit Function
|
||||
End If
|
||||
Class1.Absender = "Main"
|
||||
If HostBearbeiten.Visible Then
|
||||
MsgBox("Fenster ist bereits geöffnet.")
|
||||
HostBearbeiten.BringToFront()
|
||||
Else
|
||||
HostBearbeiten.Show()
|
||||
End If
|
||||
|
||||
ElseIf Tabelle = "TbL_Allgemein" Then
|
||||
If EintragBearbeiten.Visible Then
|
||||
MsgBox("Fenster ist bereits geöffnet.")
|
||||
EintragBearbeiten.BringToFront()
|
||||
Else
|
||||
EintragBearbeiten.Show()
|
||||
End If
|
||||
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user