diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb index 38dbce1..66a0a6a 100644 --- a/Constants/ConstIni.vb +++ b/Constants/ConstIni.vb @@ -86,9 +86,10 @@ Module ConstIni Public Const K_TEMPLATEDIR As String = "TemplateDirectory" Public Const K_MACHINDIR As String = "MachinDirectory" - Public Const S_LISTLABEL As String = "ListLabel" - Public Const K_LISTLABELDIR As String = "ListLabelDirectory" - Public Const K_LISTLABELFILE As String = "ListLabelCurrent" + Public Const S_REPORT As String = "Report" + Public Const K_REPORTDIR As String = "ReportDirectory" + Public Const K_REPORTFILE As String = "ReportCurrent" + Public Const K_ENABLEREPORTBROWSE As String = "EnableBrowse" Public Const S_LAUNCHERWINDOW As String = "LauncherWindow" Public Const K_LAUNCHER As String = "Launcher" diff --git a/DdfFile.vb b/DdfFile.vb index 54ab63d..025d181 100644 --- a/DdfFile.vb +++ b/DdfFile.vb @@ -39,6 +39,7 @@ Friend Module DdfFile ReportDoor.OtherInfo.Clear() ReportDoor.HardwareList.Clear() ReportDoor.MachList.Clear() + ReportDoor.AttachmentsList.Clear() ' definsco la componente porta (devo decidere come asseganre il Brand e il Template) Dim CompoDoorReport As New ReportCompo("DOOR", "", Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName) @@ -287,8 +288,8 @@ Friend Module DdfFile If Not IsNothing(Part.SelectedMaterial) AndAlso Part.SelectedMaterial.NameDDF <> GENERICMATERIAL Then DdfFileContent.Add("" & ConstCompo.S_MATERIAL & ": " & Part.SelectedMaterial.NameDDF) ' 50710=Material - CompoDoorReport.CompoParameterList.Add(New ReportParameter(EgtMsg(50710), Part.SelectedMaterial.NameDDF)) - TOtherInfo.OtherInfo_ParametersList.Add(New ReportParameter(EgtMsg(50710), Part.SelectedMaterial.NameDDF)) + CompoDoorReport.CompoParameterList.Add(New ReportParameter(EgtMsg(50710), Part.SelectedMaterial.Name)) + TOtherInfo.OtherInfo_ParametersList.Add(New ReportParameter(EgtMsg(50710), Part.SelectedMaterial.Name)) DdfFileContent.Add("") End If '' scrittura utilizzata per la multi selezione diff --git a/OptionsWindow/OptionModule.vb b/OptionsWindow/OptionModule.vb index 7c04582..e3f7a78 100644 --- a/OptionsWindow/OptionModule.vb +++ b/OptionsWindow/OptionModule.vb @@ -39,6 +39,8 @@ Friend Module OptionModule Friend m_VisibilityBtnDesign As Visibility = Visibility.Collapsed + Friend m_EnableBrowse As Boolean = False + Friend Enum LauncherOpt As Integer Open_window = 0 Open_last_project = 1 @@ -237,7 +239,7 @@ Friend Module OptionModule End If Dim sListLabelDir As String = String.Empty - If GetMainPrivateProfileString(S_LISTLABEL, K_LISTLABELDIR, "", sListLabelDir) > 0 AndAlso Directory.Exists(sListLabelDir) Then + If GetMainPrivateProfileString(S_REPORT, K_REPORTDIR, "", sListLabelDir) > 0 AndAlso Directory.Exists(sListLabelDir) Then IniFile.m_sListLabelDir = sListLabelDir Else ' mantengo l'accesso a quello di default @@ -245,7 +247,7 @@ Friend Module OptionModule End If Dim sListLabelFile As String = String.Empty - If GetMainPrivateProfileString(S_LISTLABEL, K_LISTLABELFILE, "", sListLabelFile) > 0 AndAlso File.Exists(sListLabelFile) Then + If GetMainPrivateProfileString(S_REPORT, K_REPORTFILE, "", sListLabelFile) > 0 AndAlso File.Exists(sListLabelFile) Then IniFile.m_sListLabelCurrent = sListLabelFile Else ' mantengo l'accesso a quello di default @@ -281,6 +283,8 @@ Friend Module OptionModule m_VisibilityBtnDesign = If(GetMainPrivateProfileInt(S_GENERAL, K_ENABLEBTNDESING, 0) = 1, Visibility.Visible, Visibility.Hidden) + m_EnableBrowse = If(GetMainPrivateProfileInt(S_REPORT, K_ENABLEREPORTBROWSE, 0) = 1, True, False) + ' leggo il tipo di Bevel selezionato DefaultGetPrivateProfilesBevel(S_EDGE, K_BEVELU_INI, m_bBevelUp) DefaultGetPrivateProfilesBevel(S_EDGE, K_BEVELD_INI, m_bBevelDown) diff --git a/Print/PrintWndVM.vb b/Print/PrintWndVM.vb index 3caffd5..a151fe1 100644 --- a/Print/PrintWndVM.vb +++ b/Print/PrintWndVM.vb @@ -121,11 +121,12 @@ Public Class PrintWndVM Return End If EgtSetLineAttribs(1) - DdfFile.OrderInReport.Image = sPath DdfFile.ReportDoor.Order(0).Image = sPath + '' aggiungo file pdf da allegare + 'Dim FilePDF As New ReportAttachments("c:\Users\Nicola\Desktop\EdgePull4.pdf") + 'DdfFile.ReportDoor.AttachmentsList.Add(FilePDF) sPathImage = sPath - Try MyLL.DataBindingMode = DataBindingMode.Preload 'Dim Order As New List(Of ReportOrder) @@ -140,12 +141,12 @@ Public Class PrintWndVM End If ' permette di visualizzare una prestampa MyLL.AutoDestination = LlPrintMode.PreviewControl - 'MyLL.AutoShowSelectFile = False + MyLL.AutoShowSelectFile = OptionModule.m_EnableBrowse MyLL.AutoShowPrintOptions = False MyLL.AutoProjectType = LlProject.List Or LlProject.FileAlsoNew MyLL.Print() IniFile.m_sListLabelCurrent = MyLL.LastProjectFile - WriteMainPrivateProfileString(S_LISTLABEL, K_LISTLABELFILE, IniFile.m_sListLabelCurrent) + WriteMainPrivateProfileString(S_REPORT, K_REPORTFILE, IniFile.m_sListLabelCurrent) Catch generatedExceptionName As LL_User_Aborted_Exception Catch LlException As ListLabelException MessageBox.Show("Information: " + LlException.Message + vbLf & vbLf & "This information was generated by a List & Label custom exception.", "Information", MessageBoxButton.OK, MessageBoxImage.Information) @@ -171,10 +172,14 @@ Public Class PrintWndVM Dim Order As New List(Of TableDoor) Order.Add(DdfFile.ReportDoor) MyLL.SetDataBinding(Order, String.Empty) - MyLL.AutoProjectFile = "C:\Users\Nicola\Documents\Report Files\MyOrder.lst" + If String.IsNullOrEmpty(IniFile.m_sListLabelCurrent) Then + MyLL.AutoProjectFile = IniFile.m_sListLabelDir + "\MyOrder.lst" + Else + MyLL.AutoProjectFile = IniFile.m_sListLabelCurrent + End If ' permette di visualizzare una prestampa MyLL.AutoDestination = LlPrintMode.PreviewControl - MyLL.AutoShowPrintOptions = False + MyLL.AutoShowPrintOptions = OptionModule.m_EnableBrowse MyLL.AutoProjectType = LlProject.List Or LlProject.FileAlsoNew MyLL.Design() Catch generatedExceptionName As LL_User_Aborted_Exception diff --git a/ReportInfo/ReportCompo.vb b/ReportInfo/ReportCompo.vb index b8f91fb..b4118a7 100644 --- a/ReportInfo/ReportCompo.vb +++ b/ReportInfo/ReportCompo.vb @@ -76,6 +76,7 @@ Public Class TableDoor Public Property OtherInfo As New List(Of TableOtherInfo) Public Property HardwareList As New List(Of TableHardaware) Public Property MachList As New List(Of TableMach) + Public Property AttachmentsList As New List(Of ReportAttachments) End Class @@ -268,26 +269,44 @@ Public Class ReportParameter Public Sub New(Name__1 As String, Value__2 As String) m_Name = Name__1 m_sValue = Value__2 - End Sub - + End Sub + Private m_Name As String Public Property Name As String - Get + Get Return m_Name End Get Set(value As String) m_Name = value End Set - End Property + End Property Private m_sValue As String Public Property sValue As String - Get + Get Return m_sValue End Get Set(value As String) m_sValue = value End Set - End Property + End Property + +End Class + +Public Class ReportAttachments + + Private m_PDFFile As String + Public Property PDFFile As String + Get + Return m_PDFFile + End Get + Set(value As String) + m_PDFFile = value + End Set + End Property + + Sub New(sPDFPath As String) + m_PDFFile = sPDFPath + End Sub End Class \ No newline at end of file