anpassungenMerge

This commit is contained in:
2025-06-16 09:33:13 +02:00
parent fd43887f58
commit 49197e5804
5 changed files with 607 additions and 628 deletions

View File

@@ -83,6 +83,7 @@ Partial Class usrctlProcedures
Me.tctModalTEstLRN = New System.Windows.Forms.TextBox()
Me.Button45 = New System.Windows.Forms.Button()
Me.TabPage5 = New System.Windows.Forms.TabPage()
Me.btnTC_FtpIUpload = New System.Windows.Forms.Button()
Me.Button48 = New System.Windows.Forms.Button()
Me.Button47 = New System.Windows.Forms.Button()
Me.Button18 = New System.Windows.Forms.Button()
@@ -138,7 +139,6 @@ Partial Class usrctlProcedures
Me.Button43 = New System.Windows.Forms.Button()
Me.DataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn()
Me.DataGridViewTextBoxColumn2 = New System.Windows.Forms.DataGridViewTextBoxColumn()
Me.Button49 = New System.Windows.Forms.Button()
Me.TabControl1.SuspendLayout()
Me.TabPage3.SuspendLayout()
Me.TabPage1.SuspendLayout()
@@ -731,6 +731,7 @@ Partial Class usrctlProcedures
'
'TabPage5
'
Me.TabPage5.Controls.Add(Me.btnTC_FtpIUpload)
Me.TabPage5.Controls.Add(Me.Button48)
Me.TabPage5.Controls.Add(Me.Button47)
Me.TabPage5.Location = New System.Drawing.Point(4, 22)
@@ -741,6 +742,15 @@ Partial Class usrctlProcedures
Me.TabPage5.Text = "Teleotec"
Me.TabPage5.UseVisualStyleBackColor = True
'
'btnTC_FtpIUpload
'
Me.btnTC_FtpIUpload.Location = New System.Drawing.Point(48, 157)
Me.btnTC_FtpIUpload.Name = "btnTC_FtpIUpload"
Me.btnTC_FtpIUpload.Size = New System.Drawing.Size(145, 49)
Me.btnTC_FtpIUpload.TabIndex = 64
Me.btnTC_FtpIUpload.Text = "TEST FTP UPload ATEZ"
Me.btnTC_FtpIUpload.UseVisualStyleBackColor = True
'
'Button48
'
Me.Button48.Location = New System.Drawing.Point(209, 24)
@@ -1238,20 +1248,10 @@ Partial Class usrctlProcedures
Me.DataGridViewTextBoxColumn2.HeaderText = "anz"
Me.DataGridViewTextBoxColumn2.Name = "DataGridViewTextBoxColumn2"
'
'Button49
'
Me.Button49.Location = New System.Drawing.Point(547, 29)
Me.Button49.Name = "Button49"
Me.Button49.Size = New System.Drawing.Size(145, 49)
Me.Button49.TabIndex = 66
Me.Button49.Text = "Kundenkontakte imp."
Me.Button49.UseVisualStyleBackColor = True
'
'usrctlProcedures
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.Controls.Add(Me.Button49)
Me.Controls.Add(Me.Button43)
Me.Controls.Add(Me.Button33)
Me.Controls.Add(Me.lblStatus)
@@ -1440,5 +1440,5 @@ Partial Class usrctlProcedures
Friend WithEvents TabPage5 As TabPage
Friend WithEvents Button47 As Button
Friend WithEvents Button48 As Button
Friend WithEvents Button49 As Button
Friend WithEvents btnTC_FtpIUpload As Button
End Class

View File

@@ -1,23 +1,23 @@
Imports System.DirectoryServices
Imports System.Collections.Generic
Imports PdfSharp.Pdf
Imports PdfSharp.Drawing
Imports PdfSharp.Pdf.IO
Imports PdfSharp.Pdf.AcroForms
Imports iTextSharp.text.pdf
Imports System.IO
Imports System.Data.SqlClient
Imports System.Net.Mail
Imports Microsoft.Office.Interop
Imports System.Net
Imports System.Text
Imports System.Xml.Serialization
Imports System.Xml
Imports System.Collections.Generic
Imports System.Data.OleDb
Imports System.Data.SqlClient
Imports System.DirectoryServices
Imports System.IO
Imports System.Net
Imports System.Net.Mail
Imports System.Text
Imports System.Xml
Imports System.Xml.Serialization
Imports Chilkat
Imports TELOTEC_Worker
Imports GrapeCity
Imports iTextSharp.text.pdf
Imports Microsoft.Office.Interop
Imports PdfSharp.Drawing
Imports PdfSharp.Pdf
Imports PdfSharp.Pdf.AcroForms
Imports PdfSharp.Pdf.IO
Imports Renci.SshNet
Imports TELOTEC_Worker
Imports VERAG_PROG_ALLGEMEIN
Imports VERAG_PROG_ALLGEMEIN.cTelotecAPI
'Imports Microsoft.Office.Interop
@@ -3774,7 +3774,7 @@ Public Class usrctlProcedures
' Pfad zur Excel-Datei anpassen
Dim filePath As String = "D:\Andreas\TMP\elotec ncts 02 2025\ATILLA _ DUR.xlsx"
Dim filePath As String = "D:\Andreas\TMP\elot\Garantiebeträge 042025-Atilla-Durmaz.xlsx"
' Excel Anwendung starten
Dim excelApp As New Excel.Application
@@ -3796,8 +3796,8 @@ Public Class usrctlProcedures
TELANM = New cTelotec_Anmeldung
End If
TELANM.telanm_ART = "T2" '"T1" '"T2"
TELANM.Hea_DecTy = "T2" '"T1" '"T2"
TELANM.telanm_ART = "T1" '"T1" '"T2"
TELANM.Hea_DecTy = "T1" '"T1" '"T2"
TELANM.telanm_BezugsNr = excelRange.Cells(i, 4).Value
TELANM.Refs_LRN = excelRange.Cells(i, 4).Value
TELANM.telanm_Status = 50
@@ -3860,6 +3860,7 @@ Public Class usrctlProcedures
'TELANM.SAVE()
Console.WriteLine(TELANM.Refs_LRN & " - " & i)
Next
@@ -3883,7 +3884,7 @@ Public Class usrctlProcedures
ReleaseObject(excelApp)
Console.WriteLine("Excel-Daten wurden erfolgreich ausgelesen.")
Console.ReadKey()
'Console.ReadKey()
End Sub
@@ -3921,16 +3922,39 @@ Public Class usrctlProcedures
Private Sub Button47_Click(sender As Object, e As EventArgs) Handles Button47.Click
Dim TELO As New VERAG_PROG_ALLGEMEIN.cTelotecAPI
Dim Company = "ATILLA"
Dim messages As List(Of VERAG_PROG_ALLGEMEIN.cTelotecAPI.TAMessage) = TELO.GetTAMessages()
MsgBox(messages.Count)
For Each mmm In messages
MsgBox(mmm.lrn)
MsgBox(mmm.declarationContent.anmeldedatum)
For ii As Integer = 0 To 50
Dim messages As List(Of VERAG_PROG_ALLGEMEIN.cTelotecAPI.TAMessage) = TELO.GetTAMessages(Company)
Threading.Thread.Sleep(1000) '
Next
Company = "IMEX"
For ii As Integer = 0 To 50
Dim messages As List(Of VERAG_PROG_ALLGEMEIN.cTelotecAPI.TAMessage) = TELO.GetTAMessages(Company)
Threading.Thread.Sleep(1000) '
Next
Company = "DURMAZ"
For ii As Integer = 0 To 50
Dim messages As List(Of VERAG_PROG_ALLGEMEIN.cTelotecAPI.TAMessage) = TELO.GetTAMessages(Company)
Threading.Thread.Sleep(1000) '
Next
'Company = "VERAG" = ATILLA
'For ii As Integer = 0 To 50
' Dim messages As List(Of VERAG_PROG_ALLGEMEIN.cTelotecAPI.TAMessage) = TELO.GetTAMessages(Company)
' Threading.Thread.Sleep(1000) '
'Next
' MsgBox(messages.Count)
'For Each mmm In messages
' ' MsgBox(mmm.lrn)
' ' MsgBox(mmm.declarationContent.anmeldedatum)
'Next
End Sub
Private Sub Button48_Click(sender As Object, e As EventArgs) Handles Button48.Click
@@ -3956,9 +3980,7 @@ Public Class usrctlProcedures
If TELO_ANM.SAVE() Then
MsgBox("SUSSSSS")
End If
Next
Else
Console.WriteLine("🔕 Keine Datei ausgewählt.")
End If
@@ -3967,107 +3989,18 @@ Public Class usrctlProcedures
End Sub
Private Sub Button49_Click(sender As Object, e As EventArgs) Handles Button49.Click
Private Sub Button49_Click(sender As Object, e As EventArgs) Handles btnTC_FtpIUpload.Click
Using ofd As New OpenFileDialog()
ofd.Title = "Wähle eine TEST-Datei"
Dim cnt = 0
Dim sql As New VERAG_PROG_ALLGEMEIN.SQL
Dim kdnr_tmp = ""
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = CheckBox3.Checked
Try
Dim fd As New OpenFileDialog
If fd.ShowDialog = DialogResult.OK Then
If fd.FileName.ToLower.EndsWith(".csv") Then
' fd.FileName.EndsWith(".csv")
Using MyReader As New Microsoft.VisualBasic.FileIO.TextFieldParser(fd.FileName, Encoding.Default)
MyReader.TextFieldType = FileIO.FieldType.Delimited
MyReader.SetDelimiters(";")
Dim currentRow As String()
While Not MyReader.EndOfData
Try
'
currentRow = MyReader.ReadFields()
If currentRow.Length > 2 Then
If Not (currentRow(0).Trim() = "aktiv") Then
If currentRow.Length > 12 Then
Dim kundenNr = isleernothing((currentRow(1)))
If kundenNr IsNot Nothing Then
kdnr_tmp = kundenNr
'Mahnung an
If isleernothing((currentRow(9))) IsNot Nothing Then
Dim KDKont As New VERAG_PROG_ALLGEMEIN.cKundenKontakte(10, kundenNr)
KDKont.kkd_Email = isleernothing((currentRow(9)))
KDKont.kkd_kkaId = 10 'Mahnung an
KDKont.kkd_kkaBez = "Mahnung an"
If KDKont.SAVE() Then
TextBox10.Text &= KDKont.kkd_id & vbNewLine
Else
MsgBox("FEHLER: " & currentRow(2).Trim() & " - " & currentRow(3).Trim())
End If
End If
'Rechnung an
If isleernothing((currentRow(10))) IsNot Nothing Then
Dim KDKont As New VERAG_PROG_ALLGEMEIN.cKundenKontakte(8, kundenNr)
KDKont.kkd_Email = isleernothing((currentRow(10)))
KDKont.kkd_kkaId = 8 'Rechnung an
KDKont.kkd_kkaBez = "Rechnung an"
If KDKont.SAVE() Then
TextBox10.Text &= KDKont.kkd_id & vbNewLine
Else
MsgBox("FEHLER: " & currentRow(2).Trim() & " - " & currentRow(3).Trim())
End If
End If
End If
If cnt Mod 10 = 0 Then
Application.DoEvents()
Label10.Text = (cnt + 1)
End If
Else
'MsgBox(currentRow(2))
End If
End If
End If
'For Each currentField In currentRow
cnt += 1
'Next
Catch ex As Exception
MsgBox(kdnr_tmp & " " & ex.Message & ex.StackTrace)
End Try
End While
End Using
End If
If ofd.ShowDialog() = DialogResult.OK Then
Dim selectedPath As String = ofd.FileName
Dim c As New cTelotecAPI
c.SaveJsonResponseTo_ATEZFTP(selectedPath)
Else
Console.WriteLine("🔕 Keine Datei ausgewählt.")
End If
Catch ex As Exception
MessageBox.Show("Datei nicht vorhanden.")
Finally
End Try
End Using
End Sub