TSSittzungen

This commit is contained in:
ms
2019-10-25 11:48:37 +02:00
parent ce28d0bcce
commit 2197c92cba
35 changed files with 1397 additions and 133 deletions

View File

@@ -21,8 +21,10 @@ Public Class Class1
Public Shared DebugText As String = ""
Public Shared GroupUsers As List(Of cBenutzer)
Public Shared dtSuchergebnis As DataTable
Public Shared TeamviewerToken As String = "6920997-rtea7sZy35Ujw2Erm3OP"
Public Shared HostList As New List(Of String)
Public Shared TerminalServerList As New List(Of String)
Public Shared Sub EnableDoubleBuffered(ByVal dgv As DataGridView)
@@ -33,6 +35,7 @@ Public Class Class1
End Sub
Public Shared Function CheckDebug()
Dim Debugoverride As Boolean = True 'wenn True dann Override auf Produktiv!
Dim Startparameter As String = ""
Dim i As Integer
For Each s As String In Environment.GetCommandLineArgs
@@ -45,15 +48,13 @@ Public Class Class1
i += 1
Next
If Main.sAppPath Like "*\bin\Debug" Or Startparameter = "debug" Then
If (Main.sAppPath Like "*\bin\Debug" Or Startparameter = "debug") And Debugoverride = False Then
DebugMode = True
Class1.DBConString = "Server=DEVELOPER.verag.ost.dmn\DEVSQL;Initial Catalog=Doku;User ID=sa;Password=BmWr501956;Connection Timeout=5;"
Class1.FilePath = "\\192.168.0.253\backup\temp_Sebastian\DokuTest"
Else
'Class1.DBConString = "Server=192.168.0.94\SQLEXPRESS;Initial Catalog=Doku;User ID=sa;Password=BmWr501956;Connection Timeout=5;"
Class1.DBConString = "Server=buchhaltung.verag.ost.dmn\SQLEXPRESS;Initial Catalog=Doku;User ID=sa;Password=BmWr501956;Connection Timeout=5;"
'Class1.FilePath = "\\192.168.0.90\f\EDV-Wartung\Dokumentation"
Class1.FilePath = "\\DEVELOPER.verag.ost.dmn\f\EDV-Wartung\Dokumentation"
End If
End Function
@@ -131,6 +132,52 @@ Public Class Class1
End Try
End Function
Public Shared Function datatable_2_csv_export(dt As DataTable)
Dim savefiledialog As New SaveFileDialog
Dim firstin As String
Dim out As String
Dim in2 As String
Dim header As String
savefiledialog.Filter = "CSV files (*.csv)|*.CSV"
savefiledialog.InitialDirectory = "C:\Verag"
savefiledialog.ShowDialog()
Try
For r As Integer = 0 To dt.Rows.Count - 1
For c As Integer = 0 To dt.Columns.Count - 1
'test &= r & c & vbCrLf
Try
'test &= Replace(quelldgv.Rows(r).Cells(c).Value.ToString, vbCrLf, "vbCrlLf")
firstin = dt.Rows(r).Item(c).ToString
firstin = Replace(firstin, ";", ",")
'in2 = """" & firstin & """" & ";"
in2 = firstin & ";"
out &= Replace(in2, vbCrLf, "##vbCrLf##")
Catch ex As Exception
MsgBox(ex.Message)
out &= "ooo"
End Try
Next
out &= "nZ"
Next
For c As Integer = 0 To dt.Columns.Count - 1
header &= dt.Columns(c).ColumnName & ";"
Next
out = Replace(out, "nZ", vbCrLf)
'MsgBox(out)
Using sw As New IO.StreamWriter(savefiledialog.FileName)
sw.WriteLine(header)
sw.WriteLine(out)
End Using
Catch ex As Exception
MsgBox("datatable_2_csv_export: " & ex.Message)
End Try
End Function
Public Shared Function hochkomma(textin As String)
Dim textout As String = textin.Replace("'", "''")
Return (textout)