IT Nothotline, allgemeine Verbesserungen
This commit is contained in:
@@ -62,7 +62,7 @@ Public Class Class1
|
||||
Class1.DBConString = DBDokuTest '"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 = DBDoku '"Server=buchhaltung.verag.ost.dmn\SQLEXPRESS;Initial Catalog=Doku;User ID=sa;Password=BmWr501956;Connection Timeout=5;"
|
||||
Class1.DBConString = DBDoku '"Server=sqlguide01.verag.ost.dmn;Initial Catalog=Doku;User ID=sa;Password=BmWr501956;Connection Timeout=5;"
|
||||
Class1.FilePath = "\\DEVELOPER.verag.ost.dmn\f\EDV-Wartung\Dokumentation"
|
||||
End If
|
||||
End Function
|
||||
@@ -722,7 +722,7 @@ Public Class Class1
|
||||
|
||||
' txtbox.AutoCompleteMode = AutoCompleteMode.SuggestAppend
|
||||
' txtbox.AutoCompleteSource = AutoCompleteSource.CustomSource
|
||||
txtbox.AutoCompleteCustomSource = tmp
|
||||
|
||||
|
||||
For Each dr As DataRow In ds.Tables(0).Rows
|
||||
Try
|
||||
@@ -733,6 +733,47 @@ Public Class Class1
|
||||
'Items.Add(dr.Item(0))
|
||||
Next
|
||||
|
||||
txtbox.AutoCompleteCustomSource = tmp
|
||||
|
||||
con.Close()
|
||||
Catch ex As Exception
|
||||
MsgBox("Fehler Autocomplete: " & ex.Message)
|
||||
con.Close()
|
||||
End Try
|
||||
con.Close()
|
||||
End Function
|
||||
|
||||
Public Shared Function AutocompleteCombo(ByRef Combo As ComboBox, spalte As String, Tabelle As String, Optional ByVal ItemNr As Integer = 0)
|
||||
Dim tmp As New AutoCompleteStringCollection
|
||||
Dim con As New SqlConnection
|
||||
Dim cmd As New SqlCommand
|
||||
con.ConnectionString = Class1.DBConString
|
||||
cmd.Connection = con
|
||||
|
||||
Try
|
||||
con.Open()
|
||||
|
||||
Dim ds As New DataSet()
|
||||
Dim dt As New DataTable()
|
||||
Dim dataadapter As New SqlDataAdapter("SELECT Distinct " & spalte & " from " & Tabelle & "", con)
|
||||
dataadapter.Fill(ds)
|
||||
|
||||
' txtbox.AutoCompleteMode = AutoCompleteMode.SuggestAppend
|
||||
' txtbox.AutoCompleteSource = AutoCompleteSource.CustomSource
|
||||
Combo.AutoCompleteCustomSource = tmp
|
||||
|
||||
For Each dr As DataRow In ds.Tables(0).Rows
|
||||
Try
|
||||
tmp.Add(dr.Item(ItemNr))
|
||||
Catch
|
||||
End Try
|
||||
|
||||
'Items.Add(dr.Item(0))
|
||||
Next
|
||||
Combo.DataSource = tmp
|
||||
Combo.AutoCompleteMode = AutoCompleteMode.Suggest
|
||||
Combo.AutoCompleteCustomSource = tmp
|
||||
|
||||
con.Close()
|
||||
Catch ex As Exception
|
||||
MsgBox("Fehler Autocomplete: " & ex.Message)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
Imports System.Reflection
|
||||
Imports Chilkat
|
||||
Imports VERAG_PROG_ALLGEMEIN.cCreditSafeAPI
|
||||
|
||||
Public Class cPascom
|
||||
|
||||
Dim API_USER_AUTHORIZATION = "bW9ieTpnWlhTSVprTnhmaUQxOEU="
|
||||
@@ -95,29 +97,142 @@ Public Class cPascom
|
||||
|
||||
End Function
|
||||
|
||||
'Public Function GetTelArbeitsplatz4Host() As Boolean
|
||||
' Try
|
||||
' Dim lines = IO.File.ReadAllLines("\\dc01.verag.ost.dmn\NETLOGON\Telefonarbeitsplaetze.ini")
|
||||
' Dim colCount = lines.First.Split(";"c).Length
|
||||
Public Function Weiterleitung(fromNr As String, toNr As String, Optional ByRef Target As String = "")
|
||||
Try
|
||||
|
||||
' For Each line In lines
|
||||
' Dim objFields = From field In line.Split(";"c)
|
||||
cChilkat_Helper.UnlockCilkat()
|
||||
Dim API_STRING = "pbx3.flashnet.at"
|
||||
|
||||
Dim rest As New Chilkat.Rest
|
||||
Dim success As Boolean
|
||||
|
||||
Dim bTls As Boolean = True
|
||||
Dim port As Integer = 443
|
||||
Dim bAutoReconnect As Boolean = True
|
||||
|
||||
|
||||
' If String.Compare(cRes.LocalUser.Hostname, objFields(0).ToString, True) = 0 Then
|
||||
' Arbeitsplatz = objFields(1).ToString
|
||||
' '_ConString = objFields(2).ToString
|
||||
' Return True
|
||||
' Exit Function
|
||||
' End If
|
||||
success = rest.Connect(API_STRING, port, bTls, bAutoReconnect)
|
||||
If (success <> True) Then
|
||||
Debug.WriteLine("ConnectFailReason: " & rest.ConnectFailReason)
|
||||
Debug.WriteLine(rest.LastErrorText)
|
||||
|
||||
Return False
|
||||
End If
|
||||
|
||||
rest.AddHeader("Content-Type", "application/json")
|
||||
rest.SetAuthBasic("moby", "XgDsFmMSutaMLA1")
|
||||
|
||||
|
||||
Dim json As New Chilkat.JsonObject
|
||||
|
||||
Dim successJsonLoad As Boolean = json.Load("
|
||||
{""target"":""" & toNr & """}}")
|
||||
|
||||
If (successJsonLoad <> True) Then
|
||||
MsgBox(json.LastErrorText)
|
||||
Return False
|
||||
End If
|
||||
|
||||
|
||||
Dim sbRequestBody As New Chilkat.StringBuilder
|
||||
json.EmitSb(sbRequestBody)
|
||||
|
||||
' MsgBox(sbRequestBody.ToString)
|
||||
Dim sbResponseBody As New Chilkat.StringBuilder
|
||||
success = rest.FullRequestSb("POST", "/verag/services/redirect/" & fromNr, sbRequestBody, sbResponseBody)
|
||||
If (success <> True) Then
|
||||
Debug.WriteLine(rest.LastErrorText)
|
||||
Return False
|
||||
End If
|
||||
Dim respStatusCode As Integer = rest.ResponseStatusCode
|
||||
|
||||
If (respStatusCode <> 200) Then
|
||||
|
||||
' MsgBox(sbResponseBody.GetAsString())
|
||||
|
||||
Return False
|
||||
End If
|
||||
|
||||
|
||||
Dim jsonResp = New Chilkat.JsonObject()
|
||||
jsonResp.LoadSb(sbResponseBody)
|
||||
|
||||
Dim gatewayId = jsonResp.StringOf("gatewayId")
|
||||
Dim Resp_error = jsonResp.StringOf("error")
|
||||
Dim Resp_errorCode = jsonResp.StringOf("errorCode")
|
||||
Target = jsonResp.StringOf("target")
|
||||
|
||||
' MsgBox("Hier!!!")
|
||||
|
||||
|
||||
Return True
|
||||
|
||||
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
Return False
|
||||
End Try
|
||||
Return True
|
||||
|
||||
End Function
|
||||
|
||||
Function getredirect(ByRef target As String) As String
|
||||
Try
|
||||
|
||||
cChilkat_Helper.UnlockCilkat()
|
||||
Dim API_STRING = "pbx3.flashnet.at"
|
||||
|
||||
Dim rest As New Chilkat.Rest
|
||||
Dim success As Boolean
|
||||
|
||||
Dim bTls As Boolean = True
|
||||
Dim port As Integer = 443
|
||||
Dim bAutoReconnect As Boolean = True
|
||||
|
||||
|
||||
success = rest.Connect(API_STRING, port, bTls, bAutoReconnect)
|
||||
If (success <> True) Then
|
||||
Debug.WriteLine("ConnectFailReason: " & rest.ConnectFailReason)
|
||||
Debug.WriteLine(rest.LastErrorText)
|
||||
|
||||
Return False
|
||||
End If
|
||||
|
||||
rest.AddHeader("Content-Type", "application/json")
|
||||
rest.SetAuthBasic("moby", "XgDsFmMSutaMLA1")
|
||||
|
||||
|
||||
Dim json As New Chilkat.JsonObject
|
||||
|
||||
|
||||
Dim sbRequestBody As New Chilkat.StringBuilder
|
||||
json.EmitSb(sbRequestBody)
|
||||
|
||||
' MsgBox(sbRequestBody.ToString)
|
||||
Dim sbResponseBody As New Chilkat.StringBuilder
|
||||
success = rest.FullRequestNoBodySb("GET", "/verag/services/redirect/", sbResponseBody)
|
||||
If (success <> True) Then
|
||||
Debug.WriteLine(rest.LastErrorText)
|
||||
Return False
|
||||
End If
|
||||
Dim respStatusCode As Integer = rest.ResponseStatusCode
|
||||
|
||||
If (respStatusCode <> 200) Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
Return sbResponseBody.GetAfterBetween(target, ":", ",")
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
Return False
|
||||
End Try
|
||||
Return True
|
||||
End Function
|
||||
|
||||
|
||||
' ' End Select
|
||||
' Next
|
||||
' Return False
|
||||
' Catch ex As Exception
|
||||
' ' MsgBox("Fehler beim Lesen TSAnmeldung.ini: " & vbCrLf & ex.Message)
|
||||
' End Try
|
||||
'End Function
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user