Lettura messaggi di errore da ZebraPribterUtilities
This commit is contained in:
+1
-1
@@ -87,7 +87,7 @@
|
||||
FontSize="32"/>
|
||||
<Button Name="ConfirmBtn" Grid.Row="5" Style="{DynamicResource OmagCut_BlueTextButton}"
|
||||
FontSize="32"/>
|
||||
<Border Name="OutMessageBrd" Grid.Row="6" >
|
||||
<Border Name="OutMessageBrd" Grid.Row="6">
|
||||
<TextBlock Name="OutMessageTxBl" TextAlignment="Center"
|
||||
Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
</Border>
|
||||
|
||||
+46
-1
@@ -579,7 +579,7 @@ Class MainWindow
|
||||
|
||||
End Sub
|
||||
|
||||
' Funzione per stampa delle etichette
|
||||
' Funzione per stampa delle etichette con ZebraPrinter
|
||||
Private Sub LabelBtn_Click(sender As Object, e As RoutedEventArgs) Handles LabelBtn.Click
|
||||
Dim FileName As String = DateTime.Now.ToString()
|
||||
FileName = FileName.Replace("/"c, "_")
|
||||
@@ -602,6 +602,9 @@ Class MainWindow
|
||||
' passo al pezzo successivo
|
||||
nParentId = EgtGetNextSelectedObj()
|
||||
End While
|
||||
' attendo che sia generato il file
|
||||
Thread.Sleep(10)
|
||||
ReadFileErrorPrinter()
|
||||
End Sub
|
||||
|
||||
' creazione file ini dei dati pezzo per stampa etichetta
|
||||
@@ -647,6 +650,48 @@ Class MainWindow
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub ReadFileErrorPrinter()
|
||||
Dim sErrorMsg As String = String.Empty
|
||||
Dim sPathFileError As String = m_sDataRoot & "\Temp\" & "Error.txt"
|
||||
' provo a recuperare il mesaggio di errore
|
||||
If File.Exists(sPathFileError) Then
|
||||
Dim sAllLines As String() = File.ReadAllLines(sPathFileError)
|
||||
' verifico che ci sia almeno una riga nel file degli errori
|
||||
If sAllLines.Count > 0 Then
|
||||
' verifico che la prima riga non sia vuota
|
||||
Dim Index As Integer = 0
|
||||
While String.IsNullOrEmpty(sAllLines(Index))
|
||||
Index += 1
|
||||
If Index > sAllLines.Count Then
|
||||
EgtOutLog("Il messaggio di errore della stampante non è comprensibile: " & sAllLines(Index))
|
||||
Return
|
||||
End If
|
||||
End While
|
||||
Dim sItems As String() = sAllLines(Index).Split("=")
|
||||
'verifico che sia avvenuto lo split
|
||||
If sItems.Count > 1 Then
|
||||
' verifico che il termine dopo il segno di uguale sia un numero
|
||||
Dim nErrorIndex As Integer = -1
|
||||
Try
|
||||
nErrorIndex = CInt(sItems(1))
|
||||
' se nErrorIndex=0 significa che non ci sono errori
|
||||
If nErrorIndex < 1 Then
|
||||
Return
|
||||
End If
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Il messaggio di errore della stampante non è comprensibile: " & sAllLines(Index))
|
||||
Return
|
||||
End Try
|
||||
sErrorMsg = EgtMsg(nErrorIndex + 91460)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
' eventualmente stampo il messaggio
|
||||
If Not String.IsNullOrEmpty(sErrorMsg) Then
|
||||
SetErrorMessage(sErrorMsg)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' cerco se esiste la definizione del "*TOP*" del pezzo
|
||||
Private Function GetTopInfoPart(nPartId As Integer) As Boolean
|
||||
Dim nRegion As Integer = EgtGetFirstNameInGroup(nPartId, NAME_REGION)
|
||||
|
||||
Reference in New Issue
Block a user