You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
772 lines
28 KiB
772 lines
28 KiB
Imports System.Data
|
|
Imports System.Data.SqlTypes
|
|
Imports System.Data.SqlClient
|
|
Imports System.ComponentModel
|
|
Imports UtilityLibrary.Win32
|
|
|
|
Public Class frmcoldviewer
|
|
Inherits System.Windows.Forms.Form
|
|
|
|
#Region " Vom Windows Form Designer generierter Code "
|
|
|
|
Public Sub New()
|
|
MyBase.New()
|
|
|
|
' Dieser Aufruf ist für den Windows Form-Designer erforderlich.
|
|
InitializeComponent()
|
|
|
|
' Initialisierungen nach dem Aufruf InitializeComponent() hinzufügen
|
|
|
|
End Sub
|
|
|
|
' Die Form überschreibt den Löschvorgang der Basisklasse, um Komponenten zu bereinigen.
|
|
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
|
|
If disposing Then
|
|
If Not (components Is Nothing) Then
|
|
components.Dispose()
|
|
End If
|
|
End If
|
|
MyBase.Dispose(disposing)
|
|
End Sub
|
|
|
|
' Für Windows Form-Designer erforderlich
|
|
Private components As System.ComponentModel.IContainer
|
|
|
|
'HINWEIS: Die folgende Prozedur ist für den Windows Form-Designer erforderlich
|
|
'Sie kann mit dem Windows Form-Designer modifiziert werden.
|
|
'Verwenden Sie nicht den Code-Editor zur Bearbeitung.
|
|
Friend WithEvents ToolBar1 As System.Windows.Forms.ToolBar
|
|
Friend WithEvents ToolBtnExit As System.Windows.Forms.ToolBarButton
|
|
Friend WithEvents ImageList1 As System.Windows.Forms.ImageList
|
|
Friend WithEvents ToolBarButton1 As System.Windows.Forms.ToolBarButton
|
|
Friend WithEvents ToolBarButton2 As System.Windows.Forms.ToolBarButton
|
|
Friend WithEvents ToolBarButton3 As System.Windows.Forms.ToolBarButton
|
|
Friend WithEvents PrintDocument1 As System.Drawing.Printing.PrintDocument
|
|
Friend WithEvents ToolBarButton4 As System.Windows.Forms.ToolBarButton
|
|
Friend WithEvents ToolBarButton5 As System.Windows.Forms.ToolBarButton
|
|
Friend WithEvents NoteLabel As System.Windows.Forms.Label
|
|
Friend WithEvents ToolBarButton6 As System.Windows.Forms.ToolBarButton
|
|
Friend WithEvents ToolBarButton7 As System.Windows.Forms.ToolBarButton
|
|
Friend WithEvents ToolBarButton8 As System.Windows.Forms.ToolBarButton
|
|
Friend WithEvents ToolBarButton9 As System.Windows.Forms.ToolBarButton
|
|
Friend WithEvents ToolBarButton10 As System.Windows.Forms.ToolBarButton
|
|
Friend WithEvents ToolBarButton11 As System.Windows.Forms.ToolBarButton
|
|
Friend WithEvents ToolBarButton12 As System.Windows.Forms.ToolBarButton
|
|
Friend WithEvents Panel1 As System.Windows.Forms.Panel
|
|
Friend WithEvents OnDemand As AxARSOLELib.AxArsOle
|
|
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
|
|
Me.components = New System.ComponentModel.Container()
|
|
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmcoldviewer))
|
|
Me.ToolBar1 = New System.Windows.Forms.ToolBar()
|
|
Me.ToolBtnExit = New System.Windows.Forms.ToolBarButton()
|
|
Me.ToolBarButton1 = New System.Windows.Forms.ToolBarButton()
|
|
Me.ToolBarButton2 = New System.Windows.Forms.ToolBarButton()
|
|
Me.ToolBarButton3 = New System.Windows.Forms.ToolBarButton()
|
|
Me.ToolBarButton4 = New System.Windows.Forms.ToolBarButton()
|
|
Me.ToolBarButton5 = New System.Windows.Forms.ToolBarButton()
|
|
Me.ToolBarButton6 = New System.Windows.Forms.ToolBarButton()
|
|
Me.ToolBarButton7 = New System.Windows.Forms.ToolBarButton()
|
|
Me.ToolBarButton8 = New System.Windows.Forms.ToolBarButton()
|
|
Me.ToolBarButton9 = New System.Windows.Forms.ToolBarButton()
|
|
Me.ToolBarButton10 = New System.Windows.Forms.ToolBarButton()
|
|
Me.ToolBarButton11 = New System.Windows.Forms.ToolBarButton()
|
|
Me.ToolBarButton12 = New System.Windows.Forms.ToolBarButton()
|
|
Me.ImageList1 = New System.Windows.Forms.ImageList(Me.components)
|
|
Me.PrintDocument1 = New System.Drawing.Printing.PrintDocument()
|
|
Me.NoteLabel = New System.Windows.Forms.Label()
|
|
Me.Panel1 = New System.Windows.Forms.Panel()
|
|
Me.OnDemand = New AxARSOLELib.AxArsOle()
|
|
Me.Panel1.SuspendLayout()
|
|
CType(Me.OnDemand, System.ComponentModel.ISupportInitialize).BeginInit()
|
|
Me.SuspendLayout()
|
|
'
|
|
'ToolBar1
|
|
'
|
|
Me.ToolBar1.Buttons.AddRange(New System.Windows.Forms.ToolBarButton() {Me.ToolBtnExit, Me.ToolBarButton1, Me.ToolBarButton2, Me.ToolBarButton3, Me.ToolBarButton4, Me.ToolBarButton5, Me.ToolBarButton6, Me.ToolBarButton7, Me.ToolBarButton8, Me.ToolBarButton9, Me.ToolBarButton10, Me.ToolBarButton11, Me.ToolBarButton12})
|
|
Me.ToolBar1.DropDownArrows = True
|
|
Me.ToolBar1.ImageList = Me.ImageList1
|
|
Me.ToolBar1.Name = "ToolBar1"
|
|
Me.ToolBar1.ShowToolTips = True
|
|
Me.ToolBar1.Size = New System.Drawing.Size(824, 25)
|
|
Me.ToolBar1.TabIndex = 0
|
|
'
|
|
'ToolBtnExit
|
|
'
|
|
Me.ToolBtnExit.ImageIndex = 0
|
|
Me.ToolBtnExit.ToolTipText = "Fenster schliessen"
|
|
'
|
|
'ToolBarButton1
|
|
'
|
|
Me.ToolBarButton1.ImageIndex = 1
|
|
Me.ToolBarButton1.ToolTipText = "Dokument drucken"
|
|
'
|
|
'ToolBarButton2
|
|
'
|
|
Me.ToolBarButton2.ImageIndex = 9
|
|
Me.ToolBarButton2.ToolTipText = "Vorherige Seite"
|
|
'
|
|
'ToolBarButton3
|
|
'
|
|
Me.ToolBarButton3.ImageIndex = 10
|
|
Me.ToolBarButton3.ToolTipText = "Nächste Seite"
|
|
'
|
|
'ToolBarButton4
|
|
'
|
|
Me.ToolBarButton4.ImageIndex = 5
|
|
Me.ToolBarButton4.ToolTipText = "Ansicht verkleinern"
|
|
'
|
|
'ToolBarButton5
|
|
'
|
|
Me.ToolBarButton5.ImageIndex = 4
|
|
Me.ToolBarButton5.ToolTipText = "Ansicht vergrössern"
|
|
'
|
|
'ToolBarButton6
|
|
'
|
|
Me.ToolBarButton6.ImageIndex = 6
|
|
Me.ToolBarButton6.Style = System.Windows.Forms.ToolBarButtonStyle.Separator
|
|
'
|
|
'ToolBarButton7
|
|
'
|
|
Me.ToolBarButton7.ImageIndex = 6
|
|
Me.ToolBarButton7.Visible = False
|
|
'
|
|
'ToolBarButton8
|
|
'
|
|
Me.ToolBarButton8.ImageIndex = 6
|
|
Me.ToolBarButton8.Visible = False
|
|
'
|
|
'ToolBarButton9
|
|
'
|
|
Me.ToolBarButton9.Style = System.Windows.Forms.ToolBarButtonStyle.Separator
|
|
'
|
|
'ToolBarButton10
|
|
'
|
|
Me.ToolBarButton10.ImageIndex = 8
|
|
Me.ToolBarButton10.ToolTipText = "Vorheriges Dokument"
|
|
'
|
|
'ToolBarButton11
|
|
'
|
|
Me.ToolBarButton11.ImageIndex = 7
|
|
Me.ToolBarButton11.ToolTipText = "Nächstes Dokument"
|
|
'
|
|
'ToolBarButton12
|
|
'
|
|
Me.ToolBarButton12.ImageIndex = 11
|
|
Me.ToolBarButton12.ToolTipText = "Dokument mit COLD-Viewer anzeigen"
|
|
'
|
|
'ImageList1
|
|
'
|
|
Me.ImageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit
|
|
Me.ImageList1.ImageSize = New System.Drawing.Size(16, 16)
|
|
Me.ImageList1.ImageStream = CType(resources.GetObject("ImageList1.ImageStream"), System.Windows.Forms.ImageListStreamer)
|
|
Me.ImageList1.TransparentColor = System.Drawing.Color.Transparent
|
|
'
|
|
'NoteLabel
|
|
'
|
|
Me.NoteLabel.Location = New System.Drawing.Point(232, 8)
|
|
Me.NoteLabel.Name = "NoteLabel"
|
|
Me.NoteLabel.Size = New System.Drawing.Size(216, 16)
|
|
Me.NoteLabel.TabIndex = 3
|
|
Me.NoteLabel.Text = "Dokument 1 von 1"
|
|
'
|
|
'Panel1
|
|
'
|
|
Me.Panel1.Controls.AddRange(New System.Windows.Forms.Control() {Me.OnDemand})
|
|
Me.Panel1.Dock = System.Windows.Forms.DockStyle.Fill
|
|
Me.Panel1.Location = New System.Drawing.Point(0, 25)
|
|
Me.Panel1.Name = "Panel1"
|
|
Me.Panel1.Size = New System.Drawing.Size(824, 524)
|
|
Me.Panel1.TabIndex = 4
|
|
'
|
|
'OnDemand
|
|
'
|
|
Me.OnDemand.ContainingControl = Me
|
|
Me.OnDemand.Dock = System.Windows.Forms.DockStyle.Fill
|
|
Me.OnDemand.Enabled = True
|
|
Me.OnDemand.Name = "OnDemand"
|
|
Me.OnDemand.OcxState = CType(resources.GetObject("OnDemand.OcxState"), System.Windows.Forms.AxHost.State)
|
|
Me.OnDemand.Size = New System.Drawing.Size(824, 524)
|
|
Me.OnDemand.TabIndex = 1
|
|
'
|
|
'frmcoldviewer
|
|
'
|
|
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
|
|
Me.AutoScroll = True
|
|
Me.AutoScrollMargin = New System.Drawing.Size(100, 0)
|
|
Me.AutoScrollMinSize = New System.Drawing.Size(100, 100)
|
|
Me.ClientSize = New System.Drawing.Size(824, 549)
|
|
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Panel1, Me.NoteLabel, Me.ToolBar1})
|
|
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
|
|
Me.Name = "frmcoldviewer"
|
|
Me.ShowInTaskbar = False
|
|
Me.Text = "Edoka-Cold-Dokumentviewer"
|
|
Me.TransparencyKey = System.Drawing.Color.White
|
|
Me.Panel1.ResumeLayout(False)
|
|
CType(Me.OnDemand, System.ComponentModel.ISupportInitialize).EndInit()
|
|
Me.ResumeLayout(False)
|
|
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
#Region "Deklarationen"
|
|
Dim m_scolddokumentid As String
|
|
Property Colddokumentid() As String
|
|
Get
|
|
Return m_scolddokumentid
|
|
End Get
|
|
Set(ByVal Value As String)
|
|
m_scolddokumentid = Value
|
|
End Set
|
|
End Property
|
|
Dim m_dokumentid As String
|
|
Property DokumentId() As String
|
|
Get
|
|
Return m_dokumentid
|
|
End Get
|
|
Set(ByVal Value As String)
|
|
m_dokumentid = Value
|
|
End Set
|
|
End Property
|
|
|
|
Dim m_partnernr As String
|
|
Property PartnerNr() As String
|
|
Get
|
|
Return m_partnernr
|
|
End Get
|
|
Set(ByVal Value As String)
|
|
m_partnernr = Value
|
|
While Len(m_partnernr) < 9
|
|
m_partnernr = "0" & m_partnernr
|
|
End While
|
|
|
|
End Set
|
|
End Property
|
|
|
|
Dim m_dokumenttyp As Integer
|
|
Property Dokumenttyp() As Integer
|
|
Get
|
|
Return m_dokumenttyp
|
|
End Get
|
|
Set(ByVal Value As Integer)
|
|
m_dokumenttyp = Value
|
|
End Set
|
|
End Property
|
|
|
|
Dim m_colddokumentid As String
|
|
Dim m_coldfolder As String
|
|
|
|
Dim server
|
|
Dim user
|
|
Dim pw
|
|
Dim xnumdocs
|
|
Dim xnumfields
|
|
Dim xname As String
|
|
Dim i
|
|
Dim v1
|
|
Dim v2
|
|
Dim numservers
|
|
Dim rc As Short
|
|
Dim ret As Short
|
|
Dim tmp
|
|
|
|
Dim WithEvents hscrol As New HScrollBar()
|
|
Dim WithEvents vscrol As New VScrollBar()
|
|
Dim m_currentpage As Integer
|
|
Property CurrentPage() As Integer
|
|
Get
|
|
Return m_currentpage
|
|
End Get
|
|
Set(ByVal Value As Integer)
|
|
m_currentpage = Value
|
|
End Set
|
|
End Property
|
|
|
|
#End Region
|
|
|
|
Public zf As Short = 100
|
|
Public o As Object
|
|
Public k As Object
|
|
Dim first As Boolean = True
|
|
|
|
Dim txtuser As String = ""
|
|
Dim txtdatetime As String = ""
|
|
Dim txttext As String = ""
|
|
Dim page As Object
|
|
Dim publ As Object
|
|
Dim copied As Object
|
|
Dim numnote As Object
|
|
Dim notes As New DataTable()
|
|
|
|
#Region "Datenzugriffe"
|
|
Private Function Get_Cold_Data_by_Dokumentid()
|
|
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
|
scmCmdToExecute.CommandText = "dbo.sp_get_coldfolder_by_documentid"
|
|
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
|
Dim dtToReturn As DataTable = New DataTable()
|
|
Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute)
|
|
Try
|
|
scmCmdToExecute.Connection = conn.scoDBConnection
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@dokumentid", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, Me.DokumentId))
|
|
|
|
sdaAdapter.Fill(dtToReturn)
|
|
If Me.Colddokumentid = "" Then
|
|
Me.m_colddokumentid = dtToReturn.Rows(0).Item(1)
|
|
Else
|
|
Me.m_colddokumentid = Me.Colddokumentid
|
|
End If
|
|
Me.m_coldfolder = dtToReturn.Rows(0).Item(0)
|
|
Catch ex As Exception
|
|
Throw New Exception("Get_Cold_Folder :" & scmCmdToExecute.CommandText & "::Error occured." & ex.Message, ex)
|
|
Finally
|
|
scmCmdToExecute.Dispose()
|
|
sdaAdapter.Dispose()
|
|
End Try
|
|
End Function
|
|
|
|
|
|
Private Function Get_Cold_Data_by_Dokumenttyp()
|
|
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
|
scmCmdToExecute.CommandText = "dbo.sp_get_coldfolder_by_documenttyp"
|
|
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
|
Dim dtToReturn As DataTable = New DataTable()
|
|
Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute)
|
|
Try
|
|
scmCmdToExecute.Connection = conn.scoDBConnection
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@dokumenttyp", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, Me.Dokumenttyp))
|
|
sdaAdapter.Fill(dtToReturn)
|
|
Me.m_coldfolder = dtToReturn.Rows(0).Item(0)
|
|
Catch ex As Exception
|
|
Throw New Exception("Get_Cold_Folder :" & scmCmdToExecute.CommandText & "::Error occured." & ex.Message, ex)
|
|
Finally
|
|
scmCmdToExecute.Dispose()
|
|
sdaAdapter.Dispose()
|
|
End Try
|
|
End Function
|
|
|
|
#End Region
|
|
|
|
#Region "COLD_Ondemand_Funktionen"
|
|
Public Function Cold_Login() As Boolean
|
|
server = Globals.Applikationsdaten.Rows(0).Item("coldsystem")
|
|
user = Globals.Applikationsdaten.Rows(0).Item("colduser")
|
|
pw = Globals.Applikationsdaten.Rows(0).Item("coldpassword")
|
|
Me.OnDemand.SetUserMessageMode(2)
|
|
Me.OnDemand.Logon(server, user, pw)
|
|
If ret <> 0 And ret <> 8 Then
|
|
MsgBox("Die Anmeldung am COLD ist fehlgeschlagen", MsgBoxStyle.Exclamation)
|
|
Cold_Login = False
|
|
Exit Function
|
|
End If
|
|
Cold_Login = True
|
|
End Function
|
|
|
|
Public Function Show_Dokument(ByVal folder As String, ByVal dokumentid As String)
|
|
Dim rc
|
|
Dim ret
|
|
Dim xnumdocs
|
|
Try
|
|
ret = Me.OnDemand.SetUserMessageMode(0)
|
|
ret = Me.OnDemand.OpenFolder(folder)
|
|
If ret <> 0 Then
|
|
MsgBox("Der gewählte Order " & folder & " kann nicht geöffnet werden", MsgBoxStyle.Critical)
|
|
Me.OnDemand.Logoff()
|
|
Exit Function
|
|
End If
|
|
|
|
ret = Me.OnDemand.ClearFolderSearchFields()
|
|
If ret <> 0 Then
|
|
MsgBox("Die Suchliste konnte nicht initialisiert werden", MsgBoxStyle.Critical)
|
|
Me.OnDemand.Logoff()
|
|
Exit Function
|
|
End If
|
|
|
|
Dim xx As String
|
|
xx = ""
|
|
ret = Me.OnDemand.SetFolderSearchFieldData("Dokument-Id", 11, dokumentid, xx)
|
|
If ret <> 0 Then
|
|
MsgBox("Fehler beim setzen des Suchkriteriums", MsgBoxStyle.Critical)
|
|
Me.OnDemand.Logoff()
|
|
Exit Function
|
|
End If
|
|
|
|
ret = Me.OnDemand.SearchFolder(False)
|
|
If ret <> 0 Then
|
|
MsgBox("Beim Zugriff auf das COLD ist ein Fehler aufgetreten", MsgBoxStyle.Critical)
|
|
Me.OnDemand.Logoff()
|
|
Exit Function
|
|
End If
|
|
|
|
ret = Me.OnDemand.GetNumDocsInList(xnumdocs)
|
|
If xnumdocs < 1 Then
|
|
MsgBox("Es sind keine Dokumente gefunden worden.", MsgBoxStyle.Critical)
|
|
Me.OnDemand.Logoff()
|
|
Exit Function
|
|
End If
|
|
Me.OnDemand.OpenDoc(0, "", 0)
|
|
get_annotations()
|
|
Catch ex As Exception
|
|
MsgBox(ex.Message)
|
|
End Try
|
|
End Function
|
|
#End Region
|
|
|
|
'shu coldanzeige
|
|
Dim m_collectionentry As Integer = 1
|
|
Property CollectionEntry() As Integer
|
|
Get
|
|
Return m_collectionentry
|
|
End Get
|
|
Set(ByVal Value As Integer)
|
|
m_collectionentry = Value
|
|
End Set
|
|
End Property
|
|
Dim m_data As New Collection()
|
|
Property dokdata() As Collection
|
|
Get
|
|
Return m_data
|
|
End Get
|
|
Set(ByVal Value As Collection)
|
|
m_data = Value
|
|
End Set
|
|
End Property
|
|
|
|
Public Sub New(ByVal datacollection As Collection)
|
|
MyBase.New()
|
|
InitializeComponent()
|
|
Me.dokdata = datacollection
|
|
End Sub
|
|
|
|
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
|
show_doc(Me.CollectionEntry)
|
|
|
|
'Dim m_dokument As New edokadb.clsDokument()
|
|
'Get_Cold_Data_by_Dokumentid()
|
|
'If Not Cold_Login() Then Exit Sub
|
|
'Me.ondemand.BackColor = System.Drawing.Color.White
|
|
|
|
'Me.CurrentPage = 1
|
|
|
|
'Me.notes.Columns.Add("ID")
|
|
'Me.notes.Columns.Add("Text")
|
|
'Me.notes.Columns.Add("UserID")
|
|
'Me.notes.Columns.Add("DateTime")
|
|
'Me.notes.Columns.Add("Page")
|
|
'Me.notes.Columns.Add("ispublic")
|
|
'Me.notes.Columns.Add("canbecopied")
|
|
'Me.notes.Columns.Add("status")
|
|
'Show_Dokument(Me.m_coldfolder, Me.m_colddokumentid)
|
|
|
|
End Sub
|
|
|
|
Dim folder As String
|
|
Dim belegart As String
|
|
Dim numpages As Integer
|
|
Dim curpage As Integer
|
|
Dim coldata As clsMehrfachdruck_Data
|
|
Public Sub show_doc(ByVal collectionentry As Integer)
|
|
Dim xnumdocs
|
|
Dim xnumfields
|
|
Dim xname As String
|
|
Dim i
|
|
Dim v1
|
|
Dim v2
|
|
Dim numservers
|
|
Dim rc As Short
|
|
Dim ret As Short
|
|
Dim tmp
|
|
coldata = Me.dokdata.Item(collectionentry)
|
|
If Not Me.Cold_Login Then
|
|
MsgBox("Login to Cold failed")
|
|
Exit Sub
|
|
|
|
End If
|
|
Me.NoteLabel.Text = "Dokument " + Me.CollectionEntry.ToString + " von " + Me.dokdata.Count.ToString
|
|
' Select Case coldata.Enum_Typ
|
|
' Case coldata.Enum_Typ.ZV
|
|
belegart = "ZV"
|
|
folder = "TGKB ZV-Scanning Belege (erweiterte Suche)"
|
|
' Case coldata.Enum_Typ.HOST
|
|
'belegart = "HOST"
|
|
'folder = "TGKB Kundenoutput AGI-OMS für EDOKA User"
|
|
' Case coldata.Enum_Typ.EDOKA
|
|
' End Select
|
|
|
|
ret = Me.OnDemand.SetUserMessageMode(0)
|
|
ret = Me.OnDemand.OpenFolder(folder)
|
|
If ret <> 0 Then
|
|
MsgBox("Der gewählte Order " & folder & " kann nicht geöffnet werden", MsgBoxStyle.Critical)
|
|
Me.OnDemand.Logoff()
|
|
Exit Sub
|
|
End If
|
|
|
|
rc = Me.OnDemand.GetNumFolderSearchFields(xnumfields)
|
|
For i = 0 To xnumfields - 1
|
|
tmp = ""
|
|
ret = OnDemand.GetFolderSearchFieldName(i, tmp)
|
|
Next
|
|
|
|
ret = Me.OnDemand.ClearFolderSearchFields()
|
|
If ret <> 0 Then
|
|
MsgBox("Die Suchliste konnte nicht initialisiert werden", MsgBoxStyle.Critical)
|
|
Me.OnDemand.Logoff()
|
|
Exit Sub
|
|
End If
|
|
|
|
Dim xx As String
|
|
xx = ""
|
|
'Hutter 2004-10-04 Aktivierung COLD-Print
|
|
Select Case belegart
|
|
Case "HOST"
|
|
ret = Me.OnDemand.SetFolderSearchFieldData("Dokument-Id", 1, coldata.DokumentId, xx)
|
|
ret = Me.OnDemand.SetFolderSearchFieldData("Erstellung od. Valuta Datum", 1, coldata.Erstellungsdatum, xx)
|
|
Case "UVM"
|
|
Case "ZV"
|
|
ret = Me.OnDemand.SetFolderSearchFieldData("Dokumenttyp", 1, coldata.DokumentTyp, xx)
|
|
ret = Me.OnDemand.SetFolderSearchFieldData("Auftrag-Nr.", 1, coldata.Auftragnr, xx)
|
|
ret = Me.OnDemand.SetFolderSearchFieldData("Paginator", 1, coldata.DokumentId, xx)
|
|
Case Else
|
|
Dim s As String
|
|
' s = Trim(Me.PartnerNr)
|
|
' While Len(s) < 9
|
|
' s = "0" + s
|
|
' End While
|
|
' ret = Me.OnDemand.SetFolderSearchFieldData("Partner-Nr.", 1, s, xx)
|
|
ret = Me.OnDemand.SetFolderSearchFieldData("Dokument-Id", 11, DokumentId, xx)
|
|
End Select
|
|
'If Me.m_coldfolder = "TGKB Kundenoutput AGI-OMS für EDOKA User" Then
|
|
' ret = Me.OnDemand.SetFolderSearchFieldData("Dokument-Id", 1, Me.DokumentId, xx)
|
|
' ret = Me.OnDemand.SetFolderSearchFieldData("Erstellung od. Valuta Datum", 1, Me.Erstellungsdatum, xx)
|
|
'Else
|
|
' ret = Me.OnDemand.SetFolderSearchFieldData("Dokument-Id", 11, dokumentid, xx)
|
|
'End If
|
|
|
|
If ret <> 0 Then
|
|
MsgBox("Fehler beim setzen des Suchkriteriums", MsgBoxStyle.Critical)
|
|
Me.OnDemand.Logoff()
|
|
Exit Sub
|
|
End If
|
|
|
|
ret = Me.OnDemand.SearchFolder(False)
|
|
If ret <> 0 Then
|
|
MsgBox("Beim Zugriff auf das COLD ist ein Fehler aufgetreten", MsgBoxStyle.Critical)
|
|
Me.OnDemand.Logoff()
|
|
Exit Sub
|
|
End If
|
|
|
|
ret = Me.OnDemand.GetNumDocsInList(xnumdocs)
|
|
If xnumdocs < 1 Then
|
|
If Not DivFnkt.BDR_Dokument(Me.DokumentId) Then
|
|
MyMsg.show_standardmessage(81, MsgBoxStyle.Information)
|
|
Else
|
|
MyMsg.show_standardmessage(275, MsgBoxStyle.Information)
|
|
End If
|
|
Me.OnDemand.Logoff()
|
|
|
|
Exit Sub
|
|
End If
|
|
Try
|
|
Me.OnDemand.CloseDoc()
|
|
Catch
|
|
End Try
|
|
Me.OnDemand.OpenDoc(0, "", 0)
|
|
Dim o As Object
|
|
o = Nothing
|
|
ret = OnDemand.GetDocNumPages(o)
|
|
If ret = 0 Then Me.numpages = o
|
|
o = Nothing
|
|
ret = OnDemand.GetDocCurrentPage(o)
|
|
If ret = 0 Then Me.curpage = o
|
|
|
|
If first Then
|
|
first = False
|
|
zf = 75
|
|
o = Nothing
|
|
k = Nothing
|
|
ret = Me.OnDemand.SetDocZoom(zf, o, k)
|
|
End If
|
|
o = Nothing
|
|
k = Nothing
|
|
ret = Me.OnDemand.SetDocZoom(zf, o, k)
|
|
Me.CurrentPage = 1
|
|
End Sub
|
|
|
|
Public Function get_annotations()
|
|
|
|
Dim rc As DataRowCollection
|
|
Dim newrow As DataRow()
|
|
rc = notes.Rows
|
|
Dim rowvals(7) As Object
|
|
Dim i As Integer
|
|
ret = Me.OnDemand.GetNumDocAnnotations(Me.numnote)
|
|
|
|
For i = 0 To Me.numnote - 1
|
|
ret = Me.OnDemand.GetAnnotationForDoc(i, txttext, txtuser, txtdatetime, page, publ, copied)
|
|
rowvals(0) = i
|
|
rowvals(1) = txttext
|
|
rowvals(2) = txtuser
|
|
rowvals(3) = txtdatetime
|
|
rowvals(4) = page
|
|
rowvals(5) = publ
|
|
rowvals(6) = copied
|
|
rowvals(7) = ""
|
|
notes.Rows.Add(rowvals)
|
|
Next
|
|
|
|
'If Me.numnote > 0 Then
|
|
' Me.NoteCount.Text = Me.numnote.ToString
|
|
' Me.NoteCount.Visible = True
|
|
' Me.NoteLabel.Visible = True
|
|
'Else
|
|
' Me.NoteCount.Visible = False
|
|
' Me.NoteLabel.Visible = False
|
|
'End If
|
|
End Function
|
|
|
|
|
|
|
|
Private Sub ToolBar1_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles ToolBar1.ButtonClick
|
|
Select Case ToolBar1.Buttons.IndexOf(e.Button)
|
|
Case 0
|
|
Me.Close()
|
|
Case 1
|
|
Me.OnDemand.PrintDoc(-1, 0, Me.PrintDocument1.PrinterSettings.PrinterName, True, 1, 3, 0.5, 0.5, 0.5, 0.5, False)
|
|
Me.CurrentPage = Me.CurrentPage - 1
|
|
ret = Me.OnDemand.SetDocCurrentPage(Me.CurrentPage)
|
|
If ret <> 0 Then Me.CurrentPage = Me.CurrentPage + 1
|
|
Case 2
|
|
Me.CurrentPage = Me.CurrentPage - 1
|
|
ret = Me.OnDemand.SetDocCurrentPage(Me.CurrentPage)
|
|
If ret <> 0 Then Me.CurrentPage = Me.CurrentPage + 1
|
|
Case 3
|
|
Me.CurrentPage = Me.CurrentPage + 1
|
|
ret = Me.OnDemand.SetDocCurrentPage(Me.CurrentPage)
|
|
If ret <> 0 Then Me.CurrentPage = Me.CurrentPage - 1
|
|
Case 4
|
|
zf = zf - 25
|
|
o = Nothing
|
|
k = Nothing
|
|
If zf < 25 Then zf = 25
|
|
ret = Me.OnDemand.SetDocZoom(zf, o, k)
|
|
Case 5
|
|
zf = zf + 25
|
|
o = Nothing
|
|
k = Nothing
|
|
If zf > 1000 Then zf = 1000
|
|
ret = Me.OnDemand.SetDocZoom(zf, o, k)
|
|
Case 7
|
|
Dim f As New frmNotes()
|
|
f.ondemand = Me.OnDemand
|
|
f.notes = Me.notes
|
|
f.ShowDialog()
|
|
Case 10
|
|
Me.CollectionEntry = Me.CollectionEntry - 1
|
|
If Me.CollectionEntry < 1 Then Me.CollectionEntry = 1
|
|
Me.show_doc(Me.CollectionEntry)
|
|
Case 11
|
|
Me.CollectionEntry = Me.CollectionEntry + 1
|
|
If Me.CollectionEntry > Me.dokdata.Count Then Me.CollectionEntry = Me.dokdata.Count
|
|
Me.show_doc(Me.CollectionEntry)
|
|
Case 12
|
|
coldata = dokdata(Me.CollectionEntry)
|
|
DivFnkt.Erstellungsdatum = coldata.Erstellungsdatum
|
|
DivFnkt.Auftragnr = coldata.Auftragnr
|
|
DivFnkt.UVMZVDokumenttyp = coldata.DokumentTyp
|
|
DivFnkt.Belegart = "ZV"
|
|
DivFnkt.ShowColdDocHost(coldata.DokumentId, Me, coldata.DokumentId, coldata.PartnerNr, coldata.PartnerName, coldata.DokumentTyp)
|
|
Me.Cursor = Cursors.Default
|
|
End Select
|
|
End Sub
|
|
|
|
Public Function GetColdDokumente() As DataTable
|
|
Dim m_dokument As New edokadb.clsDokument()
|
|
Get_Cold_Data_by_Dokumenttyp()
|
|
If Not Me.Cold_Login Then Exit Function
|
|
Get_Folder_Documents(Me.m_coldfolder)
|
|
End Function
|
|
|
|
Private Function Get_Folder_Documents(ByVal Folder As String)
|
|
ret = Me.OnDemand.SetUserMessageMode(0)
|
|
ret = Me.OnDemand.OpenFolder(Folder)
|
|
If ret <> 0 Then
|
|
MsgBox("Der gewählte Order " & Folder & " kann nicht geöffnet werden", MsgBoxStyle.Critical)
|
|
Me.OnDemand.Logoff()
|
|
Exit Function
|
|
End If
|
|
|
|
ret = Me.OnDemand.ClearFolderSearchFields()
|
|
If ret <> 0 Then
|
|
MsgBox("Die Suchliste konnte nicht initialisiert werden", MsgBoxStyle.Critical)
|
|
Me.OnDemand.Logoff()
|
|
Exit Function
|
|
End If
|
|
|
|
Dim xx As String
|
|
xx = ""
|
|
ret = Me.OnDemand.SetFolderSearchFieldData("Partner-Nr.", 1, Me.PartnerNr, xx)
|
|
'ret = Me.OnDemand.SetFolderSearchFieldData("Dok.-Status", 11, "Aktuell", xx)
|
|
If ret <> 0 Then
|
|
MsgBox("Fehler beim setzen des Suchkriteriums", MsgBoxStyle.Critical)
|
|
Me.OnDemand.Logoff()
|
|
Exit Function
|
|
End If
|
|
|
|
ret = Me.OnDemand.SearchFolder(False)
|
|
If ret <> 0 Then
|
|
MsgBox("Beim Zugriff auf das COLD ist ein Fehler aufgetreten", MsgBoxStyle.Critical)
|
|
Me.OnDemand.Logoff()
|
|
Exit Function
|
|
End If
|
|
|
|
ret = Me.OnDemand.GetNumDocsInList(xnumdocs)
|
|
If xnumdocs < 1 Then
|
|
MsgBox("Es sind keine Dokumente gefunden worden.", MsgBoxStyle.Critical)
|
|
Me.OnDemand.Logoff()
|
|
Exit Function
|
|
End If
|
|
Dim tmp As String
|
|
|
|
Dim i As Short
|
|
Dim i1 As Short
|
|
tmp = ""
|
|
ret = OnDemand.GetNumFolderDisplayFields(xnumfields)
|
|
Dim foldernames(xnumfields) As String
|
|
For i = 0 To xnumfields - 1
|
|
tmp = Nothing
|
|
OnDemand.GetFolderDisplayFieldName(i, tmp)
|
|
foldernames(i) = tmp
|
|
MsgBox(foldernames(i))
|
|
Next
|
|
|
|
Dim t As New DataTable()
|
|
Dim newrow As DataRow
|
|
Dim rc As DataRowCollection
|
|
rc = t.Rows
|
|
Dim rowvals(xnumfields) As Object
|
|
|
|
For i = 0 To xnumdocs
|
|
For i1 = 0 To xnumfields
|
|
ret = OnDemand.GetDocDisplayValue(i, i1, tmp)
|
|
If ret = 0 Then
|
|
rowvals(i1) = tmp
|
|
End If
|
|
Next i1
|
|
|
|
newrow = rc.Add(rowvals)
|
|
Next i
|
|
|
|
End Function
|
|
|
|
Private Sub vscrol_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles vscrol.ValueChanged
|
|
Try
|
|
zf = 1
|
|
|
|
o = 60
|
|
ret = Me.OnDemand.ScrollDocVert(zf, o)
|
|
Catch ex As Exception
|
|
MsgBox(ret)
|
|
MsgBox(ex.Message)
|
|
End Try
|
|
End Sub
|
|
End Class
|