Start 2
This commit is contained in:
159
Dokumentation/Administration/CSVImportieren.Designer.vb
generated
Normal file
159
Dokumentation/Administration/CSVImportieren.Designer.vb
generated
Normal file
@@ -0,0 +1,159 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class CSVImportieren
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Das Formular ü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.LblQuelle = New System.Windows.Forms.Label()
|
||||
Me.CmdQuelle = New System.Windows.Forms.Button()
|
||||
Me.dgvImport = New System.Windows.Forms.DataGridView()
|
||||
Me.Panel1 = New System.Windows.Forms.Panel()
|
||||
Me.LblInfo = New System.Windows.Forms.Label()
|
||||
Me.CmdImport = New System.Windows.Forms.Button()
|
||||
Me.ChkSkip = New System.Windows.Forms.CheckBox()
|
||||
Me.CmdTest = New System.Windows.Forms.Button()
|
||||
Me.LstAllgemein = New System.Windows.Forms.ListBox()
|
||||
CType(Me.dgvImport, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.Panel1.SuspendLayout()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'LblQuelle
|
||||
'
|
||||
Me.LblQuelle.AutoSize = True
|
||||
Me.LblQuelle.Location = New System.Drawing.Point(93, 49)
|
||||
Me.LblQuelle.Name = "LblQuelle"
|
||||
Me.LblQuelle.Size = New System.Drawing.Size(97, 13)
|
||||
Me.LblQuelle.TabIndex = 5
|
||||
Me.LblQuelle.Text = "bitte Quelle wählen"
|
||||
'
|
||||
'CmdQuelle
|
||||
'
|
||||
Me.CmdQuelle.BackColor = System.Drawing.SystemColors.ControlLightLight
|
||||
Me.CmdQuelle.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.CmdQuelle.Location = New System.Drawing.Point(12, 44)
|
||||
Me.CmdQuelle.Name = "CmdQuelle"
|
||||
Me.CmdQuelle.Size = New System.Drawing.Size(75, 23)
|
||||
Me.CmdQuelle.TabIndex = 4
|
||||
Me.CmdQuelle.Text = "Quelle"
|
||||
Me.CmdQuelle.UseVisualStyleBackColor = False
|
||||
'
|
||||
'dgvImport
|
||||
'
|
||||
Me.dgvImport.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
|
||||
Me.dgvImport.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.dgvImport.Location = New System.Drawing.Point(211, 0)
|
||||
Me.dgvImport.Name = "dgvImport"
|
||||
Me.dgvImport.Size = New System.Drawing.Size(964, 676)
|
||||
Me.dgvImport.TabIndex = 6
|
||||
'
|
||||
'Panel1
|
||||
'
|
||||
Me.Panel1.BackColor = System.Drawing.SystemColors.GradientInactiveCaption
|
||||
Me.Panel1.Controls.Add(Me.LblInfo)
|
||||
Me.Panel1.Controls.Add(Me.CmdImport)
|
||||
Me.Panel1.Controls.Add(Me.ChkSkip)
|
||||
Me.Panel1.Controls.Add(Me.CmdTest)
|
||||
Me.Panel1.Controls.Add(Me.LstAllgemein)
|
||||
Me.Panel1.Controls.Add(Me.CmdQuelle)
|
||||
Me.Panel1.Controls.Add(Me.LblQuelle)
|
||||
Me.Panel1.Dock = System.Windows.Forms.DockStyle.Left
|
||||
Me.Panel1.Location = New System.Drawing.Point(0, 0)
|
||||
Me.Panel1.Name = "Panel1"
|
||||
Me.Panel1.Size = New System.Drawing.Size(211, 676)
|
||||
Me.Panel1.TabIndex = 7
|
||||
'
|
||||
'LblInfo
|
||||
'
|
||||
Me.LblInfo.AutoSize = True
|
||||
Me.LblInfo.Location = New System.Drawing.Point(12, 130)
|
||||
Me.LblInfo.Name = "LblInfo"
|
||||
Me.LblInfo.Size = New System.Drawing.Size(25, 13)
|
||||
Me.LblInfo.TabIndex = 16
|
||||
Me.LblInfo.Text = "Info"
|
||||
'
|
||||
'CmdImport
|
||||
'
|
||||
Me.CmdImport.BackColor = System.Drawing.SystemColors.ControlLightLight
|
||||
Me.CmdImport.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.CmdImport.Location = New System.Drawing.Point(115, 96)
|
||||
Me.CmdImport.Name = "CmdImport"
|
||||
Me.CmdImport.Size = New System.Drawing.Size(75, 23)
|
||||
Me.CmdImport.TabIndex = 15
|
||||
Me.CmdImport.Text = "Importieren"
|
||||
Me.CmdImport.UseVisualStyleBackColor = False
|
||||
'
|
||||
'ChkSkip
|
||||
'
|
||||
Me.ChkSkip.AutoSize = True
|
||||
Me.ChkSkip.Location = New System.Drawing.Point(12, 73)
|
||||
Me.ChkSkip.Name = "ChkSkip"
|
||||
Me.ChkSkip.Size = New System.Drawing.Size(147, 17)
|
||||
Me.ChkSkip.TabIndex = 14
|
||||
Me.ChkSkip.Text = "vorhandene überspringen"
|
||||
Me.ChkSkip.UseVisualStyleBackColor = True
|
||||
'
|
||||
'CmdTest
|
||||
'
|
||||
Me.CmdTest.BackColor = System.Drawing.SystemColors.ControlLightLight
|
||||
Me.CmdTest.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.CmdTest.Location = New System.Drawing.Point(21, 528)
|
||||
Me.CmdTest.Name = "CmdTest"
|
||||
Me.CmdTest.Size = New System.Drawing.Size(75, 23)
|
||||
Me.CmdTest.TabIndex = 13
|
||||
Me.CmdTest.Text = "Test"
|
||||
Me.CmdTest.UseVisualStyleBackColor = False
|
||||
Me.CmdTest.Visible = False
|
||||
'
|
||||
'LstAllgemein
|
||||
'
|
||||
Me.LstAllgemein.FormattingEnabled = True
|
||||
Me.LstAllgemein.Location = New System.Drawing.Point(21, 557)
|
||||
Me.LstAllgemein.Name = "LstAllgemein"
|
||||
Me.LstAllgemein.Size = New System.Drawing.Size(151, 95)
|
||||
Me.LstAllgemein.TabIndex = 12
|
||||
Me.LstAllgemein.Visible = False
|
||||
'
|
||||
'CSVImportieren
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(1175, 676)
|
||||
Me.Controls.Add(Me.dgvImport)
|
||||
Me.Controls.Add(Me.Panel1)
|
||||
Me.Name = "CSVImportieren"
|
||||
Me.Text = "CSVImportieren"
|
||||
CType(Me.dgvImport, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.Panel1.ResumeLayout(False)
|
||||
Me.Panel1.PerformLayout()
|
||||
Me.ResumeLayout(False)
|
||||
|
||||
End Sub
|
||||
|
||||
Friend WithEvents LblQuelle As Label
|
||||
Friend WithEvents CmdQuelle As Button
|
||||
Friend WithEvents dgvImport As DataGridView
|
||||
Friend WithEvents Panel1 As Panel
|
||||
Friend WithEvents LstAllgemein As ListBox
|
||||
Friend WithEvents CmdTest As Button
|
||||
Friend WithEvents ChkSkip As CheckBox
|
||||
Friend WithEvents CmdImport As Button
|
||||
Friend WithEvents LblInfo As Label
|
||||
End Class
|
||||
120
Dokumentation/Administration/CSVImportieren.resx
Normal file
120
Dokumentation/Administration/CSVImportieren.resx
Normal 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>
|
||||
267
Dokumentation/Administration/CSVImportieren.vb
Normal file
267
Dokumentation/Administration/CSVImportieren.vb
Normal file
@@ -0,0 +1,267 @@
|
||||
Imports System.IO
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Public Class CSVImportieren
|
||||
|
||||
Public cmd As New SqlCommand
|
||||
Public reader As SqlDataReader
|
||||
Public importdatei As String
|
||||
Public con As New SqlConnection
|
||||
|
||||
Public Senderstandort As String
|
||||
Public SenderNetzwerk As String
|
||||
Public SenderAllgemein As String
|
||||
|
||||
Private Sub CSVImportieren_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
dbload()
|
||||
lblinfo_standard()
|
||||
End Sub
|
||||
|
||||
Public Function dbload()
|
||||
con.ConnectionString = Class1.DBConString
|
||||
cmd.Connection = con
|
||||
End Function
|
||||
|
||||
Private Sub CmdQuelle_Click(sender As Object, e As EventArgs) Handles CmdQuelle.Click
|
||||
Dim openfiledialog As New OpenFileDialog
|
||||
|
||||
openfiledialog.InitialDirectory = "C:\Verag"
|
||||
openfiledialog.DefaultExt = ".csv"
|
||||
openfiledialog.Filter = "CSV files (*.csv)|*.CSV"
|
||||
openfiledialog.ShowDialog()
|
||||
importdatei = openfiledialog.FileName
|
||||
LblQuelle.Text = importdatei
|
||||
loadcsv()
|
||||
End Sub
|
||||
|
||||
Private Function lblinfo_standard()
|
||||
LblInfo.Text = "FQDN" & vbCrLf &
|
||||
"QINFO" & vbCrLf &
|
||||
"IPAdresse" & vbCrLf &
|
||||
"NETNAME" & vbCrLf &
|
||||
"Seriennummer" & vbCrLf &
|
||||
"MAC" & vbCrLf &
|
||||
"Benutzer" & vbCrLf &
|
||||
"Passwort" & vbCrLf &
|
||||
"LINK" & vbCrLf &
|
||||
"INFO" & vbCrLf &
|
||||
"TYPE" & vbCrLf &
|
||||
"HOST" & vbCrLf &
|
||||
"NWSTANDORT" & vbCrLf &
|
||||
"Modell" & vbCrLf &
|
||||
"Linked" & vbCrLf &
|
||||
"LinkedWith" & vbCrLf &
|
||||
"AddIP"
|
||||
End Function
|
||||
|
||||
Private Function loadcsv()
|
||||
Try
|
||||
Dim testsr As New StreamReader(importdatei)
|
||||
Catch
|
||||
MsgBox("Keine Datei angegben!")
|
||||
Exit Function
|
||||
End Try
|
||||
Dim sr As New StreamReader(importdatei)
|
||||
Dim dt As New DataTable
|
||||
dt.CaseSensitive = False
|
||||
Dim newline() As String = sr.ReadLine.Split(";")
|
||||
Dim itemarraystring As Object = ""
|
||||
Dim zeile As String
|
||||
Dim zeilevbcrlf As String
|
||||
Dim felder() As String
|
||||
|
||||
Dim i As Integer
|
||||
Try
|
||||
i = 0
|
||||
While sr.EndOfStream = False
|
||||
dt.Columns.AddRange({New DataColumn(newline(i))})
|
||||
i = i + 1
|
||||
End While
|
||||
'Do While i <= (Num.Value - 1)
|
||||
' dt.Columns.AddRange({New DataColumn(newline(i))})
|
||||
' i = i + 1
|
||||
'Loop
|
||||
Catch exkopfzeile As Exception
|
||||
'MsgBox("Kopfzeile: " & i & vbCrLf & exkopfzeile.Message)
|
||||
End Try
|
||||
Try
|
||||
While (Not sr.EndOfStream)
|
||||
zeile = sr.ReadLine
|
||||
zeilevbcrlf = Replace(zeile, "##vbCrLf##", vbCrLf)
|
||||
felder = zeilevbcrlf.Split(";")
|
||||
Dim dr As DataRow = dt.NewRow
|
||||
dr.ItemArray = felder
|
||||
dt.Rows.Add(dr)
|
||||
|
||||
End While
|
||||
|
||||
|
||||
Catch exInhalt As Exception
|
||||
'MsgBox("Inhalt: " & exInhalt.Message)
|
||||
End Try
|
||||
dgvImport.DataSource = dt
|
||||
sr.Close()
|
||||
FileClose()
|
||||
End Function
|
||||
|
||||
Public Function IPbereitsvorhanden(Ip As String)
|
||||
con.Open()
|
||||
cmd.CommandText = "SELECT * FROM TbL_Netzwerkclients WHERE IPAdresse='" & Ip & "'"
|
||||
cmd.ExecuteNonQuery()
|
||||
reader = cmd.ExecuteReader()
|
||||
If reader.Read Then
|
||||
con.Close()
|
||||
Return (True)
|
||||
'MsgBox(Ip & " bereits vorhanden")
|
||||
Else
|
||||
con.Close()
|
||||
Return (False)
|
||||
'MsgBox(Ip & " noch nicht vorhanden")
|
||||
End If
|
||||
con.Close()
|
||||
End Function
|
||||
|
||||
Public Function Import()
|
||||
|
||||
Dim FQDN As String = ""
|
||||
Dim QINFO As String = ""
|
||||
Dim IPAdresse As String = ""
|
||||
Dim NETNAME As String = ""
|
||||
Dim Seriennummer As String = ""
|
||||
Dim MAC As String = ""
|
||||
Dim Benutzer As String = ""
|
||||
Dim Passwort As String = ""
|
||||
Dim LINK As String = ""
|
||||
Dim INFO As String = ""
|
||||
Dim TYPE As String = ""
|
||||
Dim HOST As Integer
|
||||
Dim NWSTANDORT As String = ""
|
||||
Dim Modell As String = ""
|
||||
Dim Linked As Integer
|
||||
Dim LinkedWith As String = ""
|
||||
Dim AddIP As String = ""
|
||||
Dim Standort As String = ""
|
||||
|
||||
Try
|
||||
|
||||
For r As Integer = 0 To dgvImport.Rows.Count - 2
|
||||
FQDN = dgvImport.Rows(r).Cells("FQDN").Value.ToString
|
||||
' MsgBox(Count(FQDN))
|
||||
If Count(FQDN) > 40 Then
|
||||
FQDN = FQDN.Substring(0, 40)
|
||||
End If
|
||||
|
||||
QINFO = dgvImport.Rows(r).Cells("QINFO").Value.ToString
|
||||
IPAdresse = dgvImport.Rows(r).Cells("IPAdresse").Value.ToString
|
||||
NETNAME = dgvImport.Rows(r).Cells("NETNAME").Value.ToString
|
||||
Seriennummer = dgvImport.Rows(r).Cells("Seriennummer").Value.ToString
|
||||
MAC = dgvImport.Rows(r).Cells("MAC").Value.ToString
|
||||
'Benutzer = dgvImport.Rows(r).Cells("Benutzer").Value.ToString
|
||||
'Passwort = dgvImport.Rows(r).Cells("Passwort").Value.ToString
|
||||
'LINK = dgvImport.Rows(r).Cells("LINK").Value.ToString
|
||||
'INFO = dgvImport.Rows(r).Cells("INFO").Value.ToString
|
||||
' TYPE = dgvImport.Rows(r).Cells("TYPE").Value.ToString
|
||||
NWSTANDORT = dgvImport.Rows(r).Cells("NWSTANDORT").Value.ToString
|
||||
' Modell = dgvImport.Rows(r).Cells("Modell").Value.ToString
|
||||
'LinkedWith = dgvImport.Rows(r).Cells("LinkedWith").Value.ToString
|
||||
'AddIP = dgvImport.Rows(r).Cells("AddIP").Value.ToString
|
||||
|
||||
HOST = dgvImport.Rows(r).Cells("HOST").Value
|
||||
'Linked = dgvImport.Rows(r).Cells("Linked").Value
|
||||
|
||||
Try
|
||||
Standort = dgvImport.Rows(r).Cells("Standort").Value.ToString
|
||||
If Count(Standort) > 40 Then
|
||||
Standort = Standort.Substring(0, 40)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Standort = ""
|
||||
End Try
|
||||
|
||||
|
||||
|
||||
Try
|
||||
' Dim SQLUpdate As String = "FQDN = '" & FQDN & "', QINFO = '" & QINFO & "', NETNAME = '" & NETNAME & "', STANDORT = '" & Standort & "', Seriennummer = '" & Seriennummer & "', MAC = '" & MAC & "', Benutzer = '" & Benutzer & "', Passwort = '" & Passwort & "', LINK = '" & LINK & "', INFO = '" & INFO & "', TYPE = '" & TYPE & "', HOST = '" & HOST & "', NWSTANDORT = '" & NWSTANDORT & "', Modell = '" & Modell & "', Linked = '" & Linked & "', LinkedWith = '" & LinkedWith & "', AddIP = '" & AddIP & "' WHERE IPAdresse = '" & IPAdresse & "'"
|
||||
Dim SQLUpdate As String = "FQDN = '" & FQDN & "', QINFO = '" & QINFO & "', NETNAME = '" & NETNAME & "', STANDORT = '" & Standort & "', Seriennummer = '" & Seriennummer & "', MAC = '" & MAC & "', HOST = '" & HOST & "', NWSTANDORT = '" & NWSTANDORT & "' WHERE IPAdresse = '" & IPAdresse & "'"
|
||||
If ChkSkip.Checked = False Then
|
||||
If IPbereitsvorhanden(IPAdresse) = True Then
|
||||
con.Open()
|
||||
cmd.CommandText = "Update Tbl_Netzwerkclients SET " & SQLUpdate & ""
|
||||
cmd.ExecuteNonQuery()
|
||||
con.Close()
|
||||
ElseIf IPbereitsvorhanden(IPAdresse) = False Then
|
||||
con.Open()
|
||||
cmd.CommandText = "INSERT INTO Tbl_Netzwerkclients (IPAdresse, Host, Info, Linked) VALUES ('" & IPAdresse & "', '" & HOST & "', 'Importiert aus CSV', '0')"
|
||||
cmd.ExecuteNonQuery()
|
||||
'cmd.CommandText = "UPDATE Tbl_Netzwerkclients SET QINFO = 'Test' WHERE IPAdresse = '" & IPAdresse & "'"
|
||||
cmd.CommandText = "Update Tbl_Netzwerkclients SET " & SQLUpdate & ""
|
||||
cmd.ExecuteNonQuery()
|
||||
con.Close()
|
||||
End If
|
||||
|
||||
ElseIf ChkSkip.Checked = True Then
|
||||
If IPbereitsvorhanden(IPAdresse) = True Then
|
||||
|
||||
ElseIf IPbereitsvorhanden(IPAdresse) = False Then
|
||||
con.Open()
|
||||
cmd.CommandText = "INSERT INTO Tbl_Netzwerkclients (IPAdresse, Host) VALUES ('" & IPAdresse & "', '" & HOST & "')"
|
||||
cmd.ExecuteNonQuery()
|
||||
cmd.CommandText = "Update Tbl_Netzwerkclients SET " & SQLUpdate & ""
|
||||
cmd.ExecuteNonQuery()
|
||||
con.Close()
|
||||
End If
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox("Import: " & ex.Message)
|
||||
con.Close()
|
||||
End Try
|
||||
Next
|
||||
Catch ex As Exception
|
||||
MsgBox("Import Variablen definieren: " & ex.Message)
|
||||
con.Close()
|
||||
End Try
|
||||
con.Close()
|
||||
|
||||
Try
|
||||
con.Open()
|
||||
cmd.CommandText = "UPDATE Tbl_Netzwerkclients SET STANDORT='' WHERE STANDORT IS NULL"
|
||||
cmd.ExecuteNonQuery()
|
||||
cmd.CommandText = "UPDATE Tbl_Netzwerkclients SET MODELL='' WHERE MODELL IS NULL"
|
||||
cmd.ExecuteNonQuery()
|
||||
cmd.CommandText = "UPDATE Tbl_Netzwerkclients SET TYPE='' WHERE TYPE IS NULL"
|
||||
cmd.ExecuteNonQuery()
|
||||
con.Close()
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function Count(Strrrring As String)
|
||||
Dim co As Integer = 0
|
||||
For Each ch As Char In Strrrring
|
||||
co = co + 1
|
||||
Next
|
||||
Return co
|
||||
End Function
|
||||
|
||||
Private Sub CmdTest_Click(sender As Object, e As EventArgs) Handles CmdTest.Click
|
||||
End Sub
|
||||
|
||||
Private Sub CmdImport_Click(sender As Object, e As EventArgs) Handles CmdImport.Click
|
||||
If ChkSkip.Checked = True Then
|
||||
If MsgBox("Importieren?", MsgBoxStyle.OkCancel) = MsgBoxResult.Ok Then
|
||||
Import()
|
||||
Else
|
||||
Exit Sub
|
||||
End If
|
||||
ElseIf ChkSkip.Checked = False Then
|
||||
If MsgBox("Importieren? Bestehende Datensätze werden mit Importdatei überschrieben!" & vbCrLf & "Wenn dies nicht gewünscht ist, bitte Häkchen setzen...", MsgBoxStyle.OkCancel) = MsgBoxResult.Ok Then
|
||||
Import()
|
||||
Else
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
475
Dokumentation/Administration/NWEdit.Designer.vb
generated
Normal file
475
Dokumentation/Administration/NWEdit.Designer.vb
generated
Normal file
@@ -0,0 +1,475 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class NWEdit
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Das Formular ü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.components = New System.ComponentModel.Container()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(NWEdit))
|
||||
Me.PanDebug = New System.Windows.Forms.Panel()
|
||||
Me.CmdTest = New System.Windows.Forms.Button()
|
||||
Me.LblTest = New System.Windows.Forms.Label()
|
||||
Me.LblInfo = New System.Windows.Forms.Label()
|
||||
Me.Panel1 = New System.Windows.Forms.Panel()
|
||||
Me.TxtHostbereich = New System.Windows.Forms.TextBox()
|
||||
Me.Label10 = New System.Windows.Forms.Label()
|
||||
Me.Label7 = New System.Windows.Forms.Label()
|
||||
Me.TxtNWBits = New System.Windows.Forms.TextBox()
|
||||
Me.ChkDHCPAnzeigen = New System.Windows.Forms.CheckBox()
|
||||
Me.Label9 = New System.Windows.Forms.Label()
|
||||
Me.TxtDHCPBereichEnde = New System.Windows.Forms.TextBox()
|
||||
Me.Label8 = New System.Windows.Forms.Label()
|
||||
Me.TxtInfo = New System.Windows.Forms.TextBox()
|
||||
Me.TxtDNSServer = New System.Windows.Forms.TextBox()
|
||||
Me.TxtNetzwerk = New System.Windows.Forms.TextBox()
|
||||
Me.LblNetzwerk = New System.Windows.Forms.Label()
|
||||
Me.CmdReset = New System.Windows.Forms.Button()
|
||||
Me.TxtSubnet = New System.Windows.Forms.TextBox()
|
||||
Me.Label6 = New System.Windows.Forms.Label()
|
||||
Me.Label2 = New System.Windows.Forms.Label()
|
||||
Me.TxtVLAN = New System.Windows.Forms.TextBox()
|
||||
Me.TxtGateway = New System.Windows.Forms.TextBox()
|
||||
Me.Label1 = New System.Windows.Forms.Label()
|
||||
Me.Label3 = New System.Windows.Forms.Label()
|
||||
Me.TxtDHCPServer = New System.Windows.Forms.TextBox()
|
||||
Me.LblVLANName = New System.Windows.Forms.Label()
|
||||
Me.Label4 = New System.Windows.Forms.Label()
|
||||
Me.CmdSave = New System.Windows.Forms.Button()
|
||||
Me.TxtDHCPBereichStart = New System.Windows.Forms.TextBox()
|
||||
Me.CmdAbbrechen = New System.Windows.Forms.Button()
|
||||
Me.Label5 = New System.Windows.Forms.Label()
|
||||
Me.MenuStrip1 = New System.Windows.Forms.MenuStrip()
|
||||
Me.ExtrasToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.DebugToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.Timer3 = New System.Windows.Forms.Timer(Me.components)
|
||||
Me.PanDebug.SuspendLayout()
|
||||
Me.Panel1.SuspendLayout()
|
||||
Me.MenuStrip1.SuspendLayout()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'PanDebug
|
||||
'
|
||||
Me.PanDebug.Controls.Add(Me.CmdTest)
|
||||
Me.PanDebug.Controls.Add(Me.LblTest)
|
||||
Me.PanDebug.Location = New System.Drawing.Point(12, 583)
|
||||
Me.PanDebug.Name = "PanDebug"
|
||||
Me.PanDebug.Size = New System.Drawing.Size(353, 155)
|
||||
Me.PanDebug.TabIndex = 39
|
||||
Me.PanDebug.Visible = False
|
||||
'
|
||||
'CmdTest
|
||||
'
|
||||
Me.CmdTest.Location = New System.Drawing.Point(29, 31)
|
||||
Me.CmdTest.Name = "CmdTest"
|
||||
Me.CmdTest.Size = New System.Drawing.Size(75, 23)
|
||||
Me.CmdTest.TabIndex = 34
|
||||
Me.CmdTest.Text = "Test"
|
||||
Me.CmdTest.UseVisualStyleBackColor = True
|
||||
'
|
||||
'LblTest
|
||||
'
|
||||
Me.LblTest.AutoSize = True
|
||||
Me.LblTest.Location = New System.Drawing.Point(26, 57)
|
||||
Me.LblTest.Name = "LblTest"
|
||||
Me.LblTest.Size = New System.Drawing.Size(39, 13)
|
||||
Me.LblTest.TabIndex = 35
|
||||
Me.LblTest.Text = "Label7"
|
||||
'
|
||||
'LblInfo
|
||||
'
|
||||
Me.LblInfo.AutoSize = True
|
||||
Me.LblInfo.Location = New System.Drawing.Point(26, 427)
|
||||
Me.LblInfo.Name = "LblInfo"
|
||||
Me.LblInfo.Size = New System.Drawing.Size(87, 13)
|
||||
Me.LblInfo.TabIndex = 36
|
||||
Me.LblInfo.Text = "Netzwerkbereich"
|
||||
'
|
||||
'Panel1
|
||||
'
|
||||
Me.Panel1.Controls.Add(Me.TxtHostbereich)
|
||||
Me.Panel1.Controls.Add(Me.LblInfo)
|
||||
Me.Panel1.Controls.Add(Me.Label10)
|
||||
Me.Panel1.Controls.Add(Me.Label7)
|
||||
Me.Panel1.Controls.Add(Me.TxtNWBits)
|
||||
Me.Panel1.Controls.Add(Me.ChkDHCPAnzeigen)
|
||||
Me.Panel1.Controls.Add(Me.Label9)
|
||||
Me.Panel1.Controls.Add(Me.TxtDHCPBereichEnde)
|
||||
Me.Panel1.Controls.Add(Me.Label8)
|
||||
Me.Panel1.Controls.Add(Me.TxtInfo)
|
||||
Me.Panel1.Controls.Add(Me.TxtDNSServer)
|
||||
Me.Panel1.Controls.Add(Me.TxtNetzwerk)
|
||||
Me.Panel1.Controls.Add(Me.LblNetzwerk)
|
||||
Me.Panel1.Controls.Add(Me.CmdReset)
|
||||
Me.Panel1.Controls.Add(Me.TxtSubnet)
|
||||
Me.Panel1.Controls.Add(Me.Label6)
|
||||
Me.Panel1.Controls.Add(Me.Label2)
|
||||
Me.Panel1.Controls.Add(Me.TxtVLAN)
|
||||
Me.Panel1.Controls.Add(Me.TxtGateway)
|
||||
Me.Panel1.Controls.Add(Me.Label1)
|
||||
Me.Panel1.Controls.Add(Me.Label3)
|
||||
Me.Panel1.Controls.Add(Me.TxtDHCPServer)
|
||||
Me.Panel1.Controls.Add(Me.LblVLANName)
|
||||
Me.Panel1.Controls.Add(Me.Label4)
|
||||
Me.Panel1.Controls.Add(Me.CmdSave)
|
||||
Me.Panel1.Controls.Add(Me.TxtDHCPBereichStart)
|
||||
Me.Panel1.Controls.Add(Me.CmdAbbrechen)
|
||||
Me.Panel1.Controls.Add(Me.Label5)
|
||||
Me.Panel1.Location = New System.Drawing.Point(12, 27)
|
||||
Me.Panel1.Name = "Panel1"
|
||||
Me.Panel1.Size = New System.Drawing.Size(311, 452)
|
||||
Me.Panel1.TabIndex = 40
|
||||
'
|
||||
'TxtHostbereich
|
||||
'
|
||||
Me.TxtHostbereich.Enabled = False
|
||||
Me.TxtHostbereich.Location = New System.Drawing.Point(91, 106)
|
||||
Me.TxtHostbereich.Name = "TxtHostbereich"
|
||||
Me.TxtHostbereich.Size = New System.Drawing.Size(186, 20)
|
||||
Me.TxtHostbereich.TabIndex = 4
|
||||
'
|
||||
'Label10
|
||||
'
|
||||
Me.Label10.AutoSize = True
|
||||
Me.Label10.Location = New System.Drawing.Point(18, 109)
|
||||
Me.Label10.Name = "Label10"
|
||||
Me.Label10.Size = New System.Drawing.Size(67, 13)
|
||||
Me.Label10.TabIndex = 42
|
||||
Me.Label10.Text = "Hostbereich:"
|
||||
Me.Label10.TextAlign = System.Drawing.ContentAlignment.TopRight
|
||||
'
|
||||
'Label7
|
||||
'
|
||||
Me.Label7.AutoSize = True
|
||||
Me.Label7.Location = New System.Drawing.Point(231, 57)
|
||||
Me.Label7.Name = "Label7"
|
||||
Me.Label7.Size = New System.Drawing.Size(12, 13)
|
||||
Me.Label7.TabIndex = 41
|
||||
Me.Label7.Text = "/"
|
||||
Me.Label7.TextAlign = System.Drawing.ContentAlignment.TopRight
|
||||
'
|
||||
'TxtNWBits
|
||||
'
|
||||
Me.TxtNWBits.Location = New System.Drawing.Point(244, 54)
|
||||
Me.TxtNWBits.Name = "TxtNWBits"
|
||||
Me.TxtNWBits.Size = New System.Drawing.Size(33, 20)
|
||||
Me.TxtNWBits.TabIndex = 2
|
||||
'
|
||||
'ChkDHCPAnzeigen
|
||||
'
|
||||
Me.ChkDHCPAnzeigen.AutoSize = True
|
||||
Me.ChkDHCPAnzeigen.Location = New System.Drawing.Point(206, 187)
|
||||
Me.ChkDHCPAnzeigen.Name = "ChkDHCPAnzeigen"
|
||||
Me.ChkDHCPAnzeigen.Size = New System.Drawing.Size(76, 17)
|
||||
Me.ChkDHCPAnzeigen.TabIndex = 9
|
||||
Me.ChkDHCPAnzeigen.Text = "Anzeigen?"
|
||||
Me.ChkDHCPAnzeigen.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Label9
|
||||
'
|
||||
Me.Label9.AutoSize = True
|
||||
Me.Label9.Location = New System.Drawing.Point(134, 187)
|
||||
Me.Label9.Name = "Label9"
|
||||
Me.Label9.Size = New System.Drawing.Size(24, 13)
|
||||
Me.Label9.TabIndex = 38
|
||||
Me.Label9.Text = "Bis:"
|
||||
Me.Label9.TextAlign = System.Drawing.ContentAlignment.TopRight
|
||||
'
|
||||
'TxtDHCPBereichEnde
|
||||
'
|
||||
Me.TxtDHCPBereichEnde.Location = New System.Drawing.Point(160, 184)
|
||||
Me.TxtDHCPBereichEnde.MaxLength = 3
|
||||
Me.TxtDHCPBereichEnde.Name = "TxtDHCPBereichEnde"
|
||||
Me.TxtDHCPBereichEnde.Size = New System.Drawing.Size(42, 20)
|
||||
Me.TxtDHCPBereichEnde.TabIndex = 8
|
||||
'
|
||||
'Label8
|
||||
'
|
||||
Me.Label8.AutoSize = True
|
||||
Me.Label8.Location = New System.Drawing.Point(57, 265)
|
||||
Me.Label8.Name = "Label8"
|
||||
Me.Label8.Size = New System.Drawing.Size(28, 13)
|
||||
Me.Label8.TabIndex = 32
|
||||
Me.Label8.Text = "Info:"
|
||||
Me.Label8.TextAlign = System.Drawing.ContentAlignment.TopRight
|
||||
'
|
||||
'TxtInfo
|
||||
'
|
||||
Me.TxtInfo.Location = New System.Drawing.Point(91, 262)
|
||||
Me.TxtInfo.Multiline = True
|
||||
Me.TxtInfo.Name = "TxtInfo"
|
||||
Me.TxtInfo.Size = New System.Drawing.Size(186, 65)
|
||||
Me.TxtInfo.TabIndex = 12
|
||||
'
|
||||
'TxtDNSServer
|
||||
'
|
||||
Me.TxtDNSServer.Location = New System.Drawing.Point(91, 210)
|
||||
Me.TxtDNSServer.Name = "TxtDNSServer"
|
||||
Me.TxtDNSServer.Size = New System.Drawing.Size(186, 20)
|
||||
Me.TxtDNSServer.TabIndex = 10
|
||||
'
|
||||
'TxtNetzwerk
|
||||
'
|
||||
Me.TxtNetzwerk.Location = New System.Drawing.Point(91, 54)
|
||||
Me.TxtNetzwerk.Name = "TxtNetzwerk"
|
||||
Me.TxtNetzwerk.Size = New System.Drawing.Size(138, 20)
|
||||
Me.TxtNetzwerk.TabIndex = 1
|
||||
'
|
||||
'LblNetzwerk
|
||||
'
|
||||
Me.LblNetzwerk.AutoSize = True
|
||||
Me.LblNetzwerk.Location = New System.Drawing.Point(30, 57)
|
||||
Me.LblNetzwerk.Name = "LblNetzwerk"
|
||||
Me.LblNetzwerk.Size = New System.Drawing.Size(55, 13)
|
||||
Me.LblNetzwerk.TabIndex = 15
|
||||
Me.LblNetzwerk.Text = "Netzwerk:"
|
||||
Me.LblNetzwerk.TextAlign = System.Drawing.ContentAlignment.TopRight
|
||||
'
|
||||
'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(202, 348)
|
||||
Me.CmdReset.Name = "CmdReset"
|
||||
Me.CmdReset.Size = New System.Drawing.Size(75, 23)
|
||||
Me.CmdReset.TabIndex = 29
|
||||
Me.CmdReset.Text = "Reset"
|
||||
Me.CmdReset.UseVisualStyleBackColor = False
|
||||
'
|
||||
'TxtSubnet
|
||||
'
|
||||
Me.TxtSubnet.Location = New System.Drawing.Point(91, 80)
|
||||
Me.TxtSubnet.Name = "TxtSubnet"
|
||||
Me.TxtSubnet.Size = New System.Drawing.Size(186, 20)
|
||||
Me.TxtSubnet.TabIndex = 3
|
||||
'
|
||||
'Label6
|
||||
'
|
||||
Me.Label6.AutoSize = True
|
||||
Me.Label6.Location = New System.Drawing.Point(47, 239)
|
||||
Me.Label6.Name = "Label6"
|
||||
Me.Label6.Size = New System.Drawing.Size(38, 13)
|
||||
Me.Label6.TabIndex = 28
|
||||
Me.Label6.Text = "VLAN:"
|
||||
Me.Label6.TextAlign = System.Drawing.ContentAlignment.TopRight
|
||||
'
|
||||
'Label2
|
||||
'
|
||||
Me.Label2.AutoSize = True
|
||||
Me.Label2.Location = New System.Drawing.Point(41, 83)
|
||||
Me.Label2.Name = "Label2"
|
||||
Me.Label2.Size = New System.Drawing.Size(44, 13)
|
||||
Me.Label2.TabIndex = 18
|
||||
Me.Label2.Text = "Subnet:"
|
||||
Me.Label2.TextAlign = System.Drawing.ContentAlignment.TopRight
|
||||
'
|
||||
'TxtVLAN
|
||||
'
|
||||
Me.TxtVLAN.Location = New System.Drawing.Point(91, 236)
|
||||
Me.TxtVLAN.Name = "TxtVLAN"
|
||||
Me.TxtVLAN.Size = New System.Drawing.Size(186, 20)
|
||||
Me.TxtVLAN.TabIndex = 11
|
||||
'
|
||||
'TxtGateway
|
||||
'
|
||||
Me.TxtGateway.Location = New System.Drawing.Point(91, 132)
|
||||
Me.TxtGateway.Name = "TxtGateway"
|
||||
Me.TxtGateway.Size = New System.Drawing.Size(186, 20)
|
||||
Me.TxtGateway.TabIndex = 5
|
||||
'
|
||||
'Label1
|
||||
'
|
||||
Me.Label1.AutoSize = True
|
||||
Me.Label1.Location = New System.Drawing.Point(18, 213)
|
||||
Me.Label1.Name = "Label1"
|
||||
Me.Label1.Size = New System.Drawing.Size(67, 13)
|
||||
Me.Label1.TabIndex = 26
|
||||
Me.Label1.Text = "DNS Server:"
|
||||
Me.Label1.TextAlign = System.Drawing.ContentAlignment.TopRight
|
||||
'
|
||||
'Label3
|
||||
'
|
||||
Me.Label3.AutoSize = True
|
||||
Me.Label3.Location = New System.Drawing.Point(33, 135)
|
||||
Me.Label3.Name = "Label3"
|
||||
Me.Label3.Size = New System.Drawing.Size(52, 13)
|
||||
Me.Label3.TabIndex = 21
|
||||
Me.Label3.Text = "Gateway:"
|
||||
Me.Label3.TextAlign = System.Drawing.ContentAlignment.TopRight
|
||||
'
|
||||
'TxtDHCPServer
|
||||
'
|
||||
Me.TxtDHCPServer.Location = New System.Drawing.Point(91, 158)
|
||||
Me.TxtDHCPServer.Name = "TxtDHCPServer"
|
||||
Me.TxtDHCPServer.Size = New System.Drawing.Size(186, 20)
|
||||
Me.TxtDHCPServer.TabIndex = 6
|
||||
'
|
||||
'LblVLANName
|
||||
'
|
||||
Me.LblVLANName.AutoSize = True
|
||||
Me.LblVLANName.Location = New System.Drawing.Point(55, 24)
|
||||
Me.LblVLANName.Name = "LblVLANName"
|
||||
Me.LblVLANName.Size = New System.Drawing.Size(78, 13)
|
||||
Me.LblVLANName.TabIndex = 24
|
||||
Me.LblVLANName.Text = "Netzwerkname"
|
||||
Me.LblVLANName.TextAlign = System.Drawing.ContentAlignment.TopRight
|
||||
'
|
||||
'Label4
|
||||
'
|
||||
Me.Label4.AutoSize = True
|
||||
Me.Label4.Location = New System.Drawing.Point(11, 161)
|
||||
Me.Label4.Name = "Label4"
|
||||
Me.Label4.Size = New System.Drawing.Size(74, 13)
|
||||
Me.Label4.TabIndex = 22
|
||||
Me.Label4.Text = "DHCP Server:"
|
||||
Me.Label4.TextAlign = System.Drawing.ContentAlignment.TopRight
|
||||
'
|
||||
'CmdSave
|
||||
'
|
||||
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(91, 348)
|
||||
Me.CmdSave.Name = "CmdSave"
|
||||
Me.CmdSave.Size = New System.Drawing.Size(75, 23)
|
||||
Me.CmdSave.TabIndex = 19
|
||||
Me.CmdSave.Text = "Speichern"
|
||||
Me.CmdSave.UseVisualStyleBackColor = False
|
||||
'
|
||||
'TxtDHCPBereichStart
|
||||
'
|
||||
Me.TxtDHCPBereichStart.Location = New System.Drawing.Point(91, 184)
|
||||
Me.TxtDHCPBereichStart.MaxLength = 3
|
||||
Me.TxtDHCPBereichStart.Name = "TxtDHCPBereichStart"
|
||||
Me.TxtDHCPBereichStart.Size = New System.Drawing.Size(42, 20)
|
||||
Me.TxtDHCPBereichStart.TabIndex = 7
|
||||
'
|
||||
'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(202, 377)
|
||||
Me.CmdAbbrechen.Name = "CmdAbbrechen"
|
||||
Me.CmdAbbrechen.Size = New System.Drawing.Size(75, 23)
|
||||
Me.CmdAbbrechen.TabIndex = 10
|
||||
Me.CmdAbbrechen.Text = "Schließen"
|
||||
Me.CmdAbbrechen.UseVisualStyleBackColor = False
|
||||
'
|
||||
'Label5
|
||||
'
|
||||
Me.Label5.AutoSize = True
|
||||
Me.Label5.Location = New System.Drawing.Point(6, 187)
|
||||
Me.Label5.Name = "Label5"
|
||||
Me.Label5.Size = New System.Drawing.Size(79, 13)
|
||||
Me.Label5.TabIndex = 23
|
||||
Me.Label5.Text = "DHCP Bereich:"
|
||||
Me.Label5.TextAlign = System.Drawing.ContentAlignment.TopRight
|
||||
'
|
||||
'MenuStrip1
|
||||
'
|
||||
Me.MenuStrip1.BackColor = System.Drawing.SystemColors.GradientActiveCaption
|
||||
Me.MenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ExtrasToolStripMenuItem})
|
||||
Me.MenuStrip1.Location = New System.Drawing.Point(0, 0)
|
||||
Me.MenuStrip1.Name = "MenuStrip1"
|
||||
Me.MenuStrip1.Size = New System.Drawing.Size(475, 24)
|
||||
Me.MenuStrip1.TabIndex = 41
|
||||
Me.MenuStrip1.Text = "MenuStrip1"
|
||||
'
|
||||
'ExtrasToolStripMenuItem
|
||||
'
|
||||
Me.ExtrasToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.DebugToolStripMenuItem})
|
||||
Me.ExtrasToolStripMenuItem.Name = "ExtrasToolStripMenuItem"
|
||||
Me.ExtrasToolStripMenuItem.Size = New System.Drawing.Size(49, 20)
|
||||
Me.ExtrasToolStripMenuItem.Text = "Extras"
|
||||
'
|
||||
'DebugToolStripMenuItem
|
||||
'
|
||||
Me.DebugToolStripMenuItem.Name = "DebugToolStripMenuItem"
|
||||
Me.DebugToolStripMenuItem.Size = New System.Drawing.Size(109, 22)
|
||||
Me.DebugToolStripMenuItem.Text = "Debug"
|
||||
'
|
||||
'Timer3
|
||||
'
|
||||
Me.Timer3.Interval = 3000
|
||||
'
|
||||
'NWEdit
|
||||
'
|
||||
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.BackColor = System.Drawing.SystemColors.GradientInactiveCaption
|
||||
Me.ClientSize = New System.Drawing.Size(475, 814)
|
||||
Me.Controls.Add(Me.PanDebug)
|
||||
Me.Controls.Add(Me.Panel1)
|
||||
Me.Controls.Add(Me.MenuStrip1)
|
||||
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
|
||||
Me.Name = "NWEdit"
|
||||
Me.Text = "NWEdit"
|
||||
Me.PanDebug.ResumeLayout(False)
|
||||
Me.PanDebug.PerformLayout()
|
||||
Me.Panel1.ResumeLayout(False)
|
||||
Me.Panel1.PerformLayout()
|
||||
Me.MenuStrip1.ResumeLayout(False)
|
||||
Me.MenuStrip1.PerformLayout()
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
End Sub
|
||||
|
||||
Friend WithEvents PanDebug As Panel
|
||||
Friend WithEvents CmdTest As Button
|
||||
Friend WithEvents LblTest As Label
|
||||
Friend WithEvents Panel1 As Panel
|
||||
Friend WithEvents Label8 As Label
|
||||
Friend WithEvents TxtInfo As TextBox
|
||||
Friend WithEvents TxtDNSServer As TextBox
|
||||
Friend WithEvents TxtNetzwerk As TextBox
|
||||
Friend WithEvents LblNetzwerk As Label
|
||||
Friend WithEvents CmdReset As Button
|
||||
Friend WithEvents TxtSubnet As TextBox
|
||||
Friend WithEvents Label6 As Label
|
||||
Friend WithEvents Label2 As Label
|
||||
Friend WithEvents TxtVLAN As TextBox
|
||||
Friend WithEvents TxtGateway As TextBox
|
||||
Friend WithEvents Label1 As Label
|
||||
Friend WithEvents Label3 As Label
|
||||
Friend WithEvents TxtDHCPServer As TextBox
|
||||
Friend WithEvents LblVLANName As Label
|
||||
Friend WithEvents Label4 As Label
|
||||
Friend WithEvents CmdSave As Button
|
||||
Friend WithEvents TxtDHCPBereichStart As TextBox
|
||||
Friend WithEvents CmdAbbrechen As Button
|
||||
Friend WithEvents Label5 As Label
|
||||
Friend WithEvents MenuStrip1 As MenuStrip
|
||||
Friend WithEvents ExtrasToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents DebugToolStripMenuItem As ToolStripMenuItem
|
||||
Friend WithEvents TxtDHCPBereichEnde As TextBox
|
||||
Friend WithEvents ChkDHCPAnzeigen As CheckBox
|
||||
Friend WithEvents Label9 As Label
|
||||
Friend WithEvents LblInfo As Label
|
||||
Friend WithEvents Label7 As Label
|
||||
Friend WithEvents TxtNWBits As TextBox
|
||||
Friend WithEvents Label10 As Label
|
||||
Friend WithEvents TxtHostbereich As TextBox
|
||||
Friend WithEvents Timer3 As Timer
|
||||
End Class
|
||||
1259
Dokumentation/Administration/NWEdit.resx
Normal file
1259
Dokumentation/Administration/NWEdit.resx
Normal file
File diff suppressed because it is too large
Load Diff
259
Dokumentation/Administration/NWEdit.vb
Normal file
259
Dokumentation/Administration/NWEdit.vb
Normal file
@@ -0,0 +1,259 @@
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Public Class NWEdit
|
||||
Private con As New SqlConnection
|
||||
Private cmd As New SqlCommand
|
||||
Private reader As SqlDataReader
|
||||
|
||||
Public Netzwerkname As String
|
||||
Public NWStandort As String
|
||||
Public NWName As String
|
||||
Public NWAddress As String
|
||||
|
||||
Public Neu As Boolean = False
|
||||
|
||||
Private Function dbload()
|
||||
con.ConnectionString = Class1.DBConString
|
||||
cmd.Connection = con
|
||||
End Function
|
||||
|
||||
Private Sub NetzwerkBearbeiten_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
dbload()
|
||||
LblInfo.Text = ""
|
||||
If Main.Debug = True Then
|
||||
PanDebug.Visible = True
|
||||
End If
|
||||
If Class1.Absender = "Main" Then
|
||||
NWStandort = Main.SenderStandort
|
||||
NWName = Main.SenderNetzwerk
|
||||
Netzwerkname = Main.SenderStandort & "_" & Main.SenderNetzwerk
|
||||
ElseIf Class1.Absender = "Standorthinzu" Then
|
||||
Netzwerkname = Standorthinzu.NeuerStandortNameIntern
|
||||
NWStandort = Standorthinzu.NeuerStandortName
|
||||
NWName = "Intern"
|
||||
ElseIf Class1.Absender = "Netzwerkhinzu" Then
|
||||
Netzwerkname = NetzwerkHinzu.NeuerNetzwerkNameIntern
|
||||
NWStandort = NetzwerkAdmin.LstStandort.SelectedItem
|
||||
NWName = NetzwerkHinzu.TxtName.Text
|
||||
Else
|
||||
MsgBox("Keine Daten")
|
||||
End If
|
||||
import()
|
||||
SubnetMask2NWBits()
|
||||
LblVLANName.Text = "Standort: " & NWStandort & " Name: " & NWName & " ändern:"
|
||||
LblTest.Text = Netzwerkname
|
||||
' PanDebug.Visible = False
|
||||
End Sub
|
||||
|
||||
''---------------------------------------------------------------------------LADEN---------------------------------------------------------------------------''
|
||||
|
||||
Private Function import()
|
||||
Try
|
||||
con.Open()
|
||||
cmd.CommandText = "SELECT * FROM Tbl_Netzwerke WHERE Netzwerkname='" & Netzwerkname & "'"
|
||||
ausgabe_Netzwerk()
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
End Try
|
||||
|
||||
con.Close()
|
||||
If TxtNetzwerk.Text = "" Then
|
||||
Neu = True
|
||||
Else
|
||||
Neu = False
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Function ausgabe_Netzwerk()
|
||||
Try
|
||||
reader = cmd.ExecuteReader()
|
||||
Do While reader.Read()
|
||||
TxtNetzwerk.Text = reader("Netzwerk")
|
||||
TxtSubnet.Text = reader("Subnetz")
|
||||
TxtGateway.Text = reader("Gateway")
|
||||
TxtDHCPBereichStart.Text = reader("DHCPStart")
|
||||
TxtDHCPBereichEnde.Text = reader("DHCPEnd")
|
||||
TxtDHCPServer.Text = reader("DHCPServer")
|
||||
TxtDNSServer.Text = reader("DNSServer")
|
||||
TxtVLAN.Text = reader("VLAN")
|
||||
TxtInfo.Text = reader("Info")
|
||||
ChkDHCPAnzeigen.Checked = Class1.ReadNullAs0(reader, "DHCPAbfragen")
|
||||
Loop
|
||||
reader.Close()
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
|
||||
''---------------------------------------------------------------------------BUTTONS---------------------------------------------------------------------------''
|
||||
|
||||
|
||||
|
||||
Private Sub CmdReset_Click(sender As Object, e As EventArgs) Handles CmdReset.Click
|
||||
import()
|
||||
End Sub
|
||||
|
||||
Private Sub CmdAbbrechen_Click(sender As Object, e As EventArgs) Handles CmdAbbrechen.Click
|
||||
Main.allesladen()
|
||||
' NetzwerkAdmin.LstStandortLoad()
|
||||
' NetzwerkAdmin.LstNetzwerkLoad()
|
||||
Close()
|
||||
End Sub
|
||||
|
||||
Private Sub CmdSave_Click(sender As Object, e As EventArgs) Handles CmdSave.Click
|
||||
NWAddressGenerieren()
|
||||
If Neu = False Then
|
||||
Try
|
||||
con.Open()
|
||||
cmd.CommandText = "UPDATE TBL_Netzwerke SET Netzwerk = '" & TxtNetzwerk.Text & "', Subnetz='" & TxtSubnet.Text & "', Gateway='" & TxtGateway.Text & "',DHCPAbfragen = '" & ChkDHCPAnzeigen.Checked & "', DHCPStart='" & TxtDHCPBereichStart.Text & "', DHCPEnd='" & TxtDHCPBereichEnde.Text & "', dhcpserver='" & TxtDHCPServer.Text & "', dnsserver='" & TxtDNSServer.Text & "', VLAN='" & TxtVLAN.Text & "', Info='" & TxtInfo.Text & "', NWAddress='" & NWAddress & "' WHERE Netzwerkname='" & Netzwerkname & "'"
|
||||
cmd.ExecuteNonQuery()
|
||||
con.Close()
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
ElseIf Neu = True Then
|
||||
con.Open()
|
||||
cmd.CommandText = "Insert into TBL_Netzwerke (Netzwerkname, Netzwerk, Subnetz, Gateway, DHCPStart, DHCPEnd, DHCPServer, DNSServer, VLAN, Info, NWAddress) values ('" & Main.SenderNetzwerk & "', '" & TxtNetzwerk.Text & "', '" & TxtSubnet.Text & "','" & TxtGateway.Text & "', '" & TxtDHCPBereichStart.Text & "', '" & TxtDHCPBereichEnde.Text & "', '" & TxtDHCPServer.Text & "', '" & TxtDNSServer.Text & "', '" & TxtVLAN.Text & "', '" & TxtInfo.Text & "', '" & NWAddress & "')"
|
||||
cmd.ExecuteNonQuery()
|
||||
con.Close()
|
||||
End If
|
||||
Try
|
||||
|
||||
Class1.Netzwerkfuellen(TxtNetzwerk.Text, TxtNWBits.Text, NWName, NWStandort)
|
||||
DHCPFill(TxtDHCPBereichStart.Text, TxtDHCPBereichEnde.Text, TxtNetzwerk.Text)
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
End Try
|
||||
con.Close()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub TxtNWBits_KeyUp_Enter(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TxtNWBits.KeyUp ', TxtHost.TextChanged
|
||||
Try
|
||||
If e.KeyValue = Keys.Enter Then
|
||||
Dim subnetmask As String
|
||||
Class1.bit2mask(TxtNWBits.Text, subnetmask)
|
||||
TxtSubnet.Text = subnetmask
|
||||
End If
|
||||
Catch
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub TxtSubnet_KeyUp_Enter(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TxtSubnet.KeyUp ', TxtHost.TextChanged
|
||||
Try
|
||||
If e.KeyValue = Keys.Enter Then
|
||||
SubnetMask2NWBits()
|
||||
End If
|
||||
Catch
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
''----------------------------------------------------------------------------------------------------------------------------------------------------------''
|
||||
''----------------------------------------------------------------------------------------------------------------------------------------------------------''
|
||||
''---------------------------------------------------------------------------FUNCTIONS---------------------------------------------------------------------------''
|
||||
|
||||
|
||||
Public Function NWAddressGenerieren()
|
||||
NWAddress = TxtNetzwerk.Text
|
||||
Try
|
||||
Do
|
||||
NWAddress = NWAddress.Remove(NWAddress.Length - 1)
|
||||
|
||||
Loop Until NWAddress.Last() = "."
|
||||
Catch ex As Exception
|
||||
MsgBox("Fehler beim Konvertieren der Netzwerkadresse.")
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function SubnetMask2NWBits()
|
||||
Dim a, b, c, d, nwbits, hostbits As Integer
|
||||
Class1.netmaskseperator(TxtSubnet.Text, a, b, c, d, nwbits, hostbits)
|
||||
TxtNWBits.Text = nwbits
|
||||
|
||||
Dim host As Integer = Class1.IP2Host(TxtNetzwerk.Text)
|
||||
NWAddressGenerieren()
|
||||
TxtHostbereich.Text = NWAddress & host + 1 & " bis " & NWAddress & host + (2 ^ hostbits) - 2
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Private Sub Netzwerkbearbeiten_Closing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
|
||||
Main.allesladen()
|
||||
End Sub
|
||||
|
||||
Private Sub DebugToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DebugToolStripMenuItem.Click
|
||||
PanDebug.Visible = Not PanDebug.Visible
|
||||
End Sub
|
||||
|
||||
Public Function DHCPFill(dhcpstart As String, dhcpend As String, nw As String)
|
||||
Try
|
||||
dhcpstart = Convert.ToInt32(dhcpstart)
|
||||
dhcpend = Convert.ToInt32(dhcpend)
|
||||
Catch ex As Exception
|
||||
LblInfo.Text = "DHCP nicht anwendbar"
|
||||
dhcpstart = 0
|
||||
dhcpend = 0
|
||||
' Exit Function
|
||||
End Try
|
||||
If dhcpstart < 1 Or dhcpend > 254 Then
|
||||
' MsgBox("der DHCP Bereich kann nicht stimmen...")
|
||||
'Exit Function
|
||||
End If
|
||||
con.Open()
|
||||
cmd.CommandText = "select IPadresse, DHCP from TbL_Netzwerkclients Where NETNAME = (select NETNAME from TbL_Netzwerke Where Netzwerk = '" & nw & "') AND NWSTANDORT = (select NWSTANDORT from TbL_Netzwerke Where Netzwerk = '" & nw & "') ORDER BY HOST"
|
||||
reader = cmd.ExecuteReader()
|
||||
|
||||
Do While reader.Read()
|
||||
Dim IPAdresse As String = reader("IPAdresse")
|
||||
Dim Host As Integer = Class1.IP2Host(IPAdresse)
|
||||
|
||||
If Host = dhcpstart Then
|
||||
DHCPUpdate("Start", IPAdresse)
|
||||
ElseIf Host = dhcpend Then
|
||||
DHCPUpdate("Ende", IPAdresse)
|
||||
ElseIf Host > dhcpstart And Host < dhcpend Then
|
||||
DHCPUpdate("1", IPAdresse)
|
||||
Else
|
||||
DHCPUpdate("0", IPAdresse)
|
||||
End If
|
||||
Loop
|
||||
reader.Close()
|
||||
con.Close()
|
||||
LblInfo.Text = "Gespeichert."
|
||||
Timer3.Enabled = True
|
||||
End Function
|
||||
|
||||
Public Function DHCPUpdate(Wert As String, IPAdresse As String)
|
||||
Dim dhcpcon As New SqlConnection
|
||||
Dim dhcpcmd As New SqlCommand
|
||||
dhcpcon.ConnectionString = Class1.DBConString
|
||||
dhcpcmd.Connection = dhcpcon
|
||||
|
||||
dhcpcon.Open()
|
||||
dhcpcmd.CommandText = "UPDATE TbL_Netzwerkclients SET DHCP = '" & Wert & "' WHERE IPAdresse = '" & IPAdresse & "'"
|
||||
dhcpcmd.ExecuteNonQuery()
|
||||
dhcpcon.Close()
|
||||
End Function
|
||||
|
||||
Private Sub Timer3_Tick(sender As Object, e As EventArgs) Handles Timer3.Tick
|
||||
LblInfo.Text = ""
|
||||
Timer3.Enabled = False
|
||||
End Sub
|
||||
|
||||
''----------------------------------------------------------------------------------------------------------------------------------------------------------''
|
||||
''----------------------------------------------------------------------------------------------------------------------------------------------------------''
|
||||
''---------------------------------------------------------------------------Test---------------------------------------------------------------------------''
|
||||
|
||||
|
||||
Private Sub CmdTest_Click(sender As Object, e As EventArgs) Handles CmdTest.Click
|
||||
LblTest.Text = TxtNetzwerk.Text & " " & TxtNWBits.Text & vbCrLf
|
||||
'LblTest.Text &= Class1.Netzwerkfuellen(TxtNetzwerk.Text, TxtNWBits.Text) & vbCrLf
|
||||
End Sub
|
||||
|
||||
''----------------------------------------------------------------------------------------------------------------------------------------------------------''
|
||||
''----------------------------------------------------------------------------------------------------------------------------------------------------------''
|
||||
|
||||
End Class
|
||||
135
Dokumentation/Administration/NetzwerkAdmin.Designer.vb
generated
Normal file
135
Dokumentation/Administration/NetzwerkAdmin.Designer.vb
generated
Normal file
@@ -0,0 +1,135 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class NetzwerkAdmin
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Das Formular ü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()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(NetzwerkAdmin))
|
||||
Me.CmdStandortAdd = New System.Windows.Forms.Button()
|
||||
Me.CmdNetzwerkAdd = New System.Windows.Forms.Button()
|
||||
Me.LstNetzwerk = New System.Windows.Forms.ListBox()
|
||||
Me.LstStandort = New System.Windows.Forms.ListBox()
|
||||
Me.ChkDelete = New System.Windows.Forms.CheckBox()
|
||||
Me.CmdNetWDelete = New System.Windows.Forms.Button()
|
||||
Me.CmdStandortDelete = New System.Windows.Forms.Button()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'CmdStandortAdd
|
||||
'
|
||||
Me.CmdStandortAdd.BackColor = System.Drawing.SystemColors.ControlLightLight
|
||||
Me.CmdStandortAdd.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.CmdStandortAdd.Location = New System.Drawing.Point(185, 12)
|
||||
Me.CmdStandortAdd.Name = "CmdStandortAdd"
|
||||
Me.CmdStandortAdd.Size = New System.Drawing.Size(174, 33)
|
||||
Me.CmdStandortAdd.TabIndex = 0
|
||||
Me.CmdStandortAdd.Text = "Standort hinzufügen"
|
||||
Me.CmdStandortAdd.UseVisualStyleBackColor = False
|
||||
'
|
||||
'CmdNetzwerkAdd
|
||||
'
|
||||
Me.CmdNetzwerkAdd.BackColor = System.Drawing.SystemColors.ControlLightLight
|
||||
Me.CmdNetzwerkAdd.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.CmdNetzwerkAdd.Location = New System.Drawing.Point(185, 113)
|
||||
Me.CmdNetzwerkAdd.Name = "CmdNetzwerkAdd"
|
||||
Me.CmdNetzwerkAdd.Size = New System.Drawing.Size(174, 33)
|
||||
Me.CmdNetzwerkAdd.TabIndex = 1
|
||||
Me.CmdNetzwerkAdd.Text = "Netzwerk hinzufügen"
|
||||
Me.CmdNetzwerkAdd.UseVisualStyleBackColor = False
|
||||
'
|
||||
'LstNetzwerk
|
||||
'
|
||||
Me.LstNetzwerk.FormattingEnabled = True
|
||||
Me.LstNetzwerk.Location = New System.Drawing.Point(12, 113)
|
||||
Me.LstNetzwerk.Name = "LstNetzwerk"
|
||||
Me.LstNetzwerk.Size = New System.Drawing.Size(151, 95)
|
||||
Me.LstNetzwerk.TabIndex = 3
|
||||
'
|
||||
'LstStandort
|
||||
'
|
||||
Me.LstStandort.FormattingEnabled = True
|
||||
Me.LstStandort.Location = New System.Drawing.Point(12, 12)
|
||||
Me.LstStandort.Name = "LstStandort"
|
||||
Me.LstStandort.Size = New System.Drawing.Size(151, 95)
|
||||
Me.LstStandort.TabIndex = 2
|
||||
'
|
||||
'ChkDelete
|
||||
'
|
||||
Me.ChkDelete.AutoSize = True
|
||||
Me.ChkDelete.Location = New System.Drawing.Point(12, 214)
|
||||
Me.ChkDelete.Name = "ChkDelete"
|
||||
Me.ChkDelete.Size = New System.Drawing.Size(116, 17)
|
||||
Me.ChkDelete.TabIndex = 4
|
||||
Me.ChkDelete.Text = "Löschen aktivieren"
|
||||
Me.ChkDelete.UseVisualStyleBackColor = True
|
||||
'
|
||||
'CmdNetWDelete
|
||||
'
|
||||
Me.CmdNetWDelete.BackColor = System.Drawing.SystemColors.ControlLightLight
|
||||
Me.CmdNetWDelete.Enabled = False
|
||||
Me.CmdNetWDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.CmdNetWDelete.Location = New System.Drawing.Point(185, 152)
|
||||
Me.CmdNetWDelete.Name = "CmdNetWDelete"
|
||||
Me.CmdNetWDelete.Size = New System.Drawing.Size(174, 33)
|
||||
Me.CmdNetWDelete.TabIndex = 6
|
||||
Me.CmdNetWDelete.Text = "Netzwerk löschen"
|
||||
Me.CmdNetWDelete.UseVisualStyleBackColor = False
|
||||
'
|
||||
'CmdStandortDelete
|
||||
'
|
||||
Me.CmdStandortDelete.BackColor = System.Drawing.SystemColors.ControlLightLight
|
||||
Me.CmdStandortDelete.Enabled = False
|
||||
Me.CmdStandortDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.CmdStandortDelete.Location = New System.Drawing.Point(185, 51)
|
||||
Me.CmdStandortDelete.Name = "CmdStandortDelete"
|
||||
Me.CmdStandortDelete.Size = New System.Drawing.Size(174, 33)
|
||||
Me.CmdStandortDelete.TabIndex = 5
|
||||
Me.CmdStandortDelete.Text = "Standort löschen"
|
||||
Me.CmdStandortDelete.UseVisualStyleBackColor = False
|
||||
'
|
||||
'NetzwerkAdmin
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.BackColor = System.Drawing.SystemColors.GradientInactiveCaption
|
||||
Me.ClientSize = New System.Drawing.Size(377, 251)
|
||||
Me.Controls.Add(Me.CmdNetWDelete)
|
||||
Me.Controls.Add(Me.CmdStandortDelete)
|
||||
Me.Controls.Add(Me.ChkDelete)
|
||||
Me.Controls.Add(Me.LstNetzwerk)
|
||||
Me.Controls.Add(Me.LstStandort)
|
||||
Me.Controls.Add(Me.CmdNetzwerkAdd)
|
||||
Me.Controls.Add(Me.CmdStandortAdd)
|
||||
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
|
||||
Me.Name = "NetzwerkAdmin"
|
||||
Me.Text = "NetzwerkAdmin"
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
End Sub
|
||||
|
||||
Friend WithEvents CmdStandortAdd As Button
|
||||
Friend WithEvents CmdNetzwerkAdd As Button
|
||||
Friend WithEvents LstNetzwerk As ListBox
|
||||
Friend WithEvents LstStandort As ListBox
|
||||
Friend WithEvents ChkDelete As CheckBox
|
||||
Friend WithEvents CmdNetWDelete As Button
|
||||
Friend WithEvents CmdStandortDelete As Button
|
||||
End Class
|
||||
1253
Dokumentation/Administration/NetzwerkAdmin.resx
Normal file
1253
Dokumentation/Administration/NetzwerkAdmin.resx
Normal file
File diff suppressed because it is too large
Load Diff
179
Dokumentation/Administration/NetzwerkAdmin.vb
Normal file
179
Dokumentation/Administration/NetzwerkAdmin.vb
Normal file
@@ -0,0 +1,179 @@
|
||||
Imports System.Data.SqlClient
|
||||
Public Class NetzwerkAdmin
|
||||
Private con As New SqlConnection
|
||||
Private cmd As New SqlCommand
|
||||
Private Sub NetzwerkAdmin_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
LstStandortLoad()
|
||||
LstNetzwerkLoad()
|
||||
End Sub
|
||||
Public Function dbload()
|
||||
con.ConnectionString = Class1.DBConString
|
||||
cmd.Connection = con
|
||||
End Function
|
||||
Public Function LstStandortLoad()
|
||||
Dim ds As New DataSet()
|
||||
Dim dt As New DataTable()
|
||||
Main.dbload()
|
||||
Dim dataadapter As New SqlDataAdapter("SELECT NWSTANDORT from TbL_Netzwerke where main='True'", Main.con)
|
||||
LstStandort.Items.Clear()
|
||||
|
||||
Try
|
||||
Main.con.Open()
|
||||
dataadapter.Fill(ds)
|
||||
|
||||
'DgVMain.DataSource = ds.Tables(0)
|
||||
|
||||
For Each dr As DataRow In ds.Tables(0).Rows
|
||||
LstStandort.Items.Add(dr.Item(0))
|
||||
Next
|
||||
Catch ex As Exception
|
||||
MsgBox("DataadapterFill LstStandOrtLoad(): " & ex.Message)
|
||||
End Try
|
||||
|
||||
Main.con.Close()
|
||||
End Function
|
||||
Public Function LstNetzwerkLoad()
|
||||
Dim ds As New DataSet()
|
||||
Dim dt As New DataTable()
|
||||
Dim Standort As String = LstStandort.SelectedItem
|
||||
Main.dbload()
|
||||
Dim dataadapter As New SqlDataAdapter("select NETNAME from TbL_Netzwerke where NWSTANDORT='" & Standort & "'", Main.con)
|
||||
LstNetzwerk.Items.Clear()
|
||||
Try
|
||||
Main.con.Open()
|
||||
dataadapter.Fill(ds)
|
||||
|
||||
'DgVMain.DataSource = ds.Tables(0)
|
||||
|
||||
For Each dr As DataRow In ds.Tables(0).Rows
|
||||
LstNetzwerk.Items.Add(dr.Item(0))
|
||||
Next
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox("DataadapterFill LstNwerkload(): " & ex.Message)
|
||||
End Try
|
||||
Main.con.Close()
|
||||
|
||||
Try
|
||||
LstNetzwerk.SetSelected(0, True)
|
||||
|
||||
Catch ex As Exception
|
||||
' MsgBox("LstNetzwerkLoad SetSelected: " & ex.Message)
|
||||
End Try
|
||||
|
||||
End Function
|
||||
|
||||
Public Function NWDelete()
|
||||
Dim ds As New DataSet()
|
||||
Dim dt As New DataTable()
|
||||
dbload()
|
||||
Dim netzwerkname As String = LstStandort.SelectedItem & "_" & LstNetzwerk.SelectedItem
|
||||
|
||||
If LstNetzwerk.SelectedItem = "Intern" Then
|
||||
MsgBox("Standardnetzwerk 'Intern' kann nicht gelöscht werden.")
|
||||
Else
|
||||
If MsgBox("Netzwerk " & netzwerkname & " wirklich löschen?", vbOKCancel) = MsgBoxResult.Cancel Then
|
||||
Exit Function
|
||||
Else
|
||||
con.Open()
|
||||
Dim result As Integer = MsgBox("NetzwerkHosts ebenfalls aus Datenbank löschen?", vbYesNoCancel)
|
||||
If result = MsgBoxResult.Cancel Then
|
||||
Exit Function
|
||||
ElseIf result = MsgBoxResult.Yes Then
|
||||
Try
|
||||
cmd.CommandText = "DELETE FROM tbl_netzwerkclients WHERE NETNAME = '" & LstNetzwerk.SelectedItem & "' AND NWSTANDORT = '" & LstStandort.SelectedItem & "'"
|
||||
cmd.ExecuteNonQuery()
|
||||
cmd.CommandText = "DELETE FROM tbl_netzwerke WHERE Netzwerkname = '" & netzwerkname & "'"
|
||||
cmd.ExecuteNonQuery()
|
||||
'MsgBox("Yes")
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
End Try
|
||||
ElseIf result = MsgBoxResult.No Then
|
||||
Try
|
||||
cmd.CommandText = "DELETE FROM tbl_netzwerke WHERE Netzwerkname = '" & netzwerkname & "'"
|
||||
cmd.ExecuteNonQuery()
|
||||
'MsgBox("Yes")
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
End Try
|
||||
'MsgBox("No")
|
||||
End If
|
||||
End If
|
||||
con.Close()
|
||||
End If
|
||||
LstStandortLoad()
|
||||
LstNetzwerkLoad()
|
||||
End Function
|
||||
|
||||
Public Function StandOrtDelete()
|
||||
Dim ds As New DataSet()
|
||||
Dim dt As New DataTable()
|
||||
dbload()
|
||||
Dim netzwerkname As String = LstStandort.SelectedItem & "_" & LstNetzwerk.SelectedItem
|
||||
|
||||
|
||||
If MsgBox("Den kompletten Standort " & LstStandort.SelectedItem & " wirklich löschen?", vbOKCancel) = MsgBoxResult.Cancel Then
|
||||
Exit Function
|
||||
Else
|
||||
con.Open()
|
||||
Dim result As Integer = MsgBox("Wirklich zu 100% Ernte???", vbYesNoCancel)
|
||||
If result = MsgBoxResult.Cancel Then
|
||||
Exit Function
|
||||
ElseIf result = MsgBoxResult.Yes Then
|
||||
Try
|
||||
cmd.CommandText = "DELETE FROM tbl_netzwerkclients WHERE NWSTANDORT = '" & LstStandort.SelectedItem & "'"
|
||||
cmd.ExecuteNonQuery()
|
||||
cmd.CommandText = "DELETE FROM tbl_netzwerke WHERE NWStandort = '" & LstStandort.SelectedItem & "'"
|
||||
cmd.ExecuteNonQuery()
|
||||
'MsgBox("Yes")
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
End Try
|
||||
ElseIf result = MsgBoxResult.No Then
|
||||
Exit Function
|
||||
End If
|
||||
End If
|
||||
con.Close()
|
||||
LstStandortLoad()
|
||||
LstNetzwerkLoad()
|
||||
End Function
|
||||
|
||||
Private Sub LstStandort_SelectedIndexChanged(sender As Object, e As EventArgs) Handles LstStandort.SelectedIndexChanged
|
||||
LstNetzwerkLoad()
|
||||
End Sub
|
||||
|
||||
Private Sub LstNetzwerk_SelectedIndexChanged(sender As Object, e As EventArgs) Handles LstNetzwerk.SelectedIndexChanged
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CmdStandortAdd_Click(sender As Object, e As EventArgs) Handles CmdStandortAdd.Click
|
||||
Standorthinzu.Show()
|
||||
End Sub
|
||||
|
||||
Private Sub ChkDelete_CheckedChanged(sender As Object, e As EventArgs) Handles ChkDelete.CheckedChanged
|
||||
If ChkDelete.Checked Then
|
||||
CmdNetWDelete.Enabled = True
|
||||
CmdStandortDelete.Enabled = True
|
||||
Else
|
||||
CmdNetWDelete.Enabled = False
|
||||
CmdStandortDelete.Enabled = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CmdNetWDelete_Click(sender As Object, e As EventArgs) Handles CmdNetWDelete.Click
|
||||
NWDelete()
|
||||
End Sub
|
||||
|
||||
Private Sub CmdStandortDelete_Click(sender As Object, e As EventArgs) Handles CmdStandortDelete.Click
|
||||
StandOrtDelete()
|
||||
End Sub
|
||||
|
||||
Private Sub CmdNetzwerkAdd_Click(sender As Object, e As EventArgs) Handles CmdNetzwerkAdd.Click
|
||||
NetzwerkHinzu.Show()
|
||||
End Sub
|
||||
Private Sub Closing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
|
||||
Main.LstStandortLoad()
|
||||
Main.allesladen()
|
||||
End Sub
|
||||
End Class
|
||||
112
Dokumentation/Administration/NetzwerkHinzu.Designer.vb
generated
Normal file
112
Dokumentation/Administration/NetzwerkHinzu.Designer.vb
generated
Normal file
@@ -0,0 +1,112 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class NetzwerkHinzu
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Das Formular ü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()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(NetzwerkHinzu))
|
||||
Me.Label1 = New System.Windows.Forms.Label()
|
||||
Me.TxtName = New System.Windows.Forms.TextBox()
|
||||
Me.LblHeader = New System.Windows.Forms.Label()
|
||||
Me.TxtIP = New System.Windows.Forms.TextBox()
|
||||
Me.LblNW = New System.Windows.Forms.Label()
|
||||
Me.CmdAdd = New System.Windows.Forms.Button()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'Label1
|
||||
'
|
||||
Me.Label1.AutoSize = True
|
||||
Me.Label1.Location = New System.Drawing.Point(12, 43)
|
||||
Me.Label1.Name = "Label1"
|
||||
Me.Label1.Size = New System.Drawing.Size(38, 13)
|
||||
Me.Label1.TabIndex = 0
|
||||
Me.Label1.Text = "Name:"
|
||||
'
|
||||
'TxtName
|
||||
'
|
||||
Me.TxtName.Location = New System.Drawing.Point(53, 40)
|
||||
Me.TxtName.Name = "TxtName"
|
||||
Me.TxtName.Size = New System.Drawing.Size(181, 20)
|
||||
Me.TxtName.TabIndex = 1
|
||||
'
|
||||
'LblHeader
|
||||
'
|
||||
Me.LblHeader.AutoSize = True
|
||||
Me.LblHeader.Location = New System.Drawing.Point(12, 9)
|
||||
Me.LblHeader.Name = "LblHeader"
|
||||
Me.LblHeader.Size = New System.Drawing.Size(39, 13)
|
||||
Me.LblHeader.TabIndex = 2
|
||||
Me.LblHeader.Text = "Label2"
|
||||
'
|
||||
'TxtIP
|
||||
'
|
||||
Me.TxtIP.Location = New System.Drawing.Point(53, 66)
|
||||
Me.TxtIP.Name = "TxtIP"
|
||||
Me.TxtIP.Size = New System.Drawing.Size(181, 20)
|
||||
Me.TxtIP.TabIndex = 4
|
||||
'
|
||||
'LblNW
|
||||
'
|
||||
Me.LblNW.AutoSize = True
|
||||
Me.LblNW.Location = New System.Drawing.Point(12, 69)
|
||||
Me.LblNW.Name = "LblNW"
|
||||
Me.LblNW.Size = New System.Drawing.Size(20, 13)
|
||||
Me.LblNW.TabIndex = 3
|
||||
Me.LblNW.Text = "IP:"
|
||||
'
|
||||
'CmdAdd
|
||||
'
|
||||
Me.CmdAdd.BackColor = System.Drawing.SystemColors.ControlLightLight
|
||||
Me.CmdAdd.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.CmdAdd.Location = New System.Drawing.Point(159, 92)
|
||||
Me.CmdAdd.Name = "CmdAdd"
|
||||
Me.CmdAdd.Size = New System.Drawing.Size(75, 23)
|
||||
Me.CmdAdd.TabIndex = 5
|
||||
Me.CmdAdd.Text = "Hinzufügen"
|
||||
Me.CmdAdd.UseVisualStyleBackColor = False
|
||||
'
|
||||
'NetzwerkHinzu
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.BackColor = System.Drawing.SystemColors.GradientInactiveCaption
|
||||
Me.ClientSize = New System.Drawing.Size(260, 147)
|
||||
Me.Controls.Add(Me.CmdAdd)
|
||||
Me.Controls.Add(Me.TxtIP)
|
||||
Me.Controls.Add(Me.LblNW)
|
||||
Me.Controls.Add(Me.LblHeader)
|
||||
Me.Controls.Add(Me.TxtName)
|
||||
Me.Controls.Add(Me.Label1)
|
||||
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
|
||||
Me.Name = "NetzwerkHinzu"
|
||||
Me.Text = "NetzwerkHinzu"
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
End Sub
|
||||
|
||||
Friend WithEvents Label1 As Label
|
||||
Friend WithEvents TxtName As TextBox
|
||||
Friend WithEvents LblHeader As Label
|
||||
Friend WithEvents TxtIP As TextBox
|
||||
Friend WithEvents LblNW As Label
|
||||
Friend WithEvents CmdAdd As Button
|
||||
End Class
|
||||
1253
Dokumentation/Administration/NetzwerkHinzu.resx
Normal file
1253
Dokumentation/Administration/NetzwerkHinzu.resx
Normal file
File diff suppressed because it is too large
Load Diff
69
Dokumentation/Administration/NetzwerkHinzu.vb
Normal file
69
Dokumentation/Administration/NetzwerkHinzu.vb
Normal file
@@ -0,0 +1,69 @@
|
||||
Imports System.Data.SqlClient
|
||||
Public Class NetzwerkHinzu
|
||||
|
||||
Private con As New SqlConnection
|
||||
Private cmd As New SqlCommand
|
||||
Private reader As SqlDataReader
|
||||
Public NeuerNetzwerkname As String
|
||||
Public NeuerNetzwerkNameIntern As String
|
||||
Public Standortname As String = NetzwerkAdmin.LstStandort.SelectedItem
|
||||
|
||||
Private Function dbload()
|
||||
con.ConnectionString = Class1.DBConString
|
||||
cmd.Connection = con
|
||||
End Function
|
||||
|
||||
Private Sub CmdAdd_Click(sender As Object, e As EventArgs) Handles CmdAdd.Click
|
||||
NetzwerkAdd()
|
||||
NetzwerkAdmin.LstStandortLoad()
|
||||
NetzwerkAdmin.LstNetzwerkLoad()
|
||||
End Sub
|
||||
|
||||
Private Sub TxtIP_Enter(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TxtIP.KeyDown
|
||||
If e.KeyCode = Keys.Enter Then
|
||||
NEtzwerkAdd()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function NetzwerkAdd()
|
||||
Dim ds As New DataSet()
|
||||
Dim dt As New DataTable()
|
||||
dbload()
|
||||
NeuerNetzwerkname = TxtName.Text
|
||||
NeuerNetzwerkNameIntern = Standortname & "_" & NeuerNetzwerkname
|
||||
Try
|
||||
con.Open()
|
||||
cmd.CommandText = "SELECT * FROM Tbl_Netzwerke WHERE Netzwerkname='" & NeuerNetzwerkNameIntern & "'"
|
||||
reader = cmd.ExecuteReader()
|
||||
If reader.Read() Then
|
||||
MsgBox("Netzwerk ist bereits vorhanden!")
|
||||
reader.Close()
|
||||
Else
|
||||
MsgBox("Neues Netzwerk wird erstellt: " & NeuerNetzwerkNameIntern)
|
||||
reader.Close()
|
||||
cmd.CommandText = "INSERT INTO Tbl_Netzwerke (Netzwerkname, Netzwerk, NWSTANDORT, NETNAME, Subnetz) VALUES ('" & NeuerNetzwerkNameIntern & "', '" & TxtIP.Text & "', '" & Standortname & "', '" & NeuerNetzwerkname & "', '255.255.255.0')"
|
||||
cmd.ExecuteNonQuery()
|
||||
Class1.Absender = "Netzwerkhinzu"
|
||||
NWEdit.Show()
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
End Try
|
||||
con.Close()
|
||||
Me.Close()
|
||||
End Function
|
||||
|
||||
Private Sub NetzwerkHinzu_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
If Standortname = "" Then
|
||||
MsgBox("Kein Standort ausgewählt")
|
||||
Me.Close()
|
||||
End If
|
||||
LblHeader.Text = Standortname
|
||||
End Sub
|
||||
|
||||
Private Sub TxtName_TextChanged(sender As Object, e As EventArgs) Handles TxtName.TextChanged
|
||||
LblHeader.Text = "Netzwerk " & Standortname & "_" & TxtName.Text & " hinzufügen."
|
||||
End Sub
|
||||
End Class
|
||||
98
Dokumentation/Administration/Standorthinzu.Designer.vb
generated
Normal file
98
Dokumentation/Administration/Standorthinzu.Designer.vb
generated
Normal file
@@ -0,0 +1,98 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class Standorthinzu
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Das Formular ü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.TxtStandort = New System.Windows.Forms.TextBox()
|
||||
Me.Label1 = New System.Windows.Forms.Label()
|
||||
Me.CmdAdd = New System.Windows.Forms.Button()
|
||||
Me.Label2 = New System.Windows.Forms.Label()
|
||||
Me.TxtNetzwerkintern = New System.Windows.Forms.TextBox()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'TxtStandort
|
||||
'
|
||||
Me.TxtStandort.Location = New System.Drawing.Point(103, 14)
|
||||
Me.TxtStandort.Name = "TxtStandort"
|
||||
Me.TxtStandort.Size = New System.Drawing.Size(181, 20)
|
||||
Me.TxtStandort.TabIndex = 0
|
||||
'
|
||||
'Label1
|
||||
'
|
||||
Me.Label1.AutoSize = True
|
||||
Me.Label1.Location = New System.Drawing.Point(21, 17)
|
||||
Me.Label1.Name = "Label1"
|
||||
Me.Label1.Size = New System.Drawing.Size(76, 13)
|
||||
Me.Label1.TabIndex = 1
|
||||
Me.Label1.Text = "Standortname:"
|
||||
'
|
||||
'CmdAdd
|
||||
'
|
||||
Me.CmdAdd.BackColor = System.Drawing.SystemColors.ControlLightLight
|
||||
Me.CmdAdd.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.CmdAdd.Location = New System.Drawing.Point(209, 77)
|
||||
Me.CmdAdd.Name = "CmdAdd"
|
||||
Me.CmdAdd.Size = New System.Drawing.Size(75, 23)
|
||||
Me.CmdAdd.TabIndex = 2
|
||||
Me.CmdAdd.Text = "Hinzufügen"
|
||||
Me.CmdAdd.UseVisualStyleBackColor = False
|
||||
'
|
||||
'Label2
|
||||
'
|
||||
Me.Label2.AutoSize = True
|
||||
Me.Label2.Location = New System.Drawing.Point(25, 43)
|
||||
Me.Label2.Name = "Label2"
|
||||
Me.Label2.Size = New System.Drawing.Size(72, 13)
|
||||
Me.Label2.TabIndex = 4
|
||||
Me.Label2.Text = "NetzIP Intern:"
|
||||
'
|
||||
'TxtNetzwerkintern
|
||||
'
|
||||
Me.TxtNetzwerkintern.Location = New System.Drawing.Point(103, 40)
|
||||
Me.TxtNetzwerkintern.Name = "TxtNetzwerkintern"
|
||||
Me.TxtNetzwerkintern.Size = New System.Drawing.Size(181, 20)
|
||||
Me.TxtNetzwerkintern.TabIndex = 1
|
||||
'
|
||||
'Standorthinzu
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.BackColor = System.Drawing.SystemColors.GradientInactiveCaption
|
||||
Me.ClientSize = New System.Drawing.Size(299, 118)
|
||||
Me.Controls.Add(Me.Label2)
|
||||
Me.Controls.Add(Me.TxtNetzwerkintern)
|
||||
Me.Controls.Add(Me.CmdAdd)
|
||||
Me.Controls.Add(Me.Label1)
|
||||
Me.Controls.Add(Me.TxtStandort)
|
||||
Me.Name = "Standorthinzu"
|
||||
Me.Text = "Standorthinzu"
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
End Sub
|
||||
|
||||
Friend WithEvents TxtStandort As TextBox
|
||||
Friend WithEvents Label1 As Label
|
||||
Friend WithEvents CmdAdd As Button
|
||||
Friend WithEvents Label2 As Label
|
||||
Friend WithEvents TxtNetzwerkintern As TextBox
|
||||
End Class
|
||||
120
Dokumentation/Administration/Standorthinzu.resx
Normal file
120
Dokumentation/Administration/Standorthinzu.resx
Normal 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>
|
||||
60
Dokumentation/Administration/Standorthinzu.vb
Normal file
60
Dokumentation/Administration/Standorthinzu.vb
Normal file
@@ -0,0 +1,60 @@
|
||||
Imports System.Data.SqlClient
|
||||
Public Class Standorthinzu
|
||||
|
||||
Private con As New SqlConnection
|
||||
Private cmd As New SqlCommand
|
||||
Private reader As SqlDataReader
|
||||
Public NeuerStandortName As String
|
||||
Public NeuerStandortNameIntern As String
|
||||
|
||||
Private Function dbload()
|
||||
con.ConnectionString = Class1.DBConString
|
||||
cmd.Connection = con
|
||||
End Function
|
||||
|
||||
Private Sub CmdAdd_Click(sender As Object, e As EventArgs) Handles CmdAdd.Click
|
||||
StandortAdd()
|
||||
NetzwerkAdmin.LstStandortLoad()
|
||||
NetzwerkAdmin.LstNetzwerkLoad()
|
||||
End Sub
|
||||
|
||||
Private Sub TxtNetzwerkIntern_Enter(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TxtNetzwerkintern.KeyDown
|
||||
If e.KeyCode = Keys.Enter Then
|
||||
StandortAdd()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function StandortAdd()
|
||||
Dim ds As New DataSet()
|
||||
Dim dt As New DataTable()
|
||||
dbload()
|
||||
NeuerStandortName = TxtStandort.Text
|
||||
NeuerStandortNameIntern = TxtStandort.Text & "_Intern"
|
||||
Try
|
||||
con.Open()
|
||||
cmd.CommandText = "SELECT * FROM Tbl_Netzwerke WHERE Netzwerkname='" & NeuerStandortNameIntern & "'"
|
||||
reader = cmd.ExecuteReader()
|
||||
If reader.Read() Then
|
||||
MsgBox("Standort ist bereits vorhanden!")
|
||||
reader.Close()
|
||||
Else
|
||||
MsgBox("Neuer Standort mit Standardnetzwerk 'Intern' wird erstellt: " & NeuerStandortNameIntern)
|
||||
reader.Close()
|
||||
cmd.CommandText = "INSERT INTO Tbl_Netzwerke (Netzwerkname, VLAN, Netzwerk, NWSTANDORT, NETNAME, MAIN, SUBNETZ) VALUES ('" & NeuerStandortNameIntern & "', '0', '" & TxtNetzwerkintern.Text & "', '" & NeuerStandortName & "', 'Intern', '1', '255.255.255.0')"
|
||||
cmd.ExecuteNonQuery()
|
||||
Class1.Absender = "Standorthinzu"
|
||||
NWEdit.Show()
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
End Try
|
||||
con.Close()
|
||||
Me.Close()
|
||||
End Function
|
||||
|
||||
Private Sub TxtStandort_TextChanged(sender As Object, e As EventArgs) Handles TxtStandort.TextChanged
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user