Stampa etichetta pezzo selezionato
This commit is contained in:
+43
-1
@@ -1,4 +1,5 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib
|
||||
Imports System.ComponentModel
|
||||
@@ -222,7 +223,7 @@ Class MainWindow
|
||||
LabelBtn.Content = EgtMsg(91304) 'Stampa Etichetta
|
||||
ConfirmBtn.Content = EgtMsg(91305) 'Conferma
|
||||
' Abilitazione stampa etichetta
|
||||
LabelBtn.IsEnabled = False
|
||||
LabelBtn.IsEnabled = True
|
||||
' Visualizzazione bottoni Prev/Next
|
||||
If GetPrivateProfileInt(S_GENERAL, K_PREVNEXTPROJ, 0, m_sIniFile) = 0 Then
|
||||
PrevNextGrid.Visibility = Windows.Visibility.Hidden
|
||||
@@ -563,6 +564,47 @@ Class MainWindow
|
||||
|
||||
End Sub
|
||||
|
||||
' Funzione per stampa delle etichette
|
||||
Private Sub LabelBtn_Click(sender As Object, e As RoutedEventArgs) Handles LabelBtn.Click
|
||||
Dim sFileIni As String = "c:\Users\nicola.pievani\Desktop\Test2.ini"
|
||||
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||
' recupero il part
|
||||
nId = EgtGetParent(nId)
|
||||
While nId <> GDB_ID.NULL
|
||||
CreateFileData(nId, sFileIni)
|
||||
Dim nNextId As Integer = EgtGetNextSelectedObj()
|
||||
nId = EgtGetParent(nNextId)
|
||||
End While
|
||||
Dim ProcsPrint As Process() = Process.GetProcessesByName("c:\EgtProg\OmagPHOTO\ZebraPrinterUtilitiesR32.exe")
|
||||
Process.Start("c:\EgtProg\OmagPHOTO\ZebraPrinterUtilitiesR32.exe", "c:\Users\nicola.pievani\Desktop\Test4.prn " & sFileIni)
|
||||
End Sub
|
||||
|
||||
' creazione file ini dei dati pezzo per stampa etichetta
|
||||
Private Sub CreateFileData(nPartId As Integer, sFilePath As String)
|
||||
Dim FileText As New List(Of String)
|
||||
FileText.Add("[Main]")
|
||||
' Recupero materiale
|
||||
Dim sMaterial As String = String.Empty
|
||||
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_PROJMAT, sMaterial)
|
||||
FileText.Add("Var1=$ProjMat$," & sMaterial)
|
||||
' Recupero path originale di carico
|
||||
Dim sCutPath As String = String.Empty
|
||||
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_LOADPATH, sCutPath)
|
||||
FileText.Add("Var2=$LoadPath$," & sCutPath)
|
||||
' recupero il nome della componente
|
||||
Dim sName As String = String.Empty
|
||||
EgtGetInfo(nPartId, INFO_CSV_PART, sName)
|
||||
FileText.Add("Var3=$CsvPart$," & sName)
|
||||
Dim sCompo As String = String.Empty
|
||||
EgtGetInfo(nPartId, "CMP", sCompo)
|
||||
FileText.Add("Var4=$CMP$," & sCompo)
|
||||
Try
|
||||
File.WriteAllLines(sFilePath, FileText)
|
||||
Catch ex As Exception
|
||||
EgtOutLog(ex.ToString)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateBtns()
|
||||
' Per bottoni precedente e successivo progetto
|
||||
UpdatePrevNextBtns()
|
||||
|
||||
Reference in New Issue
Block a user