jj: version 2.2.0.6

This commit is contained in:
Jonathan Jenne
2018-11-09 15:28:07 +01:00
parent b8207487cf
commit 627a5cd201
3 changed files with 67 additions and 45 deletions

View File

@@ -94,7 +94,7 @@ Public Class frmMain
Sub AddBarcode(BC As String)
Try
If BC.Contains("'") Then
BC = BC.Replace("'", "|")
BC = BC.Replace("'", "_")
End If
If cmbAuswMandant.SelectedValue = 0 Then
@@ -116,22 +116,30 @@ Public Class frmMain
End Try
End Sub
Private Function AddBarcodeHuP(BC As String)
Private Function AddBarcodeHuP(BarcodeString As String)
Dim separators As New List(Of String) From {"|", "_", "'"}
Try
If BC.Contains("'") Then
BC = BC.Replace("'", "|")
End If
Dim split() = BC.Split("|")
Dim BarcodeArray() As String
For Each separator In separators
If BarcodeString.Contains(separator) Then
BarcodeArray = BarcodeString.Split(separator)
Exit For
End If
Next
Try
_EDV_no = split(0)
_EDV_no = Trim(BarcodeArray(0))
Catch ex As Exception
_EDV_no = ""
End Try
Try
_LS_no = RTrim(LTrim(split(1)))
_LS_no = Trim(BarcodeArray(1))
Catch ex As Exception
_LS_no = ""
End Try
If _EDV_no <> String.Empty And _LS_no <> String.Empty Then
Dim sql = String.Format("SELECT * FROM VKKOPF WHERE GUID = (SELECT MAX(GUID) FROM VKKOPF WHERE vkkopf_bestellnr = '{0}')", _EDV_no)
Dim DT_ROW As DataTable = ClassDatabase.Return_Datatable_CS(sql, My.Settings.ConfigConnStringMercator)
@@ -192,42 +200,42 @@ Public Class frmMain
End If
Dim Upd = String.Format("UPDATE TBKOMMCOLLI_SENDUNGEN SET KUNDEN_ID = '{0}',NAME1 = '{1}',NAME2 = '{2}',STRASSE = '{3}',LKZ = '{4}',PLZ = '{5}',ORT = '{6}' WHERE GUID = {7}", MERC_KDNR, MERC_LIEFADR1, MERC_LIEFADR2, MERC_LIEFSTR, MERC_LIEFLAND, MERC_LIEFPLZ, MERC_LIEFORT, CURRENT_SENDUNG)
If ClassDatabase.Execute_non_Query(Upd, True) = True Then
Dim exists = String.Format("SELECT COUNT(*) FROM TBKOMMCOLLI_SDG_LHM WHERE SENDUNGNR = {0} AND FERTIG = 0", CURRENT_SENDUNG)
Dim LHM_exists As Boolean = False
If ClassDatabase.Execute_Scalar(exists, True) >= 1 Then
LHM_exists = True
End If
If LHM_exists = False Then
Dim ins = String.Format("INSERT INTO TBKOMMCOLLI_SDG_LHM (SENDUNGNR,LHM_ID,ERSTELLTWER) VALUES ({0},{1},'{2}')", CURRENT_SENDUNG, aktLHM_ID, Environment.UserName)
If ClassDatabase.Execute_non_Query(ins, True) = True Then
If ClassDatabase.Execute_non_Query(Upd, True) = True Then
Dim exists = String.Format("SELECT COUNT(*) FROM TBKOMMCOLLI_SDG_LHM WHERE SENDUNGNR = {0} AND FERTIG = 0", CURRENT_SENDUNG)
Dim LHM_exists As Boolean = False
If ClassDatabase.Execute_Scalar(exists, True) >= 1 Then
LHM_exists = True
End If
If LHM_exists = False Then
Dim ins = String.Format("INSERT INTO TBKOMMCOLLI_SDG_LHM (SENDUNGNR,LHM_ID,ERSTELLTWER) VALUES ({0},{1},'{2}')", CURRENT_SENDUNG, aktLHM_ID, Environment.UserName)
If ClassDatabase.Execute_non_Query(ins, True) = True Then
End If
End If
aktLHM_SDG_ID = ClassDatabase.Execute_Scalar("SELECT MAX(GUID) FROM TBKOMMCOLLI_SDG_LHM WHERE FERTIG = 0", True)
If aktLHM_SDG_ID > 0 Then
btnPalfertig.Text = "Palette (" & aktLHM_SDG_ID.ToString & ", " & cmbLHM.Text & ") fertig"
MERC_GEWICHT = MERC_GEWICHT.ToString.Replace(",", ".")
Dim ins = String.Format("INSERT INTO TBKOMMCOLLI_SDGPOSITIONEN (SENDUNGNR,SDG_LHM_ID,GEWICHT,ERSTELLTWER) VALUES ({0},{1},{2},'{3}')", CURRENT_SENDUNG, aktLHM_SDG_ID, MERC_GEWICHT, Environment.UserName)
If ClassDatabase.Execute_non_Query(ins, True) = True Then
'cmbLHM.Enabled = False
Refresh_POS(CURRENT_SENDUNG)
End If
End If
If txtFreitext.Text <> "" Then
Upd = String.Format("UPDATE TBKOMMCOLLI_SENDUNGEN SET BEMERKUNG = '{0}' WHERE GUID = {1}", txtFreitext.Text & ", " & _LS_no, CURRENT_SENDUNG)
Else
Upd = String.Format("UPDATE TBKOMMCOLLI_SENDUNGEN SET BEMERKUNG = '{0}' WHERE GUID = {1}", _LS_no, CURRENT_SENDUNG)
End If
If ClassDatabase.Execute_non_Query(Upd, True) = True Then
txtFreitext.Text = ClassDatabase.Execute_Scalar("SELECT BEMERKUNG FROM TBKOMMCOLLI_SENDUNGEN WHERE GUID = " & CURRENT_SENDUNG, True)
End If
End If
End If
aktLHM_SDG_ID = ClassDatabase.Execute_Scalar("SELECT MAX(GUID) FROM TBKOMMCOLLI_SDG_LHM WHERE FERTIG = 0", True)
If aktLHM_SDG_ID > 0 Then
btnPalfertig.Text = "Palette (" & aktLHM_SDG_ID.ToString & ", " & cmbLHM.Text & ") fertig"
MERC_GEWICHT = MERC_GEWICHT.ToString.Replace(",", ".")
Dim ins = String.Format("INSERT INTO TBKOMMCOLLI_SDGPOSITIONEN (SENDUNGNR,SDG_LHM_ID,GEWICHT,ERSTELLTWER) VALUES ({0},{1},{2},'{3}')", CURRENT_SENDUNG, aktLHM_SDG_ID, MERC_GEWICHT, Environment.UserName)
If ClassDatabase.Execute_non_Query(ins, True) = True Then
'cmbLHM.Enabled = False
Refresh_POS(CURRENT_SENDUNG)
End If
End If
deactivate_Error()
If txtFreitext.Text <> "" Then
Upd = String.Format("UPDATE TBKOMMCOLLI_SENDUNGEN SET BEMERKUNG = '{0}' WHERE GUID = {1}", txtFreitext.Text & ", " & _LS_no, CURRENT_SENDUNG)
Else
Upd = String.Format("UPDATE TBKOMMCOLLI_SENDUNGEN SET BEMERKUNG = '{0}' WHERE GUID = {1}", _LS_no, CURRENT_SENDUNG)
End If
If ClassDatabase.Execute_non_Query(Upd, True) = True Then
txtFreitext.Text = ClassDatabase.Execute_Scalar("SELECT BEMERKUNG FROM TBKOMMCOLLI_SENDUNGEN WHERE GUID = " & CURRENT_SENDUNG, True)
End If
End If
End If
deactivate_Error()
Catch ex As Exception
If ex.Message.Contains("UNIQ_BARCODE_PER_POS") Then