|
|
Imports System.Resources
|
|
|
Imports System.Data
|
|
|
Imports System.Data.SqlClient
|
|
|
Imports System.Data.SqlTypes
|
|
|
Imports System.Runtime.InteropServices
|
|
|
Imports System.IO
|
|
|
Public Class frmPDFPrinter
|
|
|
Inherits System.Windows.Forms.Form
|
|
|
|
|
|
#Region " Windows Form Designer generated code "
|
|
|
|
|
|
Public Sub New()
|
|
|
MyBase.New()
|
|
|
|
|
|
'This call is required by the Windows Form Designer.
|
|
|
InitializeComponent()
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
'Form overrides dispose to clean up the component list.
|
|
|
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
|
|
|
|
|
|
'Required by the Windows Form Designer
|
|
|
Private components As System.ComponentModel.IContainer
|
|
|
|
|
|
'NOTE: The following procedure is required by the Windows Form Designer
|
|
|
'It can be modified using the Windows Form Designer.
|
|
|
'Do not modify it using the code editor.
|
|
|
Friend WithEvents MenuItem13 As System.Windows.Forms.MenuItem
|
|
|
Friend Shadows WithEvents contextMenu As System.Windows.Forms.ContextMenu
|
|
|
Friend WithEvents StatusBar1 As System.Windows.Forms.StatusBar
|
|
|
Friend WithEvents addressBar As System.Windows.Forms.ComboBox
|
|
|
Friend WithEvents addressBarLbl As System.Windows.Forms.Label
|
|
|
Friend WithEvents ToolBar2 As System.Windows.Forms.ToolBar
|
|
|
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 Panel1 As System.Windows.Forms.Panel
|
|
|
Friend WithEvents Label1 As System.Windows.Forms.Label
|
|
|
Friend WithEvents Button1 As System.Windows.Forms.Button
|
|
|
Friend WithEvents cbverarbeitung As System.Windows.Forms.ComboBox
|
|
|
Friend WithEvents Label3 As System.Windows.Forms.Label
|
|
|
Friend WithEvents lblpartner As System.Windows.Forms.Label
|
|
|
Friend WithEvents Label2 As System.Windows.Forms.Label
|
|
|
Friend WithEvents webOCWrapper As EDOKAApp.WebOCHostCtrl
|
|
|
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
|
|
|
Me.components = New System.ComponentModel.Container()
|
|
|
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmPDFPrinter))
|
|
|
Me.contextMenu = New System.Windows.Forms.ContextMenu()
|
|
|
Me.MenuItem13 = New System.Windows.Forms.MenuItem()
|
|
|
Me.StatusBar1 = New System.Windows.Forms.StatusBar()
|
|
|
Me.addressBar = New System.Windows.Forms.ComboBox()
|
|
|
Me.addressBarLbl = New System.Windows.Forms.Label()
|
|
|
Me.ToolBar2 = New System.Windows.Forms.ToolBar()
|
|
|
Me.ToolBarButton1 = New System.Windows.Forms.ToolBarButton()
|
|
|
Me.ToolBarButton2 = New System.Windows.Forms.ToolBarButton()
|
|
|
Me.ImageList1 = New System.Windows.Forms.ImageList(Me.components)
|
|
|
Me.Panel1 = New System.Windows.Forms.Panel()
|
|
|
Me.lblpartner = New System.Windows.Forms.Label()
|
|
|
Me.Label2 = New System.Windows.Forms.Label()
|
|
|
Me.cbverarbeitung = New System.Windows.Forms.ComboBox()
|
|
|
Me.Label3 = New System.Windows.Forms.Label()
|
|
|
Me.Button1 = New System.Windows.Forms.Button()
|
|
|
Me.Label1 = New System.Windows.Forms.Label()
|
|
|
Me.webOCWrapper = New EDOKAApp.WebOCHostCtrl()
|
|
|
Me.Panel1.SuspendLayout()
|
|
|
Me.SuspendLayout()
|
|
|
'
|
|
|
'contextMenu
|
|
|
'
|
|
|
Me.contextMenu.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem13})
|
|
|
'
|
|
|
'MenuItem13
|
|
|
'
|
|
|
Me.MenuItem13.Index = 0
|
|
|
Me.MenuItem13.Text = "Print..."
|
|
|
'
|
|
|
'StatusBar1
|
|
|
'
|
|
|
Me.StatusBar1.Anchor = ((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
|
|
|
Or System.Windows.Forms.AnchorStyles.Right)
|
|
|
Me.StatusBar1.Dock = System.Windows.Forms.DockStyle.None
|
|
|
Me.StatusBar1.Location = New System.Drawing.Point(0, 431)
|
|
|
Me.StatusBar1.Name = "StatusBar1"
|
|
|
Me.StatusBar1.Size = New System.Drawing.Size(666, 24)
|
|
|
Me.StatusBar1.TabIndex = 1
|
|
|
'
|
|
|
'addressBar
|
|
|
'
|
|
|
Me.addressBar.Location = New System.Drawing.Point(16, 56)
|
|
|
Me.addressBar.Name = "addressBar"
|
|
|
Me.addressBar.Size = New System.Drawing.Size(352, 21)
|
|
|
Me.addressBar.Sorted = True
|
|
|
Me.addressBar.TabIndex = 3
|
|
|
Me.addressBar.Visible = False
|
|
|
'
|
|
|
'addressBarLbl
|
|
|
'
|
|
|
Me.addressBarLbl.Location = New System.Drawing.Point(16, 12)
|
|
|
Me.addressBarLbl.Name = "addressBarLbl"
|
|
|
Me.addressBarLbl.Size = New System.Drawing.Size(100, 16)
|
|
|
Me.addressBarLbl.TabIndex = 8
|
|
|
Me.addressBarLbl.TextAlign = System.Drawing.ContentAlignment.MiddleRight
|
|
|
'
|
|
|
'ToolBar2
|
|
|
'
|
|
|
Me.ToolBar2.Buttons.AddRange(New System.Windows.Forms.ToolBarButton() {Me.ToolBarButton1, Me.ToolBarButton2})
|
|
|
Me.ToolBar2.DropDownArrows = True
|
|
|
Me.ToolBar2.ImageList = Me.ImageList1
|
|
|
Me.ToolBar2.Name = "ToolBar2"
|
|
|
Me.ToolBar2.ShowToolTips = True
|
|
|
Me.ToolBar2.Size = New System.Drawing.Size(666, 25)
|
|
|
Me.ToolBar2.TabIndex = 9
|
|
|
Me.ToolBar2.Visible = False
|
|
|
'
|
|
|
'ToolBarButton1
|
|
|
'
|
|
|
Me.ToolBarButton1.ImageIndex = 0
|
|
|
'
|
|
|
'ToolBarButton2
|
|
|
'
|
|
|
Me.ToolBarButton2.ImageIndex = 1
|
|
|
'
|
|
|
'ImageList1
|
|
|
'
|
|
|
Me.ImageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit
|
|
|
Me.ImageList1.ImageSize = New System.Drawing.Size(16, 16)
|
|
|
Me.ImageList1.TransparentColor = System.Drawing.Color.Transparent
|
|
|
'
|
|
|
'Panel1
|
|
|
'
|
|
|
Me.Panel1.Controls.AddRange(New System.Windows.Forms.Control() {Me.lblpartner, Me.Label2, Me.cbverarbeitung, Me.Label3, Me.Button1, Me.Label1})
|
|
|
Me.Panel1.Name = "Panel1"
|
|
|
Me.Panel1.Size = New System.Drawing.Size(368, 176)
|
|
|
Me.Panel1.TabIndex = 10
|
|
|
'
|
|
|
'lblpartner
|
|
|
'
|
|
|
Me.lblpartner.Location = New System.Drawing.Point(56, 8)
|
|
|
Me.lblpartner.Name = "lblpartner"
|
|
|
Me.lblpartner.Size = New System.Drawing.Size(336, 23)
|
|
|
Me.lblpartner.TabIndex = 10
|
|
|
'
|
|
|
'Label2
|
|
|
'
|
|
|
Me.Label2.Location = New System.Drawing.Point(8, 8)
|
|
|
Me.Label2.Name = "Label2"
|
|
|
Me.Label2.Size = New System.Drawing.Size(48, 23)
|
|
|
Me.Label2.TabIndex = 9
|
|
|
Me.Label2.Text = "Partner:"
|
|
|
'
|
|
|
'cbverarbeitung
|
|
|
'
|
|
|
Me.cbverarbeitung.Items.AddRange(New Object() {"Fenster schliessen", "Ausdruck erfolgreich", "Ausdruck nicht erfolgreich"})
|
|
|
Me.cbverarbeitung.Location = New System.Drawing.Point(160, 80)
|
|
|
Me.cbverarbeitung.Name = "cbverarbeitung"
|
|
|
Me.cbverarbeitung.Size = New System.Drawing.Size(192, 21)
|
|
|
Me.cbverarbeitung.TabIndex = 8
|
|
|
Me.cbverarbeitung.Text = "ComboBox1"
|
|
|
'
|
|
|
'Label3
|
|
|
'
|
|
|
Me.Label3.Location = New System.Drawing.Point(8, 80)
|
|
|
Me.Label3.Name = "Label3"
|
|
|
Me.Label3.Size = New System.Drawing.Size(128, 23)
|
|
|
Me.Label3.TabIndex = 7
|
|
|
Me.Label3.Text = "Weitere Verarbeitung:"
|
|
|
'
|
|
|
'Button1
|
|
|
'
|
|
|
Me.Button1.Enabled = False
|
|
|
Me.Button1.Location = New System.Drawing.Point(152, 120)
|
|
|
Me.Button1.Name = "Button1"
|
|
|
Me.Button1.TabIndex = 1
|
|
|
Me.Button1.Text = "&OK"
|
|
|
'
|
|
|
'Label1
|
|
|
'
|
|
|
Me.Label1.Location = New System.Drawing.Point(8, 40)
|
|
|
Me.Label1.Name = "Label1"
|
|
|
Me.Label1.Size = New System.Drawing.Size(352, 32)
|
|
|
Me.Label1.TabIndex = 0
|
|
|
Me.Label1.Text = "Label1"
|
|
|
'
|
|
|
'webOCWrapper
|
|
|
'
|
|
|
Me.webOCWrapper.Anchor = (((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
|
|
|
Or System.Windows.Forms.AnchorStyles.Left) _
|
|
|
Or System.Windows.Forms.AnchorStyles.Right)
|
|
|
Me.webOCWrapper.BrowserContextMenu = False
|
|
|
Me.webOCWrapper.ImeMode = System.Windows.Forms.ImeMode.NoControl
|
|
|
Me.webOCWrapper.Location = New System.Drawing.Point(8, 88)
|
|
|
Me.webOCWrapper.Name = "webOCWrapper"
|
|
|
Me.webOCWrapper.Size = New System.Drawing.Size(688, 304)
|
|
|
Me.webOCWrapper.TabIndex = 11
|
|
|
Me.webOCWrapper.TabStop = False
|
|
|
'
|
|
|
'frmPDFPrinter
|
|
|
'
|
|
|
Me.AutoScale = False
|
|
|
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
|
|
|
Me.ClientSize = New System.Drawing.Size(666, 455)
|
|
|
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Panel1, Me.ToolBar2, Me.addressBarLbl, Me.StatusBar1, Me.addressBar, Me.webOCWrapper})
|
|
|
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
|
|
|
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
|
|
|
Me.MaximizeBox = False
|
|
|
Me.MaximumSize = New System.Drawing.Size(368, 176)
|
|
|
Me.MinimizeBox = False
|
|
|
Me.Name = "frmPDFPrinter"
|
|
|
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
|
|
|
Me.Text = "Druckbest<EFBFBD>tigung"
|
|
|
Me.Panel1.ResumeLayout(False)
|
|
|
Me.ResumeLayout(False)
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
#End Region
|
|
|
|
|
|
#Region " Deklarationen"
|
|
|
|
|
|
Dim m_showdoc As Boolean = True
|
|
|
|
|
|
Dim m_alnr As Integer
|
|
|
Property alnr() As Integer
|
|
|
Get
|
|
|
Return m_alnr
|
|
|
End Get
|
|
|
Set(ByVal Value As Integer)
|
|
|
m_alnr = Value
|
|
|
End Set
|
|
|
End Property
|
|
|
|
|
|
Dim m_part As Integer
|
|
|
Property Part() As Integer
|
|
|
Get
|
|
|
Return m_part
|
|
|
End Get
|
|
|
Set(ByVal Value As Integer)
|
|
|
m_part = Value
|
|
|
End Set
|
|
|
End Property
|
|
|
|
|
|
#End Region
|
|
|
|
|
|
Public Sub New(ByVal ShowDoc As Boolean)
|
|
|
MyBase.New()
|
|
|
InitializeComponent()
|
|
|
Me.m_showdoc = ShowDoc
|
|
|
End Sub
|
|
|
|
|
|
Private Sub frmPDFPrinter_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
|
|
get_partner(alnr)
|
|
|
Me.Text = "Druckbest<EFBFBD>tigung: " + Me.lblpartner.Text
|
|
|
Me.Label1.Text = MyTxt.gettext(615)
|
|
|
'----------------------------
|
|
|
' Taskforce Korrektur
|
|
|
' BUD - 21.03.2006
|
|
|
'----------------------------
|
|
|
'If Me.m_showdoc = True Then
|
|
|
' webOCWrapper.Navigate(addressBar.Text)
|
|
|
'End If
|
|
|
'----------------------------
|
|
|
|
|
|
Me.cbverarbeitung.SelectedIndex = 1
|
|
|
End Sub
|
|
|
|
|
|
Private Sub delay(ByVal seconds As Integer)
|
|
|
Me.Cursor = Cursors.WaitCursor
|
|
|
Dim starttime As DateTime = DateTime.Now
|
|
|
Do
|
|
|
Application.DoEvents()
|
|
|
Loop While DateTime.Now.Subtract(starttime).TotalSeconds < seconds
|
|
|
Me.Cursor = Cursors.Default
|
|
|
End Sub
|
|
|
|
|
|
Public Sub PrintPDF()
|
|
|
delay(2)
|
|
|
'----------------------------
|
|
|
' Taskforce Korrektur
|
|
|
' BUD - 21.03.2006
|
|
|
'----------------------------
|
|
|
'webOCWrapper.Print(doUI:=True)
|
|
|
Dim objpdf As New clsPDF_print_show()
|
|
|
objpdf.PrintPDF(addressBar.Text, clsPDF_print_show.Enum_Art.Drucken)
|
|
|
MsgBox(MyTxt.gettext(618), MsgBoxStyle.Information, "Banklagernd Druck")
|
|
|
'----------------------------
|
|
|
Me.Button1.Enabled = True
|
|
|
Application.DoEvents()
|
|
|
Dim i As Integer
|
|
|
End Sub
|
|
|
|
|
|
Private Sub inetOptionsMI_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
|
|
|
webOCWrapper.InternetOptions()
|
|
|
End Sub
|
|
|
|
|
|
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
|
|
|
Try
|
|
|
Select Case Me.cbverarbeitung.SelectedIndex
|
|
|
Case 0
|
|
|
Case 1
|
|
|
Dim frmbla As New frmBLAuslieferungen()
|
|
|
frmbla.set_PrintOK(Me.alnr, Part)
|
|
|
frmbla.Close()
|
|
|
frmbla.Dispose()
|
|
|
Case 2
|
|
|
Dim frmbla As New frmBLAuslieferungen()
|
|
|
frmbla.set_PrintNOK(Me.alnr, Part)
|
|
|
frmbla.Close()
|
|
|
frmbla.Dispose()
|
|
|
End Select
|
|
|
Me.Close()
|
|
|
Catch ex As Exception
|
|
|
MsgBox(ex.Message)
|
|
|
End Try
|
|
|
End Sub
|
|
|
|
|
|
Private Function get_partner(ByVal alnr As Integer)
|
|
|
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
|
|
scmCmdToExecute.CommandText = "dbo.SP_edex_bl_get_partner"
|
|
|
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("@alnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, alnr))
|
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@bkpar00", SqlDbType.VarChar, 255, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, ""))
|
|
|
sdaAdapter.Fill(dtToReturn)
|
|
|
Me.lblpartner.Text = scmCmdToExecute.Parameters("@bkpar00").Value
|
|
|
Return dtToReturn
|
|
|
Catch ex As Exception
|
|
|
Finally
|
|
|
scmCmdToExecute.Dispose()
|
|
|
sdaAdapter.Dispose()
|
|
|
dtToReturn.Dispose()
|
|
|
End Try
|
|
|
End Function
|
|
|
|
|
|
End Class
|