diff --git a/SDL/App.config b/SDL/App.config
index 8b2d0803..140d6275 100644
--- a/SDL/App.config
+++ b/SDL/App.config
@@ -175,15 +175,15 @@
-
+
-
+
-
+
diff --git a/SDL/SDL.vbproj b/SDL/SDL.vbproj
index dc421f95..9a2954fc 100644
--- a/SDL/SDL.vbproj
+++ b/SDL/SDL.vbproj
@@ -1,5 +1,6 @@
+
Debug
@@ -33,6 +34,8 @@
false
true
true
+
+
x64
@@ -425,6 +428,9 @@
..\..\..\Aviso\AVISO\packages\Microsoft.Bcl.AsyncInterfaces.6.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll
+
+ ..\..\..\AVISO\Aviso\packages\Microsoft.Bcl.HashCode.6.0.0\lib\net462\Microsoft.Bcl.HashCode.dll
+
..\..\..\Aviso\AVISO\packages\Microsoft.Extensions.DependencyInjection.5.0.0\lib\net461\Microsoft.Extensions.DependencyInjection.dll
@@ -467,6 +473,9 @@
False
..\..\..\dll\SharpSSH\Org.Mentalis.Security.dll
+
+ ..\..\..\AVISO\Aviso\packages\PdfiumViewer.2.13.0.0\lib\net20\PdfiumViewer.dll
+
@@ -486,8 +495,8 @@
..\packages\ZUGFeRD-csharp.17.4.0\lib\net48\s2industries.ZUGFeRD.dll
-
- ..\..\..\Aviso\AVISO\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll
+
+ ..\..\..\AVISO\Aviso\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll
@@ -523,8 +532,8 @@
..\..\..\Aviso\AVISO\packages\System.Linq.Async.4.0.0\lib\net461\System.Linq.Async.dll
-
- ..\..\..\Aviso\AVISO\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll
+
+ ..\..\..\AVISO\Aviso\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll
..\..\..\Aviso\AVISO\packages\System.Net.Http.4.3.4\lib\net46\System.Net.Http.dll
@@ -532,8 +541,8 @@
True
-
- ..\..\..\Aviso\AVISO\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll
+
+ ..\..\..\AVISO\Aviso\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll
..\..\..\Aviso\AVISO\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll
@@ -601,6 +610,27 @@
..\..\..\dll\SharpSSH\Tamir.SharpSSH.dll
+
+ ..\..\..\AVISO\Aviso\packages\PdfPig.0.1.17-alpha-202610150035-3452b\lib\net471\UglyToad.PdfPig.dll
+
+
+ ..\..\..\AVISO\Aviso\packages\PdfPig.0.1.17-alpha-202610150035-3452b\lib\net471\UglyToad.PdfPig.Core.dll
+
+
+ ..\..\..\AVISO\Aviso\packages\PdfPig.0.1.17-alpha-202610150035-3452b\lib\net471\UglyToad.PdfPig.DocumentLayoutAnalysis.dll
+
+
+ ..\..\..\AVISO\Aviso\packages\PdfPig.0.1.17-alpha-202610150035-3452b\lib\net471\UglyToad.PdfPig.Fonts.dll
+
+
+ ..\..\..\AVISO\Aviso\packages\PdfPig.0.1.17-alpha-202610150035-3452b\lib\net471\UglyToad.PdfPig.Package.dll
+
+
+ ..\..\..\AVISO\Aviso\packages\PdfPig.0.1.17-alpha-202610150035-3452b\lib\net471\UglyToad.PdfPig.Tokenization.dll
+
+
+ ..\..\..\AVISO\Aviso\packages\PdfPig.0.1.17-alpha-202610150035-3452b\lib\net471\UglyToad.PdfPig.Tokens.dll
+
True
@@ -613,6 +643,12 @@
..\packages\ZUGFeRD.NET.1.0.1\lib\ZUGFeRD.NET.dll
+
+ ..\..\..\AVISO\Aviso\packages\ZXing.Net.0.16.11\lib\net48\zxing.dll
+
+
+ ..\..\..\AVISO\Aviso\packages\ZXing.Net.0.16.11\lib\net48\zxing.presentation.dll
+
@@ -5937,6 +5973,12 @@
\\192.168.0.90\f\Zertifikate\signtool.exe sign /f \\192.168.0.90\f\Zertifikate\AL20231110.pfx /p zYGNNJRG+tzlw90Rz6NqOXnoeBycFCy07YcUsY5iD0M= "SDL.exe"
+
+
+ Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".
+
+
+
"
Me.Button1.UseVisualStyleBackColor = False
'
+ 'Button5
+ '
+ Me.Button5.BackColor = System.Drawing.Color.White
+ Me.Button5.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center
+ Me.Button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat
+ Me.Button5.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!)
+ Me.Button5.ImageAlign = System.Drawing.ContentAlignment.TopCenter
+ Me.Button5.Location = New System.Drawing.Point(20, 107)
+ Me.Button5.Margin = New System.Windows.Forms.Padding(2)
+ Me.Button5.Name = "Button5"
+ Me.Button5.Size = New System.Drawing.Size(118, 44)
+ Me.Button5.TabIndex = 30
+ Me.Button5.Text = "MRN aus Datei ..."
+ Me.Button5.UseVisualStyleBackColor = False
+ '
+ 'Label9
+ '
+ Me.Label9.Location = New System.Drawing.Point(281, 547)
+ Me.Label9.Name = "Label9"
+ Me.Label9.Size = New System.Drawing.Size(139, 13)
+ Me.Label9.TabIndex = 29
+ Me.Label9.Text = "Anzahl:"
+ Me.Label9.TextAlign = System.Drawing.ContentAlignment.TopRight
+ '
+ 'Button4
+ '
+ Me.Button4.BackColor = System.Drawing.Color.White
+ Me.Button4.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center
+ Me.Button4.FlatStyle = System.Windows.Forms.FlatStyle.Flat
+ Me.Button4.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!)
+ Me.Button4.ImageAlign = System.Drawing.ContentAlignment.TopCenter
+ Me.Button4.Location = New System.Drawing.Point(144, 542)
+ Me.Button4.Margin = New System.Windows.Forms.Padding(2)
+ Me.Button4.Name = "Button4"
+ Me.Button4.Size = New System.Drawing.Size(132, 28)
+ Me.Button4.TabIndex = 28
+ Me.Button4.Text = "Duplikate entfernen"
+ Me.Button4.UseVisualStyleBackColor = False
+ '
'Label5
'
Me.Label5.AutoSize = True
@@ -222,31 +269,30 @@ Partial Class usrCntlATLAS_EXGestellung
'
'MyPanel1
'
+ Me.MyPanel1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
+ Or System.Windows.Forms.AnchorStyles.Left) _
+ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.MyPanel1.BackColor = System.Drawing.Color.WhiteSmoke
Me.MyPanel1.Controls.Add(Me.MyDatagridview1)
Me.MyPanel1.Controls.Add(Me.Label7)
Me.MyPanel1.Enabled = False
Me.MyPanel1.Location = New System.Drawing.Point(454, 88)
Me.MyPanel1.Name = "MyPanel1"
- Me.MyPanel1.Size = New System.Drawing.Size(560, 472)
+ Me.MyPanel1.Size = New System.Drawing.Size(560, 522)
Me.MyPanel1.TabIndex = 20
Me.MyPanel1.Visible = False
'
- 'Button3
+ 'MyDatagridview1
'
- Me.Button3.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
- Me.Button3.BackColor = System.Drawing.Color.White
- Me.Button3.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center
- Me.Button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.Button3.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
- Me.Button3.ImageAlign = System.Drawing.ContentAlignment.TopCenter
- Me.Button3.Location = New System.Drawing.Point(9, 2)
- Me.Button3.Margin = New System.Windows.Forms.Padding(2)
- Me.Button3.Name = "Button3"
- Me.Button3.Size = New System.Drawing.Size(159, 42)
- Me.Button3.TabIndex = 25
- Me.Button3.Text = "NCTS an DAKOSY senden -->"
- Me.Button3.UseVisualStyleBackColor = False
+ Me.MyDatagridview1.AKTUALISIERUNGS_INTERVALL = -1
+ Me.MyDatagridview1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
+ Or System.Windows.Forms.AnchorStyles.Left) _
+ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
+ Me.MyDatagridview1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
+ Me.MyDatagridview1.Location = New System.Drawing.Point(20, 51)
+ Me.MyDatagridview1.Name = "MyDatagridview1"
+ Me.MyDatagridview1.Size = New System.Drawing.Size(537, 454)
+ Me.MyDatagridview1.TabIndex = 26
'
'Label7
'
@@ -368,6 +414,20 @@ Partial Class usrCntlATLAS_EXGestellung
Me.MyPanel2.TabIndex = 26
Me.MyPanel2.Visible = False
'
+ 'cboStammreferenz2
+ '
+ Me.cboStammreferenz2._allowedValuesFreiText = Nothing
+ Me.cboStammreferenz2._allowFreiText = False
+ Me.cboStammreferenz2._value = ""
+ Me.cboStammreferenz2.BackColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer))
+ Me.cboStammreferenz2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
+ Me.cboStammreferenz2.FlatStyle = System.Windows.Forms.FlatStyle.Flat
+ Me.cboStammreferenz2.FormattingEnabled = True
+ Me.cboStammreferenz2.Location = New System.Drawing.Point(113, 22)
+ Me.cboStammreferenz2.Name = "cboStammreferenz2"
+ Me.cboStammreferenz2.Size = New System.Drawing.Size(271, 21)
+ Me.cboStammreferenz2.TabIndex = 27
+ '
'cbxAutoTranslate
'
Me.cbxAutoTranslate.AutoSize = True
@@ -378,6 +438,16 @@ Partial Class usrCntlATLAS_EXGestellung
Me.cbxAutoTranslate.Text = "KN8 Texte bei nicht D-A-CH"
Me.cbxAutoTranslate.UseVisualStyleBackColor = True
'
+ 'Label8
+ '
+ Me.Label8.AutoSize = True
+ Me.Label8.Location = New System.Drawing.Point(17, 25)
+ Me.Label8.Name = "Label8"
+ Me.Label8.Size = New System.Drawing.Size(57, 13)
+ Me.Label8.TabIndex = 28
+ Me.Label8.Text = "Stammref.:"
+ Me.Label8.TextAlign = System.Drawing.ContentAlignment.TopRight
+ '
'cbxForceTranslate
'
Me.cbxForceTranslate.AutoSize = True
@@ -388,6 +458,32 @@ Partial Class usrCntlATLAS_EXGestellung
Me.cbxForceTranslate.Text = "Übersetzung erzwingen"
Me.cbxForceTranslate.UseVisualStyleBackColor = True
'
+ 'Panel3
+ '
+ Me.Panel3.BackColor = System.Drawing.Color.WhiteSmoke
+ Me.Panel3.Controls.Add(Me.Button3)
+ Me.Panel3.Location = New System.Drawing.Point(844, 41)
+ Me.Panel3.Name = "Panel3"
+ Me.Panel3.Size = New System.Drawing.Size(170, 49)
+ Me.Panel3.TabIndex = 27
+ Me.Panel3.Visible = False
+ '
+ 'Button3
+ '
+ Me.Button3.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
+ Me.Button3.BackColor = System.Drawing.Color.White
+ Me.Button3.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center
+ Me.Button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat
+ Me.Button3.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+ Me.Button3.ImageAlign = System.Drawing.ContentAlignment.TopCenter
+ Me.Button3.Location = New System.Drawing.Point(9, 2)
+ Me.Button3.Margin = New System.Windows.Forms.Padding(2)
+ Me.Button3.Name = "Button3"
+ Me.Button3.Size = New System.Drawing.Size(159, 42)
+ Me.Button3.TabIndex = 25
+ Me.Button3.Text = "NCTS an DAKOSY senden -->"
+ Me.Button3.UseVisualStyleBackColor = False
+ '
'Label1
'
Me.Label1.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
@@ -472,55 +568,22 @@ Partial Class usrCntlATLAS_EXGestellung
Me.OptionenToolStripMenuItem.Size = New System.Drawing.Size(69, 20)
Me.OptionenToolStripMenuItem.Text = "Optionen"
'
- 'MyDatagridview1
+ 'Label10
'
- Me.MyDatagridview1.AKTUALISIERUNGS_INTERVALL = -1
- Me.MyDatagridview1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
- Me.MyDatagridview1.Location = New System.Drawing.Point(20, 51)
- Me.MyDatagridview1.Name = "MyDatagridview1"
- Me.MyDatagridview1.Size = New System.Drawing.Size(537, 398)
- Me.MyDatagridview1.TabIndex = 26
- '
- 'cboStammreferenz2
- '
- Me.cboStammreferenz2._allowedValuesFreiText = Nothing
- Me.cboStammreferenz2._allowFreiText = False
- Me.cboStammreferenz2._value = ""
- Me.cboStammreferenz2.BackColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer))
- Me.cboStammreferenz2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
- Me.cboStammreferenz2.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.cboStammreferenz2.FormattingEnabled = True
- Me.cboStammreferenz2.Location = New System.Drawing.Point(113, 22)
- Me.cboStammreferenz2.Name = "cboStammreferenz2"
- Me.cboStammreferenz2.Size = New System.Drawing.Size(271, 21)
- Me.cboStammreferenz2.TabIndex = 27
- '
- 'Label8
- '
- Me.Label8.AutoSize = True
- Me.Label8.Location = New System.Drawing.Point(17, 25)
- Me.Label8.Name = "Label8"
- Me.Label8.Size = New System.Drawing.Size(57, 13)
- Me.Label8.TabIndex = 28
- Me.Label8.Text = "Stammref.:"
- Me.Label8.TextAlign = System.Drawing.ContentAlignment.TopRight
- '
- 'Panel3
- '
- Me.Panel3.BackColor = System.Drawing.Color.WhiteSmoke
- Me.Panel3.Controls.Add(Me.Button3)
- Me.Panel3.Location = New System.Drawing.Point(844, 41)
- Me.Panel3.Name = "Panel3"
- Me.Panel3.Size = New System.Drawing.Size(170, 49)
- Me.Panel3.TabIndex = 27
- Me.Panel3.Visible = False
+ Me.Label10.AutoSize = True
+ Me.Label10.Location = New System.Drawing.Point(18, 153)
+ Me.Label10.Name = "Label10"
+ Me.Label10.Size = New System.Drawing.Size(10, 13)
+ Me.Label10.TabIndex = 31
+ Me.Label10.Text = "-"
+ Me.Label10.TextAlign = System.Drawing.ContentAlignment.TopRight
'
'usrCntlATLAS_EXGestellung
'
Me.Controls.Add(Me.SplitContainer)
Me.Controls.Add(Me.Panel1)
Me.Name = "usrCntlATLAS_EXGestellung"
- Me.Size = New System.Drawing.Size(1014, 658)
+ Me.Size = New System.Drawing.Size(1014, 696)
Me.SplitContainer.Panel1.ResumeLayout(False)
Me.SplitContainer.Panel2.ResumeLayout(False)
Me.SplitContainer.Panel2.PerformLayout()
@@ -530,15 +593,15 @@ Partial Class usrCntlATLAS_EXGestellung
Me.pnl.ResumeLayout(False)
Me.MyPanel1.ResumeLayout(False)
Me.MyPanel1.PerformLayout()
+ CType(Me.MyDatagridview1, System.ComponentModel.ISupportInitialize).EndInit()
Me.MyPanel2.ResumeLayout(False)
Me.MyPanel2.PerformLayout()
+ Me.Panel3.ResumeLayout(False)
Me.cntxtBezugsnr.ResumeLayout(False)
Me.Panel1.ResumeLayout(False)
Me.Panel1.PerformLayout()
Me.MenuStrip.ResumeLayout(False)
Me.MenuStrip.PerformLayout()
- CType(Me.MyDatagridview1, System.ComponentModel.ISupportInitialize).EndInit()
- Me.Panel3.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
@@ -578,4 +641,8 @@ Partial Class usrCntlATLAS_EXGestellung
Friend WithEvents Label8 As Label
Friend WithEvents MyDatagridview1 As VERAG_PROG_ALLGEMEIN.MyDatagridview
Friend WithEvents Panel3 As Panel
+ Friend WithEvents Button4 As Button
+ Friend WithEvents Label9 As Label
+ Friend WithEvents Button5 As Button
+ Friend WithEvents Label10 As Label
End Class
diff --git a/SDL/ZOLLSYSTEM/DAKOSY/ATLAS/EXGestellung/usrCntlATLAS_EXGestellung.vb b/SDL/ZOLLSYSTEM/DAKOSY/ATLAS/EXGestellung/usrCntlATLAS_EXGestellung.vb
index 7fc7fab8..9dba010b 100644
--- a/SDL/ZOLLSYSTEM/DAKOSY/ATLAS/EXGestellung/usrCntlATLAS_EXGestellung.vb
+++ b/SDL/ZOLLSYSTEM/DAKOSY/ATLAS/EXGestellung/usrCntlATLAS_EXGestellung.vb
@@ -1,6 +1,7 @@
Imports System.Data.SqlClient
Imports com.sun.tools.doclets.internal.toolkit.util
Imports DAKOSY_Worker
+Imports TAlex.WPF.Helpers
Public Class usrCntlATLAS_EXGestellung
@@ -35,7 +36,7 @@ Public Class usrCntlATLAS_EXGestellung
Private Sub usrCntlATLAS_Load(sender As Object, e As EventArgs) Handles Me.Load
-
+ Button4.Visible = True
cboDakosyAction.Items.Clear()
cboDakosyAction.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("Neuen Datensatz erstellen", DY_ObjektAktion.OBJ_CREATE))
cboDakosyAction.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("Vohr. DS ändern", DY_ObjektAktion.OBJ_CHANGE))
@@ -176,16 +177,19 @@ Public Class usrCntlATLAS_EXGestellung
If rtbMRN.Text.Trim = "" Then MsgBox("MRN auswählen!") : Me.Cursor = Cursors.Default : Exit Sub
+ delDuplicates() 'Duplikate entfernen
+
Dim exg_list = New List(Of Integer)
Dim dblcheck = ""
'MRN Prüfung:
For Each l In rtbMRN.Lines
+
If l.Trim <> "" Then
- If l.Trim.Length >= 18 And dblcheck.Contains(l.Trim) Then
- MsgBox("Doppelte MRN !: " & l)
- Me.Cursor = Cursors.Default
- Exit Sub
- End If
+ 'If l.Trim.Length >= 18 And dblcheck.Contains(l.Trim) Then
+ ' MsgBox("Doppelte MRN !: " & l)
+ ' Me.Cursor = Cursors.Default
+ ' Exit Sub
+ 'End If
If Not IsValidMRN(l.Trim) Then
MsgBox("Ungültige MRN (Format): " & l)
Me.Cursor = Cursors.Default
@@ -243,6 +247,110 @@ Public Class usrCntlATLAS_EXGestellung
Me.Cursor = Cursors.Default
End Sub
+ Private isFormattingMRN As Boolean = False
+
+ Private Sub rtbMRN_KeyPress(sender As Object, e As KeyPressEventArgs) Handles rtbMRN.KeyPress
+ If e.KeyChar = ChrW(13) OrElse e.KeyChar = ChrW(10) Then
+ e.Handled = True
+ Exit Sub
+ End If
+
+ If Char.IsControl(e.KeyChar) Then Exit Sub
+
+ Dim pos = rtbMRN.SelectionStart
+ Dim lineIndex = rtbMRN.GetLineFromCharIndex(pos)
+ Dim lineStart = rtbMRN.GetFirstCharIndexFromLine(lineIndex)
+
+ If lineStart < 0 Then Exit Sub
+
+ Dim lineLength = pos - lineStart
+
+ If lineLength = 17 AndAlso rtbMRN.SelectionLength = 0 Then
+ e.Handled = True
+ rtbMRN.SelectedText = Char.ToUpperInvariant(e.KeyChar) & vbCrLf
+ rtbMRN.Select(rtbMRN.TextLength, 0)
+ rtbMRN.ScrollToCaret()
+ End If
+ End Sub
+
+ Private Sub rtbMRN_KeyDown(sender As Object, e As KeyEventArgs) Handles rtbMRN.KeyDown
+ If e.KeyCode = Keys.Enter Then
+ e.SuppressKeyPress = True
+ e.Handled = True
+
+ Dim pos = rtbMRN.SelectionStart
+ Dim lineIndex = rtbMRN.GetLineFromCharIndex(pos)
+ Dim lineStart = rtbMRN.GetFirstCharIndexFromLine(lineIndex)
+
+ If lineStart < 0 Then Exit Sub
+
+ Dim lineText = If(lineIndex >= 0 AndAlso lineIndex < rtbMRN.Lines.Length, rtbMRN.Lines(lineIndex), "")
+
+ If String.IsNullOrWhiteSpace(lineText) Then Exit Sub
+ If pos <> lineStart + lineText.Length Then Exit Sub
+
+ ' Keine weitere Zeile, wenn bereits ein Umbruch folgt
+ If pos < rtbMRN.TextLength AndAlso
+ (rtbMRN.Text(pos) = ChrW(13) OrElse rtbMRN.Text(pos) = ChrW(10)) Then Exit Sub
+
+ rtbMRN.SelectedText = vbCrLf
+ rtbMRN.Select(rtbMRN.TextLength, 0)
+ Exit Sub
+ End If
+
+ If e.KeyCode <> Keys.Back OrElse rtbMRN.SelectionLength > 0 Then Exit Sub
+
+ Dim posBack = rtbMRN.SelectionStart
+ If posBack = 0 Then Exit Sub
+
+ Dim lineIndexBack = rtbMRN.GetLineFromCharIndex(posBack)
+ Dim lineStartBack = rtbMRN.GetFirstCharIndexFromLine(lineIndexBack)
+
+ If lineIndexBack > 0 AndAlso posBack = lineStartBack Then
+ e.SuppressKeyPress = True
+
+ Dim prevStart = rtbMRN.GetFirstCharIndexFromLine(lineIndexBack - 1)
+ Dim prevText = rtbMRN.Lines(lineIndexBack - 1)
+
+ If prevText.Length > 0 Then
+ rtbMRN.Select(prevStart + prevText.Length - 1, 1)
+ rtbMRN.SelectedText = ""
+ rtbMRN.SelectionStart = prevStart + prevText.Length - 1
+ End If
+ End If
+ End Sub
+
+ Private Sub rtbMRN_TextChanged(sender As Object, e As EventArgs) Handles rtbMRN.TextChanged
+ If isFormattingMRN Then Exit Sub
+
+ Dim original = rtbMRN.Text
+ Dim pos = rtbMRN.SelectionStart
+ Dim normalized = original.Replace(vbCrLf, vbLf).Replace(vbCr, vbLf)
+ Dim lines = normalized.Split(ControlChars.Lf)
+ Dim resultLines As New List(Of String)
+
+ For Each l In lines
+ If l.Trim() <> "" Then resultLines.Add(l)
+ Next
+
+ Dim result = String.Join(vbCrLf, resultLines)
+
+ ' Eine leere letzte Zeile erlauben
+ If normalized.EndsWith(vbLf) AndAlso result <> "" Then result &= vbCrLf
+
+ If original <> result Then
+ isFormattingMRN = True
+ Try
+ rtbMRN.Text = result
+ rtbMRN.SelectionStart = Math.Min(pos, rtbMRN.TextLength)
+ rtbMRN.SelectionLength = 0
+ Finally
+ isFormattingMRN = False
+ End Try
+ End If
+
+ Label9.Text = "Anzahl: " & resultLines.Count.ToString()
+ End Sub
Function sendEXP_MRN(MRN As String, Zollstelle As String, zeile As String, ByRef exg_list As List(Of Integer), Optional FIRMA_DY_TEMP As String = "") As Boolean
Me.Refresh()
@@ -650,6 +758,238 @@ Public Class usrCntlATLAS_EXGestellung
'Return saveFile
End Function
+ Sub delDuplicates()
+ rtbMRN.Lines = rtbMRN.Lines.
+ Select(Function(l) l.Trim().ToUpperInvariant()).
+ Where(Function(l) l <> "").
+ Distinct().
+ ToArray()
+ End Sub
+ Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
+ delDuplicates()
+ End Sub
+
+ Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
+ Label10.Text = "MRNs werden gelesen..."
+ Label10.Refresh()
+
+ Dim mrns As List(Of cPDFMRNResult) = readEXDataFromPDF()
+
+ If mrns IsNot Nothing AndAlso mrns.Count > 0 Then
+ Dim uniqueMRNs = mrns.Select(Function(x) x.MRN).Distinct().ToList()
+ rtbMRN.Text = String.Join(Environment.NewLine, uniqueMRNs)
+ Label10.Text = $"{uniqueMRNs.Count} MRN erkannt"
+ Else
+ Label10.Text = "Keine MRNs gefunden."
+ End If
+ End Sub
+
+ Private Function readEXDataFromPDF() As List(Of cPDFMRNResult)
+ Dim f As New frmImportFromAVISOAnhaenge(AVISO, SENDUNG)
+ f.ShowDialog(Me)
+ If f.DialogResult <> DialogResult.OK Then Return New List(Of cPDFMRNResult)
+ If f.LIST_FILES Is Nothing OrElse f.LIST_FILES.Count = 0 Then Return New List(Of cPDFMRNResult)
+
+ Cursor.Current = Cursors.WaitCursor
+ Try
+ Return ExtractMRNsFromPDFs(f.LIST_FILES)
+ Finally
+ Cursor.Current = Cursors.Default
+ End Try
+ End Function
+
+
+
+
+
+
+ Public Shared Function ExtractMRNsFromPDFs(files As IEnumerable(Of String)) As List(Of cPDFMRNResult)
+ Dim results As New List(Of cPDFMRNResult)
+
+ For Each pdfPath In files
+ Console.WriteLine("PDF: " & pdfPath)
+ If String.IsNullOrWhiteSpace(pdfPath) OrElse Not System.IO.File.Exists(pdfPath) Then Continue For
+
+ Try
+ Using textPdf = UglyToad.PdfPig.PdfDocument.Open(pdfPath)
+ Dim imagePdf As PdfiumViewer.PdfDocument = Nothing
+
+ Try
+ Console.WriteLine("Seiten: " & textPdf.NumberOfPages)
+
+ For pageIndex As Integer = 0 To textPdf.NumberOfPages - 1
+ Dim found As New HashSet(Of String)(StringComparer.OrdinalIgnoreCase)
+
+ ' 1. Zuerst Text auslesen
+ Try
+ For Each mrn In ExtractMRNsFromPDFText(textPdf, pageIndex)
+ found.Add(mrn)
+ Next
+ Catch ex As Exception
+ Console.WriteLine($"TEXT-FEHLER | Seite={pageIndex + 1} | {ex.Message}")
+ End Try
+
+ ' 2. Nur wenn keine MRN im Text gefunden wurde
+ If found.Count = 0 Then
+ Try
+ If imagePdf Is Nothing Then imagePdf = PdfiumViewer.PdfDocument.Load(pdfPath)
+
+ For Each mrn In ExtractMRNsFromPDFImage(imagePdf, pageIndex)
+ found.Add(mrn)
+ Next
+ Catch ex As Exception
+ Console.WriteLine($"BILD-FEHLER | Seite={pageIndex + 1} | {ex.Message}")
+ End Try
+ End If
+
+ For Each mrn In found
+ results.Add(New cPDFMRNResult With {
+ .FileName = System.IO.Path.GetFileName(pdfPath),
+ .PageNumber = pageIndex + 1,
+ .MRN = mrn
+ })
+ Next
+
+ Console.WriteLine($"SEITE {pageIndex + 1} ENDE | MRNs={found.Count}")
+ Next
+ Finally
+ If imagePdf IsNot Nothing Then imagePdf.Dispose()
+ End Try
+ End Using
+
+ Catch ex As Exception
+ Console.WriteLine("PDF FEHLER: " & ex.ToString())
+ End Try
+ Next
+
+ Console.WriteLine("FERTIG | MRNs gesamt: " & results.Count)
+ Return results
+ End Function
+
+
+ Private Shared Function ExtractMRNsFromPDFText(pdf As UglyToad.PdfPig.PdfDocument, pageIndex As Integer) As List(Of String)
+ Dim results As New HashSet(Of String)(StringComparer.OrdinalIgnoreCase)
+ Dim pageText = pdf.GetPage(pageIndex + 1).Text
+
+ Console.WriteLine($"TEXT | Seite={pageIndex + 1} | Zeichen={pageText.Length}")
+
+ Dim matches = System.Text.RegularExpressions.Regex.Matches(
+ pageText.ToUpperInvariant(),
+ "(? 0 AndAlso rect.Height > 0 Then
+ images.Add(bmp.Clone(rect, System.Drawing.Imaging.PixelFormat.Format24bppRgb))
+ End If
+
+ For imageIndex As Integer = 0 To images.Count - 1
+ Dim currentImage = images(imageIndex)
+ Dim decoded = reader.DecodeMultiple(currentImage)
+
+ If decoded Is Nothing OrElse decoded.Length = 0 Then
+ Dim singleResult = reader.Decode(currentImage)
+ If singleResult IsNot Nothing Then decoded = {singleResult}
+ End If
+
+ If decoded IsNot Nothing Then
+ For Each barcode In decoded
+ Console.WriteLine($"BARCODE | Seite={pageIndex + 1} | Typ={barcode.BarcodeFormat} | Inhalt={barcode.Text}")
+
+ Dim mrn = GetMRNFromBarcode(barcode.Text)
+ If mrn IsNot Nothing Then
+ results.Add(mrn)
+ Console.WriteLine("MRN ERKANNT: " & mrn)
+ End If
+ Next
+ End If
+ Next
+ Finally
+ ' Nur den zusätzlich erzeugten Ausschnitt freigeben
+ For imageIndex As Integer = 1 To images.Count - 1
+ images(imageIndex).Dispose()
+ Next
+ End Try
+ End Using
+ End Using
+
+ Catch ex As Exception
+ Console.WriteLine($"BILD-FEHLER | Seite={pageIndex + 1} | DPI={dpi} | {ex.Message}")
+ End Try
+
+ If results.Count > 0 Then Exit For
+ Next
+
+ Return results.ToList()
+ End Function
+
+
+
+ Private Shared Function GetMRNFromBarcode(value As String) As String
+ If String.IsNullOrWhiteSpace(value) Then Return Nothing
+
+ Dim match = System.Text.RegularExpressions.Regex.Match(
+ value.ToUpperInvariant(),
+ "(?
+
@@ -70,18 +71,21 @@
+
+
+
-
+
-
+
-
+
@@ -97,4 +101,5 @@
+
\ No newline at end of file
diff --git a/VERAG_PROG_ALLGEMEIN/DATENSERVER/cDATENSERVER.vb b/VERAG_PROG_ALLGEMEIN/DATENSERVER/cDATENSERVER.vb
index 84c195ed..189dbe9d 100644
--- a/VERAG_PROG_ALLGEMEIN/DATENSERVER/cDATENSERVER.vb
+++ b/VERAG_PROG_ALLGEMEIN/DATENSERVER/cDATENSERVER.vb
@@ -192,51 +192,80 @@ Public Class cDATENSERVER
Return False
End Function
- Function moveTo_ARCHIVARCHIV()
- Dim oldDIR = DATENVERVER_OPTIONS.getDescPath(rootDir, da_kategorie, da_ordner, da_uOrdner1, da_uOrdner2, da_uOrdner3, da_KundenNr, "", "", True)
+
+ Function moveTo_ARCHIVARCHIV() As Boolean
+ Dim oldDIR = DATENVERVER_OPTIONS.getDescPath(rootDir, da_kategorie, da_ordner, da_uOrdner1, da_uOrdner2, da_uOrdner3, da_KundenNr, "", "", True)
Dim newDIR = DATENVERVER_OPTIONS.getDescPath(rootDirARCHIVARCHIV, da_kategorie, da_ordner, da_uOrdner1, da_uOrdner2, da_uOrdner3, da_KundenNr, "", "", True)
Try
- ' My.Computer.FileSystem.RenameDirectory(oldDIR, newname)
+ Dim hasErrors As Boolean = False
+ Dim oldBase = System.IO.Path.GetFullPath(oldDIR).TrimEnd("\"c) & "\"
+ Dim newBase = System.IO.Path.GetFullPath(newDIR).TrimEnd("\"c) & "\"
+ Dim createdDirectories As New HashSet(Of String)(StringComparer.OrdinalIgnoreCase)
+
For Each li In DATA_LIST.LIST
+ Dim alterPfad As String = li.coll_pfad
-
- Dim newPfad = li.coll_pfad.Replace(oldDIR, newDIR)
- 'MsgBox(li.coll_pfad)
- ' MsgBox(newPfad)
- If Not System.IO.Directory.Exists(newDIR) Then System.IO.Directory.CreateDirectory(newDIR)
Try
- If Not li.coll_pfad.ToLower.StartsWith("\\stor01.verag.ost.dmn\datenarchivarchiv") Then
- If Not li.coll_pfad.Contains("?") Then
- If System.IO.File.Exists(li.coll_pfad) Then
- My.Computer.FileSystem.CopyFile(li.coll_pfad, newPfad, True)
- My.Computer.FileSystem.DeleteFile(li.coll_pfad)
- li.coll_pfad = newPfad
- If Not li.UPDATE() Then
- Return False
- End If
- Else
- 'Datei Existiert nicht!
- li.coll_pfad = li.coll_pfad.Replace("\\datenarchiv.verag.ost.dmn\", "\\DELETED\")
- If Not li.UPDATE() Then
- Return False
- End If
+ If String.IsNullOrWhiteSpace(alterPfad) Then Continue For
+ If alterPfad.StartsWith("\\stor01.verag.ost.dmn\datenarchivarchiv\", StringComparison.OrdinalIgnoreCase) Then Continue For
+ If alterPfad.StartsWith("\\DELETED\", StringComparison.OrdinalIgnoreCase) Then Continue For
+ If alterPfad.Contains("?") Then Continue For
+
+ If System.IO.File.Exists(alterPfad) Then
+ Dim fullPath = System.IO.Path.GetFullPath(alterPfad)
+
+ If Not fullPath.StartsWith(oldBase, StringComparison.OrdinalIgnoreCase) Then
+ Throw New Exception("Datei liegt nicht im Quellverzeichnis: " & alterPfad)
+ End If
+
+ Dim newPfad = newBase & fullPath.Substring(oldBase.Length)
+ Dim zielOrdner = System.IO.Path.GetDirectoryName(newPfad)
+
+ If createdDirectories.Add(zielOrdner) Then
+ System.IO.Directory.CreateDirectory(zielOrdner)
+ End If
+
+ System.IO.File.Copy(alterPfad, newPfad, True)
+
+ li.coll_pfad = newPfad
+
+ If Not li.UPDATE() Then
+ li.coll_pfad = alterPfad
+ Throw New Exception("Datenbankupdate fehlgeschlagen: " & alterPfad)
+ End If
+
+ System.IO.File.Delete(alterPfad)
+ Else
+ li.coll_pfad = alterPfad.Replace("\\datenarchiv.verag.ost.dmn\", "\\DELETED\")
+
+ If li.coll_pfad <> alterPfad Then
+ If Not li.UPDATE() Then
+ li.coll_pfad = alterPfad
+ Throw New Exception("Datenbankupdate fehlgeschlagen: " & alterPfad)
End If
End If
End If
+
Catch ex2 As Exception
- VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex2.Message, li.coll_pfad & vbNewLine & newPfad & vbNewLine & vbNewLine & ex2.Message & vbNewLine & ex2.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
+ hasErrors = True
+ VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex2.Message, alterPfad & vbNewLine & ex2.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
Next
- Return UPDATE()
- Catch ex As Exception
- VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, "Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
+ If hasErrors Then Return False
+
+ Return UPDATE()
+
+ Catch ex As Exception
+ VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
+
Return False
End Function
+
Function UPDATE() As Boolean
Try
'If coll_id < 0 Then 'Wenn noch keine ID vergeben
diff --git a/VERAG_PROG_ALLGEMEIN/Messenger/frmMessenger.Designer.vb b/VERAG_PROG_ALLGEMEIN/Messenger/frmMessenger.Designer.vb
index 01e0a751..ec52704b 100644
--- a/VERAG_PROG_ALLGEMEIN/Messenger/frmMessenger.Designer.vb
+++ b/VERAG_PROG_ALLGEMEIN/Messenger/frmMessenger.Designer.vb
@@ -24,7 +24,6 @@ Partial Class frmMessenger
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
Private Sub InitializeComponent()
- Me.components = New System.ComponentModel.Container()
Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
Dim DataGridViewCellStyle3 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
@@ -39,12 +38,12 @@ Partial Class frmMessenger
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmMessenger))
Me.SplitContainer = New System.Windows.Forms.SplitContainer()
Me.SplitContainer2 = New System.Windows.Forms.SplitContainer()
- Me.dgvChats = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
+ Me.dgvChats = New VERAG_PROG_ALLGEMEIN.MyDatagridview()
Me.Panel6 = New System.Windows.Forms.Panel()
Me.Label3 = New System.Windows.Forms.Label()
Me.lblLKWChat_MsgCntInaktiv = New System.Windows.Forms.Label()
Me.cbxInaktiveChats = New System.Windows.Forms.CheckBox()
- Me.DGVSonstige = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
+ Me.DGVSonstige = New VERAG_PROG_ALLGEMEIN.MyDatagridview()
Me.Panel5 = New System.Windows.Forms.Panel()
Me.MyTextBox2 = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.PictureBox2 = New System.Windows.Forms.PictureBox()
@@ -65,7 +64,7 @@ Partial Class frmMessenger
Me.btnNeu = New System.Windows.Forms.Button()
Me.Button1 = New System.Windows.Forms.Button()
Me.SplitContainer1 = New System.Windows.Forms.SplitContainer()
- Me.MyFlowLayoutPanel1 = New VERAG_PROG_ALLGEMEIN.MyFlowLayoutPanel(Me.components)
+ Me.MyFlowLayoutPanel1 = New VERAG_PROG_ALLGEMEIN.MyFlowLayoutPanel()
Me.UsrCntlMessenger_ChatElement1 = New VERAG_PROG_ALLGEMEIN.usrCntlMessenger_ChatElement()
Me.Panel3 = New System.Windows.Forms.Panel()
Me.btnTeilnehmer = New System.Windows.Forms.Button()
@@ -93,9 +92,9 @@ Partial Class frmMessenger
Me.btnSendAtt = New System.Windows.Forms.Button()
Me.btnSenden = New System.Windows.Forms.Button()
Me.rtbChatMessage = New System.Windows.Forms.RichTextBox()
- Me.TimerNEW_MESSAGE = New System.Windows.Forms.Timer(Me.components)
- Me.Timer_REFRESH = New System.Windows.Forms.Timer(Me.components)
- Me.cntxt = New System.Windows.Forms.ContextMenuStrip(Me.components)
+ Me.TimerNEW_MESSAGE = New System.Windows.Forms.Timer()
+ Me.Timer_REFRESH = New System.Windows.Forms.Timer()
+ Me.cntxt = New System.Windows.Forms.ContextMenuStrip()
Me.ChatDeaktivierenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.toolChatReminder = New System.Windows.Forms.ToolStripMenuItem()
Me.DataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn()