This commit is contained in:
2022-12-25 10:09:49 +01:00
commit 406d053e79
3903 changed files with 2127541 additions and 0 deletions

322
EDOKA/DokDAMD/DOKMD/frmMD.designer.vb generated Normal file
View File

@@ -0,0 +1,322 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmMD
Inherits System.Windows.Forms.Form
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Wird vom Windows Form-Designer benötigt.
Private components As System.ComponentModel.IContainer
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmMD))
Me.Panel1 = New System.Windows.Forms.Panel()
Me.Button5 = New System.Windows.Forms.Button()
Me.Button4 = New System.Windows.Forms.Button()
Me.Label7 = New System.Windows.Forms.Label()
Me.Label6 = New System.Windows.Forms.Label()
Me.ListBox2 = New System.Windows.Forms.ListBox()
Me.ListBox1 = New System.Windows.Forms.ListBox()
Me.Label5 = New System.Windows.Forms.Label()
Me.Label4 = New System.Windows.Forms.Label()
Me.Button3 = New System.Windows.Forms.Button()
Me.Button2 = New System.Windows.Forms.Button()
Me.Button1 = New System.Windows.Forms.Button()
Me.txtJahrbis = New System.Windows.Forms.TextBox()
Me.Label3 = New System.Windows.Forms.Label()
Me.txtJahrvon = New System.Windows.Forms.TextBox()
Me.Label2 = New System.Windows.Forms.Label()
Me.txtBPNr = New System.Windows.Forms.TextBox()
Me.Label1 = New System.Windows.Forms.Label()
Me.ToolStrip1 = New System.Windows.Forms.ToolStrip()
Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton()
Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog()
Me.DokList = New C1.Win.C1TrueDBGrid.C1TrueDBGrid()
Me.Panel1.SuspendLayout()
Me.ToolStrip1.SuspendLayout()
CType(Me.DokList, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'Panel1
'
Me.Panel1.Controls.Add(Me.Button5)
Me.Panel1.Controls.Add(Me.Button4)
Me.Panel1.Controls.Add(Me.Label7)
Me.Panel1.Controls.Add(Me.Label6)
Me.Panel1.Controls.Add(Me.ListBox2)
Me.Panel1.Controls.Add(Me.ListBox1)
Me.Panel1.Controls.Add(Me.Label5)
Me.Panel1.Controls.Add(Me.Label4)
Me.Panel1.Controls.Add(Me.Button3)
Me.Panel1.Controls.Add(Me.Button2)
Me.Panel1.Controls.Add(Me.Button1)
Me.Panel1.Controls.Add(Me.txtJahrbis)
Me.Panel1.Controls.Add(Me.Label3)
Me.Panel1.Controls.Add(Me.txtJahrvon)
Me.Panel1.Controls.Add(Me.Label2)
Me.Panel1.Controls.Add(Me.txtBPNr)
Me.Panel1.Controls.Add(Me.Label1)
Me.Panel1.Dock = System.Windows.Forms.DockStyle.Top
Me.Panel1.Location = New System.Drawing.Point(0, 25)
Me.Panel1.Name = "Panel1"
Me.Panel1.Size = New System.Drawing.Size(859, 155)
Me.Panel1.TabIndex = 1
'
'Button5
'
Me.Button5.Location = New System.Drawing.Point(220, 15)
Me.Button5.Name = "Button5"
Me.Button5.Size = New System.Drawing.Size(35, 23)
Me.Button5.TabIndex = 16
Me.Button5.Text = "Import"
Me.Button5.UseVisualStyleBackColor = True
'
'Button4
'
Me.Button4.Location = New System.Drawing.Point(93, 15)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(33, 23)
Me.Button4.TabIndex = 15
Me.Button4.Text = "Import"
Me.Button4.UseVisualStyleBackColor = True
'
'Label7
'
Me.Label7.AutoSize = True
Me.Label7.Location = New System.Drawing.Point(132, 22)
Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(82, 13)
Me.Label7.TabIndex = 14
Me.Label7.Text = "Dokumenttypen"
'
'Label6
'
Me.Label6.AutoSize = True
Me.Label6.Location = New System.Drawing.Point(9, 22)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(41, 13)
Me.Label6.TabIndex = 13
Me.Label6.Text = "Partner"
'
'ListBox2
'
Me.ListBox2.FormattingEnabled = True
Me.ListBox2.Location = New System.Drawing.Point(135, 41)
Me.ListBox2.Name = "ListBox2"
Me.ListBox2.Size = New System.Drawing.Size(120, 95)
Me.ListBox2.TabIndex = 12
'
'ListBox1
'
Me.ListBox1.FormattingEnabled = True
Me.ListBox1.Location = New System.Drawing.Point(9, 41)
Me.ListBox1.Name = "ListBox1"
Me.ListBox1.Size = New System.Drawing.Size(120, 95)
Me.ListBox1.TabIndex = 11
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.Location = New System.Drawing.Point(623, 18)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(0, 13)
Me.Label5.TabIndex = 10
Me.Label5.Tag = "[Kein Partner ausgwählt]"
Me.Label5.Visible = False
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(544, 15)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(109, 13)
Me.Label4.TabIndex = 9
Me.Label4.Text = "BP-Kurzbezeichnung:"
Me.Label4.Visible = False
'
'Button3
'
Me.Button3.Image = CType(resources.GetObject("Button3.Image"), System.Drawing.Image)
Me.Button3.Location = New System.Drawing.Point(672, 15)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(34, 30)
Me.Button3.TabIndex = 8
Me.Button3.UseVisualStyleBackColor = True
Me.Button3.Visible = False
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(728, 38)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(107, 23)
Me.Button2.TabIndex = 7
Me.Button2.Text = "Daten aufbereiten"
Me.Button2.UseVisualStyleBackColor = True
'
'Button1
'
Me.Button1.Enabled = False
Me.Button1.Location = New System.Drawing.Point(728, 8)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(107, 23)
Me.Button1.TabIndex = 6
Me.Button1.Text = "Daten auselsen"
Me.Button1.UseVisualStyleBackColor = True
'
'txtJahrbis
'
Me.txtJahrbis.Location = New System.Drawing.Point(569, 72)
Me.txtJahrbis.Name = "txtJahrbis"
Me.txtJahrbis.Size = New System.Drawing.Size(54, 20)
Me.txtJahrbis.TabIndex = 5
Me.txtJahrbis.Text = "2011"
Me.txtJahrbis.Visible = False
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(487, 75)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(54, 13)
Me.Label3.TabIndex = 4
Me.Label3.Text = "Datum bis"
Me.Label3.Visible = False
'
'txtJahrvon
'
Me.txtJahrvon.Location = New System.Drawing.Point(569, 46)
Me.txtJahrvon.Name = "txtJahrvon"
Me.txtJahrvon.Size = New System.Drawing.Size(54, 20)
Me.txtJahrvon.TabIndex = 3
Me.txtJahrvon.Text = "2002"
Me.txtJahrvon.Visible = False
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(487, 49)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(59, 13)
Me.Label2.TabIndex = 2
Me.Label2.Text = "Datum von"
Me.Label2.Visible = False
'
'txtBPNr
'
Me.txtBPNr.Location = New System.Drawing.Point(569, 20)
Me.txtBPNr.Name = "txtBPNr"
Me.txtBPNr.Size = New System.Drawing.Size(100, 20)
Me.txtBPNr.TabIndex = 1
Me.txtBPNr.Visible = False
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(487, 23)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(38, 13)
Me.Label1.TabIndex = 0
Me.Label1.Text = "BP-Nr."
Me.Label1.Visible = False
'
'ToolStrip1
'
Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripButton1})
Me.ToolStrip1.Location = New System.Drawing.Point(0, 0)
Me.ToolStrip1.Name = "ToolStrip1"
Me.ToolStrip1.Size = New System.Drawing.Size(859, 25)
Me.ToolStrip1.TabIndex = 12
Me.ToolStrip1.Text = "ToolStrip1"
'
'ToolStripButton1
'
Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image)
Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta
Me.ToolStripButton1.Name = "ToolStripButton1"
Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22)
Me.ToolStripButton1.Text = "Fenster schliessen"
'
'OpenFileDialog1
'
Me.OpenFileDialog1.FileName = "OpenFileDialog1"
'
'DokList
'
Me.DokList.AllowUpdateOnBlur = False
Me.DokList.AlternatingRows = True
Me.DokList.Cursor = System.Windows.Forms.Cursors.Default
Me.DokList.Dock = System.Windows.Forms.DockStyle.Fill
Me.DokList.FetchRowStyles = True
Me.DokList.FilterBar = True
Me.DokList.GroupByCaption = "Drag a column header here to group by that column"
Me.DokList.Images.Add(CType(resources.GetObject("DokList.Images"), System.Drawing.Image))
Me.DokList.Location = New System.Drawing.Point(0, 180)
Me.DokList.Name = "DokList"
Me.DokList.PreviewInfo.Location = New System.Drawing.Point(0, 0)
Me.DokList.PreviewInfo.Size = New System.Drawing.Size(0, 0)
Me.DokList.PreviewInfo.ZoomFactor = 75.0R
Me.DokList.PrintInfo.PageSettings = CType(resources.GetObject("DokList.PrintInfo.PageSettings"), System.Drawing.Printing.PageSettings)
Me.DokList.ScrollTips = True
Me.DokList.Size = New System.Drawing.Size(859, 304)
Me.DokList.TabIndex = 26
Me.DokList.Text = "C1TrueDBGrid1"
Me.DokList.PropBag = resources.GetString("DokList.PropBag")
'
'frmMD
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(859, 484)
Me.Controls.Add(Me.DokList)
Me.Controls.Add(Me.Panel1)
Me.Controls.Add(Me.ToolStrip1)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.Name = "frmMD"
Me.Text = "Dokumentaufbereitung"
Me.Panel1.ResumeLayout(False)
Me.Panel1.PerformLayout()
Me.ToolStrip1.ResumeLayout(False)
Me.ToolStrip1.PerformLayout()
CType(Me.DokList, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents Panel1 As System.Windows.Forms.Panel
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip
Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton
Friend WithEvents Button4 As System.Windows.Forms.Button
Friend WithEvents Label7 As System.Windows.Forms.Label
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents ListBox2 As System.Windows.Forms.ListBox
Friend WithEvents ListBox1 As System.Windows.Forms.ListBox
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents txtJahrbis As System.Windows.Forms.TextBox
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents txtJahrvon As System.Windows.Forms.TextBox
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents txtBPNr As System.Windows.Forms.TextBox
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents OpenFileDialog1 As System.Windows.Forms.OpenFileDialog
Friend WithEvents Button5 As System.Windows.Forms.Button
Friend WithEvents DokList As C1.Win.C1TrueDBGrid.C1TrueDBGrid
End Class

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,506 @@
Imports System.Data
Imports System.Data.SqlTypes
Imports System.Data.SqlClient
Imports System.ComponentModel
Imports System.Drawing
Imports System.Drawing.Color
Imports System.IO
Imports System.Threading
Imports System.Windows.Forms
Imports System.Data.OleDb
Public Class frmMD
Dim dsempfaenger As New DataSet
Dim NOVA_Partnernr As String
Dim Partnernr As String
Dim PartnerKurzbezeichnung As String
Dim Packagegroesse As String
Dim DelayTime As String
Private Sub BeendenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.Close()
End Sub
Private Function Generic_Select(ByVal bps As String, doktypes As String) As DataTable
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
Dim dbconn As New SqlConnection(Globals.sConnectionString)
scmCmdToExecute.Connection = dbconn
scmCmdToExecute.CommandText = "sp_dokmd"
scmCmdToExecute.CommandType = CommandType.StoredProcedure
Dim jvon As Integer
Dim jbis As Integer
If Trim(Me.txtJahrvon.Text) = "" Then jvon = 0 Else jvon = Me.txtJahrvon.Text
If Trim(Me.txtJahrbis.Text) = "" Then jbis = 0 Else jbis = Me.txtJahrbis.Text
scmCmdToExecute.Parameters.Add(New SqlParameter("@bps", SqlDbType.VarChar, 8000, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, bps))
scmCmdToExecute.Parameters.Add(New SqlParameter("@doktypes", SqlDbType.VarChar, 8000, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, doktypes))
scmCmdToExecute.CommandType = CommandType.StoredProcedure
Dim dtToReturn As DataTable = New DataTable()
Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute)
Try
sdaAdapter.Fill(dtToReturn)
Return dtToReturn
Catch ex As Exception
Throw New Exception("Dokumenterstellung::Generic_Select::" & scmCmdToExecute.CommandText & "::Error occured." & ex.Message, ex)
Finally
scmCmdToExecute.Dispose()
sdaAdapter.Dispose()
End Try
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim bps As String = ""
Dim doktypes As String = ""
For l_index As Integer = 0 To ListBox1.Items.Count - 1
If bps = "" Then
bps = CStr(ListBox1.Items(l_index))
Else
If Not ListBox1.Items(l_index) Is DBNull.Value Then
If CStr(ListBox1.Items(l_index)).ToString <> "" Then bps = bps + ";" + CStr(ListBox1.Items(l_index))
End If
End If
Next
For l_index As Integer = 0 To ListBox2.Items.Count - 1
If doktypes = "" Then
doktypes = CStr(ListBox2.Items(l_index))
Else
If Not ListBox2.Items(l_index) Is DBNull.Value Then
If CStr(ListBox2.Items(l_index)).ToString <> "" Then doktypes = doktypes + ";" + CStr(ListBox2.Items(l_index))
End If
End If
Next
Dim dt As New DataTable
dt = Generic_Select(bps, doktypes)
Me.DokList.DataSource = Nothing
Me.DokList.DataSource = dt
Me.DokList.DataMember = dt.TableName
Me.Button2.Enabled = True
Catch ex As Exception
MsgBox(ex.Message)
Me.Button2.Enabled = False
End Try
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Partnernr = Me.txtBPNr.Text
PartnerKurzbezeichnung = Me.Label5.Text
Dim gendokCold As New Collection()
Dim gendokOffice As New Collection
Dim i As Integer
Dim colRows As C1.Win.C1TrueDBGrid.SelectedRowCollection
colRows = Me.DokList.SelectedRows
If colRows.Count = 0 Then
For i = 0 To Me.DokList.Splits(0).Rows.Count - 1
colRows.Add(i)
Next
End If
'Wenn mehr als ein Dokument selektiert ist dann Meldung zum Fragen anzeigen
If colRows.Count > 1 Then
If MsgBox("Alle markierten Dokumente (" + LTrim(Str(colRows.Count)) + ") drucken?", MsgBoxStyle.YesNo) = MsgBoxResult.No Then
Exit Sub
End If
End If
Me.Cursor = Cursors.WaitCursor
Dim packagenr As Integer
packagenr = CInt(Math.Truncate(colRows.Count / Packagegroesse))
packagenr = packagenr + 1
Dim f As New FrmDokMDSA_Fortschritt
f.MdiParent = Me.MdiParent
f.Show()
f.ProgressBar1.Value = 0
f.ProgressBar1.Maximum = packagenr
'Loop über die Selektierten Dokumente und die Werte je nach Typ in eine Collection abspeichern
Dim RowCunter As Integer = 0
For i = 0 To colRows.Count - 1
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
scmCmdToExecute.CommandText = "dbo.sp_check_dokument"
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, 22, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, Me.DokList.Columns("dokumentid").CellValue(colRows(i))))
scmCmdToExecute.Parameters.Add(New SqlParameter("@office", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, 0))
scmCmdToExecute.Parameters.Add(New SqlParameter("@cold", SqlDbType.Int, 4, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, 0))
sdaAdapter.Fill(dtToReturn)
'Zuerst prüfen ob das Cold Bild vorhanden ist.
If scmCmdToExecute.Parameters("@cold").Value > 0 Then
'DivFnkt.printcolddoc(Me.DokList.Columns("dokumentid").Value, Me, Me.DokList.Columns("dokumentid").Value)
gendokCold.Add(New clsMehrfachdruck_Data(get_colddokumentid(Me.DokList.Columns("dokumentid").CellValue(colRows(i)), 0), NOVA_Partnernr, clsMehrfachdruck_Data.Enum_Typ.EDOKA, False, "", "", "", ""))
Else
If scmCmdToExecute.Parameters("@office").Value > 0 Then
print_office(Me.DokList.Columns("dokumentid").CellValue(colRows(i)), Me)
End If
End If
RowCunter = RowCunter + 1
Catch
End Try
'Try
' 'Host Daten abfüllen
' gendokCold.Add(New clsMehrfachdruck_Data(Me.DokList.Columns("dokumentid").CellValue(colRows(i)), _
' Me.DokList.Columns("partnernr_inhaber").CellValue(colRows(i)), clsMehrfachdruck_Data.Enum_Typ.HOST, False, _
' Me.DokList.Columns("dokumenttypnr").CellValue(colRows(i)), "", _
' Me.DokList.Columns("partnername_inhaber").CellValue(colRows(i)), _
' Me.DokList.Columns("valutadatum").CellValue(colRows(i))))
' RowCunter = RowCunter + 1
' Exit Try
'Catch ex As Exception
'End Try
If RowCunter > Packagegroesse - 1 Then
f.ProgressBar1.Value = f.ProgressBar1.Value + 1
f.Label5.Text = "Druckauftrag " + f.ProgressBar1.Value.ToString + " von " + f.ProgressBar1.Maximum.ToString
f.Label5.Text = f.Label5.Text + " - " + DelayTime.ToString + " Sekunden Wartezeit"
Application.DoEvents()
f.Refresh()
f.BringToFront()
f.Refresh()
RowCunter = 0
fMehrfachdruck.DruckAnfrage(gendokCold, gendokOffice)
f.Refresh()
Application.DoEvents()
gendokCold.Clear()
Application.DoEvents()
f.Refresh()
Dim t1 As DateTime
Dim t2 As DateTime
Threading.Thread.CurrentThread.Sleep(DelayTime * 1000)
gendokCold.Clear()
End If
Next
Try
If gendokCold.Count > 0 Then fMehrfachdruck.DruckAnfrage(gendokCold, gendokOffice)
Application.DoEvents()
Catch ex As Exception
Finally
Me.Cursor = Cursors.Default
End Try
f.Close()
f.Dispose()
End Sub
Public Function get_colddokumentid(ByVal dokumentid As String, ByVal fnkt As Integer) As String
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
scmCmdToExecute.CommandText = "dbo.sp_get_colddokumentid"
scmCmdToExecute.CommandType = CommandType.StoredProcedure
Dim dtToReturn As DataTable = New DataTable()
Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute)
scmCmdToExecute.Connection = conn.scoDBConnection
Try
scmCmdToExecute.Parameters.Add(New SqlParameter("@dokumentid", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, dokumentid))
scmCmdToExecute.Parameters.Add(New SqlParameter("@fnkt", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, fnkt))
scmCmdToExecute.Parameters.Add(New SqlParameter("@colddokumentid", SqlDbType.VarChar, 255, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, ""))
scmCmdToExecute.Parameters.Add(New SqlParameter("@coldpartnernr", SqlDbType.VarChar, 255, ParameterDirection.Output, True, 10, 0, "", DataRowVersion.Proposed, ""))
sdaAdapter.Fill(dtToReturn)
Me.Nova_Partnernr = scmCmdToExecute.Parameters("@coldpartnernr").Value
get_colddokumentid = scmCmdToExecute.Parameters("@colddokumentid").Value
Catch ex As Exception
MsgBox("Status Dokumentbearbeitung::" & scmCmdToExecute.CommandText + "::" + ex.Message)
Finally
scmCmdToExecute.Dispose()
sdaAdapter.Dispose()
dtToReturn.Dispose()
End Try
End Function
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim f As New FrmPartnersuche
f.ShowDialog()
If f.PartnerNr <> 0 Then
Me.txtBPNr.Text = f.PartnerNr
Update_BP()
End If
End Sub
Private Sub txtBPNr_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtBPNr.KeyDown
If e.KeyCode = Keys.Enter Then
Update_BP()
End If
End Sub
Private Sub txtBPNr_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtBPNr.Leave
Update_BP()
End Sub
Private Sub Update_BP()
Try
Dim f As New FrmPartnersuche
f.Partner_Suche(Me.txtBPNr.Text)
If f.PartnerKurzbezeichnnung = "" Then
MsgBox("Eingegebener Parter ist nicht vorhanden", MsgBoxStyle.Critical)
Me.Label5.Text = "[Kein Partner ausgwählt]"
Me.Button1.Enabled = False
Me.Button2.Enabled = False
Else
Me.Label5.Text = f.PartnerKurzbezeichnnung
Me.Button1.Enabled = True
Me.Button2.Enabled = False
End If
Catch
End Try
End Sub
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
Me.Close()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Button1.Enabled = True
Me.Packagegroesse = DivFnkt.Get_Office_2010_Param(31)
Me.DelayTime = DivFnkt.Get_Office_2010_Param(32)
End Sub
Private Sub txtBPNr_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtBPNr.TextChanged
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
dsempfaenger.Tables.Clear()
Me.OpenFileDialog1.Filter = "Excel-Dateien (*.xlsx)|*.xlsx|Excel-Dateien (*.xls)|*.xls|CSV-Dateien (*.csv)|*.csv|Text-Dateien (*.txt)|*.txt|Alle Dateien (*.*)|*.*"
Me.OpenFileDialog1.FileName = ""
Me.OpenFileDialog1.ShowDialog()
If Me.OpenFileDialog1.FileName = "" Then Exit Sub
Me.ListBox1.Items.Clear()
FillDataTableFromText(Me.OpenFileDialog1.FileName)
Try
For Each R As DataRow In dsempfaenger.Tables(0).Rows
Me.ListBox1.Items.Add(R.Item(0))
Next
Catch
End Try
End Sub
Private Function FillDataTableFromText(ByVal file As String) As DataTable
Select Case UCase(Microsoft.VisualBasic.Right(file, 3))
Case "CSV"
Dim csv As New MyNameSpace.CSVDataAdapter(file, True, ";")
csv.Fill(Me.dsempfaenger)
'Rel 4.03 3: Wenn die erste Spalte <> "Parternr" dann Meldung ausgeben und alle Rows löchen
Me.dsempfaenger.Tables(0).TableName = "empfdatatable"
Case "TXT"
Dim csv As New MyNameSpace.CSVDataAdapter(file, True, ";")
csv.Fill(Me.dsempfaenger)
'Rel 4.03 3: Wenn die erste Spalte <> "Parternr" dann Meldung ausgeben und alle Rows löchen
Me.dsempfaenger.Tables(0).TableName = "empfdatatable"
Case "XLS"
If oledbimport(file, "XLS") Then
Me.dsempfaenger.Tables(0).TableName = "empfdatatable"
End If
Case "XLSX"
If oledbimport(file, "XLSX") Then
Me.dsempfaenger.Tables(0).TableName = "empfdatatable"
End If
End Select
'Rel. Office Migration
If UCase(Microsoft.VisualBasic.Right(file, 5)) = ".XLSX" Then
If oledbimport(file, "XLSX") Then
Me.dsempfaenger.Tables(0).TableName = "empfdatatable"
End If
End If
Dim dv As DataRow
End Function
Private Function oledbimport(ByVal file As String, ByVal filetype As String) As Boolean
Dim dt As New DataTable()
Dim conn As OleDbConnection
Dim sql As String
Dim FileConnection As String
Dim oda As New OleDbDataAdapter()
Dim msg As String
Select Case filetype
Case "XLS"
Try
Dim xls As New XLSLib.clsXLSLib
dt = xls.Get_Excel(file)
Me.dsempfaenger.Tables.Add(dt)
Return True
Catch ex As Exception
MsgBox(ex.Message)
End Try
Case "XLSX"
Try
Dim xls As New XLSLib.clsXLSLib
dt = xls.Get_Excel(file)
Me.dsempfaenger.Tables.Add(dt)
Return True
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Select
Try
Try
conn = New OleDbConnection()
conn.ConnectionString = FileConnection
conn.Open()
Catch ex As Exception
msg = ex.Message
End Try
oda = New OleDbDataAdapter(sql, conn)
oda.Fill(dt)
'Rel 4.03 4: Sofern die erste Spalte der importierten Daten keine Partnernummer ist, Meldung ausgeben
Me.dsempfaenger.Tables.Add(dt)
Return True
Catch ex As Exception
Finally
oda.Dispose()
conn.Dispose()
End Try
End Function
Private Function Get_Sheetname(ByVal excelfile As String) As String
Dim f As New frmExcelSheets
f.ExcelFile = excelfile
f.ShowDialog()
If f.DialogResult = Windows.Forms.DialogResult.OK Then
Return f.ExcelSheet
Else
Return ""
End If
End Function
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
dsempfaenger.Tables.Clear()
Me.OpenFileDialog1.Filter = "Excel-Dateien (*.xlsx)|*.xlsx|Excel-Dateien (*.xls)|*.xls|CSV-Dateien (*.csv)|*.csv|Text-Dateien (*.txt)|*.txt|Alle Dateien (*.*)|*.*"
Me.OpenFileDialog1.FileName = ""
Me.OpenFileDialog1.ShowDialog()
If Me.OpenFileDialog1.FileName = "" Then Exit Sub
Me.ListBox2.Items.Clear()
FillDataTableFromText(Me.OpenFileDialog1.FileName)
Try
For Each R As DataRow In dsempfaenger.Tables(0).Rows
Me.ListBox2.Items.Add(R.Item(0))
Next
Catch
End Try
End Sub
Public Function Open_Directory() As Boolean
Open_Directory = True
End Function
Public Function Get_Filename(ByVal fi As String, ByVal partnernr As String) As String
Dim s As String
Get_Filename = ""
If Not Open_Directory() Then Exit Function
s = Globals.Applikationsdaten.Rows(Globals.AppldataRow).Item("pfad_temporaer_dokumente")
Get_Filename = s + fi
End Function
Public Sub print_office(ByVal dokumentid As String, ByVal formx As Form, Optional ByVal ShowPrintMessage As Boolean = True)
Try
Dim doc As New edokadb.clsDokument
Dim Dokument As String
Dim FileReader As New DocMgmt()
doc.cpMainConnectionProvider = conn
doc.sDokumentid = New SqlString(CType(dokumentid, String))
doc.SelectOne()
Dokument = Get_Filename(doc.sDokumentname.Value, "")
If FileReader.Get_From_DB(doc.sDokumentid.Value, Dokument) = False Then
'If BDR_Dokument(dokumentid) Then
' MyMsg.show_standardmessage(240, MsgBoxStyle.Information)
'Else
' MyMsg.show_standardmessage(39, MsgBoxStyle.Information)
'End If
doc.Dispose()
FileReader = Nothing
Exit Sub
End If
doc.Dispose()
FileReader = Nothing
'Office_2010
Dim EXT As String = System.IO.Path.GetExtension(Dokument)
Select Case UCase(EXT.Substring(0, 3))
Case ".DO"
Dim objword As Microsoft.Office.Interop.Word.Application
objword = CreateObject("Word.Application")
Try
Thread.Sleep(1000)
objword.Run("Autoexec")
Catch ex As Exception
End Try
objword.Documents.Open(Dokument)
Threading.Thread.CurrentThread.Sleep(500)
Dim ierror As Integer = 0
Try
objword.Visible = True
objword.WindowState = Microsoft.Office.Interop.Word.WdWindowState.wdWindowStateNormal
Thread.CurrentThread.Sleep(3000)
objword.Documents(1).Activate()
objword.Activate()
Application.DoEvents()
objword.Run("BackGroundPrint")
Thread.CurrentThread.Sleep(3000)
Application.DoEvents()
objword.Visible = False
'objword.WindowState = Microsoft.Office.Interop.Word.WdWindowState.wdWindowStateNormal
Catch ex As Exception
objword.Visible = False
ierror = 1
MsgBox("Das Dokument konnte nicht gedruckt werden." + vbCrLf + vbCrLf + ex.Message)
End Try
Threading.Thread.CurrentThread.Sleep(500)
objword.ActiveDocument.Close(SaveChanges:=False)
objword.Quit()
objword = Nothing
objword = Nothing
If ierror <> 0 Then Exit Select
Exit Sub
Case ".XL"
Dim xls As New Microsoft.Office.Interop.Excel.Application
xls.Workbooks.Open(Dokument)
xls.ActiveWorkbook.Sheets.Select()
xls.ActiveWindow.SelectedSheets.PrintOutEx(Copies:=1)
xls.ActiveWorkbook.Close(SaveChanges:=False)
xls.Quit()
xls = Nothing
Exit Sub
Case Else
Process.Start(Dokument)
End Select
Exit Sub
Catch
'MyMsg.show_standardmessage(92, MsgBoxStyle.Critical)
End Try
End Sub
End Class

262
EDOKA/DokDAMD/DOKSA/frmSA.designer.vb generated Normal file
View File

@@ -0,0 +1,262 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmSA
Inherits System.Windows.Forms.Form
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Wird vom Windows Form-Designer benötigt.
Private components As System.ComponentModel.IContainer
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmSA))
Me.Panel1 = New System.Windows.Forms.Panel()
Me.DTBis = New System.Windows.Forms.DateTimePicker()
Me.Dtvon = New System.Windows.Forms.DateTimePicker()
Me.Label5 = New System.Windows.Forms.Label()
Me.Label4 = New System.Windows.Forms.Label()
Me.Button3 = New System.Windows.Forms.Button()
Me.Button2 = New System.Windows.Forms.Button()
Me.Button1 = New System.Windows.Forms.Button()
Me.txtJahrbis = New System.Windows.Forms.TextBox()
Me.Label3 = New System.Windows.Forms.Label()
Me.txtJahrvon = New System.Windows.Forms.TextBox()
Me.Label2 = New System.Windows.Forms.Label()
Me.txtBPNr = New System.Windows.Forms.TextBox()
Me.Label1 = New System.Windows.Forms.Label()
Me.ToolStrip1 = New System.Windows.Forms.ToolStrip()
Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton()
Me.DokList = New C1.Win.C1TrueDBGrid.C1TrueDBGrid()
Me.Panel1.SuspendLayout()
Me.ToolStrip1.SuspendLayout()
CType(Me.DokList, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'Panel1
'
Me.Panel1.Controls.Add(Me.DTBis)
Me.Panel1.Controls.Add(Me.Dtvon)
Me.Panel1.Controls.Add(Me.Label5)
Me.Panel1.Controls.Add(Me.Label4)
Me.Panel1.Controls.Add(Me.Button3)
Me.Panel1.Controls.Add(Me.Button2)
Me.Panel1.Controls.Add(Me.Button1)
Me.Panel1.Controls.Add(Me.txtJahrbis)
Me.Panel1.Controls.Add(Me.Label3)
Me.Panel1.Controls.Add(Me.txtJahrvon)
Me.Panel1.Controls.Add(Me.Label2)
Me.Panel1.Controls.Add(Me.txtBPNr)
Me.Panel1.Controls.Add(Me.Label1)
Me.Panel1.Dock = System.Windows.Forms.DockStyle.Top
Me.Panel1.Location = New System.Drawing.Point(0, 25)
Me.Panel1.Name = "Panel1"
Me.Panel1.Size = New System.Drawing.Size(859, 84)
Me.Panel1.TabIndex = 1
'
'DTBis
'
Me.DTBis.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
Me.DTBis.Location = New System.Drawing.Point(95, 61)
Me.DTBis.Name = "DTBis"
Me.DTBis.Size = New System.Drawing.Size(110, 20)
Me.DTBis.TabIndex = 12
'
'Dtvon
'
Me.Dtvon.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
Me.Dtvon.Location = New System.Drawing.Point(95, 35)
Me.Dtvon.Name = "Dtvon"
Me.Dtvon.Size = New System.Drawing.Size(110, 20)
Me.Dtvon.TabIndex = 11
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.Location = New System.Drawing.Point(368, 13)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(0, 13)
Me.Label5.TabIndex = 10
Me.Label5.Tag = "[Kein Partner ausgwählt]"
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(217, 13)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(92, 13)
Me.Label4.TabIndex = 9
Me.Label4.Text = "Kurzbezeichnung:"
'
'Button3
'
Me.Button3.Image = CType(resources.GetObject("Button3.Image"), System.Drawing.Image)
Me.Button3.Location = New System.Drawing.Point(190, 8)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(21, 21)
Me.Button3.TabIndex = 8
Me.Button3.UseVisualStyleBackColor = True
'
'Button2
'
Me.Button2.Enabled = False
Me.Button2.Location = New System.Drawing.Point(728, 38)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(107, 23)
Me.Button2.TabIndex = 7
Me.Button2.Text = "Daten aufbereiten"
Me.Button2.UseVisualStyleBackColor = True
'
'Button1
'
Me.Button1.Enabled = False
Me.Button1.Location = New System.Drawing.Point(728, 8)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(107, 23)
Me.Button1.TabIndex = 6
Me.Button1.Text = "Daten auselsen"
Me.Button1.UseVisualStyleBackColor = True
'
'txtJahrbis
'
Me.txtJahrbis.Location = New System.Drawing.Point(394, 61)
Me.txtJahrbis.Name = "txtJahrbis"
Me.txtJahrbis.Size = New System.Drawing.Size(54, 20)
Me.txtJahrbis.TabIndex = 5
Me.txtJahrbis.Text = "2011"
Me.txtJahrbis.Visible = False
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(13, 64)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(54, 13)
Me.Label3.TabIndex = 4
Me.Label3.Text = "Datum bis"
'
'txtJahrvon
'
Me.txtJahrvon.Location = New System.Drawing.Point(403, 35)
Me.txtJahrvon.Name = "txtJahrvon"
Me.txtJahrvon.Size = New System.Drawing.Size(54, 20)
Me.txtJahrvon.TabIndex = 3
Me.txtJahrvon.Text = "2002"
Me.txtJahrvon.Visible = False
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(13, 38)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(59, 13)
Me.Label2.TabIndex = 2
Me.Label2.Text = "Datum von"
'
'txtBPNr
'
Me.txtBPNr.Location = New System.Drawing.Point(95, 9)
Me.txtBPNr.Name = "txtBPNr"
Me.txtBPNr.Size = New System.Drawing.Size(100, 20)
Me.txtBPNr.TabIndex = 1
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(13, 12)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(50, 13)
Me.Label1.TabIndex = 0
Me.Label1.Text = "Partnernr"
'
'ToolStrip1
'
Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripButton1})
Me.ToolStrip1.Location = New System.Drawing.Point(0, 0)
Me.ToolStrip1.Name = "ToolStrip1"
Me.ToolStrip1.Size = New System.Drawing.Size(859, 25)
Me.ToolStrip1.TabIndex = 12
Me.ToolStrip1.Text = "ToolStrip1"
'
'ToolStripButton1
'
Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image)
Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta
Me.ToolStripButton1.Name = "ToolStripButton1"
Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22)
Me.ToolStripButton1.Text = "Fenster schliessen"
'
'DokList
'
Me.DokList.AllowUpdateOnBlur = False
Me.DokList.AlternatingRows = True
Me.DokList.Cursor = System.Windows.Forms.Cursors.Default
Me.DokList.Dock = System.Windows.Forms.DockStyle.Fill
Me.DokList.FetchRowStyles = True
Me.DokList.FilterBar = True
Me.DokList.GroupByCaption = "Drag a column header here to group by that column"
Me.DokList.Images.Add(CType(resources.GetObject("DokList.Images"), System.Drawing.Image))
Me.DokList.Location = New System.Drawing.Point(0, 109)
Me.DokList.Name = "DokList"
Me.DokList.PreviewInfo.Location = New System.Drawing.Point(0, 0)
Me.DokList.PreviewInfo.Size = New System.Drawing.Size(0, 0)
Me.DokList.PreviewInfo.ZoomFactor = 75.0R
Me.DokList.PrintInfo.PageSettings = CType(resources.GetObject("DokList.PrintInfo.PageSettings"), System.Drawing.Printing.PageSettings)
Me.DokList.ScrollTips = True
Me.DokList.Size = New System.Drawing.Size(859, 239)
Me.DokList.TabIndex = 27
Me.DokList.Text = "C1TrueDBGrid1"
Me.DokList.PropBag = resources.GetString("DokList.PropBag")
'
'frmSA
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(859, 348)
Me.Controls.Add(Me.DokList)
Me.Controls.Add(Me.Panel1)
Me.Controls.Add(Me.ToolStrip1)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.Name = "frmSA"
Me.Text = "Dokumentaufbereitung"
Me.Panel1.ResumeLayout(False)
Me.Panel1.PerformLayout()
Me.ToolStrip1.ResumeLayout(False)
Me.ToolStrip1.PerformLayout()
CType(Me.DokList, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents Panel1 As System.Windows.Forms.Panel
Friend WithEvents txtJahrbis As System.Windows.Forms.TextBox
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents txtJahrvon As System.Windows.Forms.TextBox
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents txtBPNr As System.Windows.Forms.TextBox
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip
Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton
Friend WithEvents DokList As C1.Win.C1TrueDBGrid.C1TrueDBGrid
Friend WithEvents DTBis As System.Windows.Forms.DateTimePicker
Friend WithEvents Dtvon As System.Windows.Forms.DateTimePicker
End Class

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,202 @@
Imports System.Data
Imports System.Data.SqlTypes
Imports System.Data.SqlClient
Imports System.ComponentModel
Imports System.Drawing
Imports System.Drawing.Color
Imports System.IO
Imports System.Threading
Imports System.Windows.Forms
Public Class frmSA
Dim Partnernr As String
Dim PartnerKurzbezeichnung As String
Dim Packagegroesse As String
Dim DelayTime As String
Private Sub BeendenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.Close()
End Sub
Private Function Generic_Select() As DataTable
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
Dim dbconn As New SqlConnection(Globals.sConnectionString)
scmCmdToExecute.Connection = dbconn
scmCmdToExecute.CommandText = "sp_selbstanzeigen"
scmCmdToExecute.CommandType = CommandType.StoredProcedure
Dim jvon As DateTime
Dim jbis As DateTime
jvon = Me.Dtvon.Value
jbis = Me.DTBis.Value
'If Trim(Me.txtJahrvon.Text) = "" Then jvon = 0 Else jvon = Me.txtJahrvon.Text
'If Trim(Me.txtJahrbis.Text) = "" Then jbis = 0 Else jbis = Me.txtJahrbis.Text
scmCmdToExecute.Parameters.Add(New SqlParameter("@bpnr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, Me.txtBPNr.Text))
scmCmdToExecute.Parameters.Add(New SqlParameter("@dvon", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, jvon))
scmCmdToExecute.Parameters.Add(New SqlParameter("@dbis", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, jbis))
scmCmdToExecute.CommandType = CommandType.StoredProcedure
Dim dtToReturn As DataTable = New DataTable()
Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute)
Try
sdaAdapter.Fill(dtToReturn)
Return dtToReturn
Catch ex As Exception
Throw New Exception("Dokumenterstellung::Generic_Select::" & scmCmdToExecute.CommandText & "::Error occured." & ex.Message, ex)
Finally
scmCmdToExecute.Dispose()
sdaAdapter.Dispose()
End Try
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim dt As New DataTable
dt = Generic_Select()
Me.DokList.DataSource = Nothing
Me.DokList.DataSource = dt
Me.DokList.DataMember = dt.TableName
Me.Button2.Enabled = True
Catch ex As Exception
MsgBox(ex.Message)
Me.Button2.Enabled = False
End Try
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Partnernr = Me.txtBPNr.Text
PartnerKurzbezeichnung = Me.Label5.Text
Dim gendokCold As New Collection()
Dim gendokOffice As New Collection
Dim i As Integer
Dim colRows As C1.Win.C1TrueDBGrid.SelectedRowCollection
colRows = Me.DokList.SelectedRows
If colRows.Count = 0 Then
For i = 0 To Me.DokList.Splits(0).Rows.Count - 1
colRows.Add(i)
Next
End If
'Wenn mehr als ein Dokument selektiert ist dann Meldung zum Fragen anzeigen
If colRows.Count > 1 Then
If MsgBox("Alle markierten Dokumente (" + LTrim(Str(colRows.Count)) + ") drucken?", MsgBoxStyle.YesNo) = MsgBoxResult.No Then
Exit Sub
End If
End If
Me.Cursor = Cursors.WaitCursor
Dim packagenr As Integer
packagenr = CInt(Math.Truncate(colRows.Count / Packagegroesse))
packagenr = packagenr + 1
Dim f As New FrmDokMDSA_Fortschritt
f.MdiParent = Me.MdiParent
f.Show()
f.ProgressBar1.Value = 0
f.ProgressBar1.Maximum = packagenr
'Loop über die Selektierten Dokumente und die Werte je nach Typ in eine Collection abspeichern
Dim RowCunter As Integer = 0
For i = 0 To colRows.Count - 1
Try
'Host Daten abfüllen
gendokCold.Add(New clsMehrfachdruck_Data(Me.DokList.Columns("dokumentid").CellValue(colRows(i)), _
Me.DokList.Columns("partnernr_inhaber").CellValue(colRows(i)), clsMehrfachdruck_Data.Enum_Typ.HOST, False, _
Me.DokList.Columns("dokumenttypnr").CellValue(colRows(i)), "", _
Me.DokList.Columns("partnername_inhaber").CellValue(colRows(i)), _
Me.DokList.Columns("valutadatum").CellValue(colRows(i))))
RowCunter = RowCunter + 1
Exit Try
Catch ex As Exception
End Try
If RowCunter > Packagegroesse - 1 Then
f.ProgressBar1.Value = f.ProgressBar1.Value + 1
f.Label5.Text = "Druckauftrag " + f.ProgressBar1.Value.ToString + " von " + f.ProgressBar1.Maximum.ToString
f.Label5.Text = f.Label5.Text + " - " + DelayTime.ToString + " Sekunden Wartezeit"
Application.DoEvents()
f.Refresh()
f.BringToFront()
f.Refresh()
RowCunter = 0
fMehrfachdruck.DruckAnfrage(gendokCold, gendokOffice)
f.Refresh()
Application.DoEvents()
gendokCold.Clear()
Application.DoEvents()
f.Refresh()
Dim t1 As DateTime
Dim t2 As DateTime
Threading.Thread.CurrentThread.Sleep(DelayTime * 1000)
gendokCold.Clear()
End If
Next
Try
If gendokCold.Count > 0 Then fMehrfachdruck.DruckAnfrage(gendokCold, gendokOffice)
Application.DoEvents()
Catch ex As Exception
Finally
Me.Cursor = Cursors.Default
End Try
f.Close()
f.Dispose()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim f As New FrmPartnersuche
f.ShowDialog()
If f.PartnerNr <> 0 Then
Me.txtBPNr.Text = f.PartnerNr
Update_BP()
End If
End Sub
Private Sub txtBPNr_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtBPNr.KeyDown
If e.KeyCode = Keys.Enter Then
Update_BP()
End If
End Sub
Private Sub txtBPNr_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtBPNr.Leave
Update_BP()
End Sub
Private Sub Update_BP()
Try
If Me.txtBPNr.Text = "" Then Exit Sub
Dim f As New FrmPartnersuche
f.Partner_Suche(Me.txtBPNr.Text)
If f.PartnerKurzbezeichnnung = "" Then
MsgBox("Eingegebener Parter ist nicht vorhanden", MsgBoxStyle.Critical)
Me.Label5.Text = "[Kein Partner ausgwählt]"
Me.Button1.Enabled = False
Me.Button2.Enabled = False
Else
Me.Label5.Text = f.PartnerKurzbezeichnnung
Me.Button1.Enabled = True
Me.Button2.Enabled = False
End If
Catch
End Try
End Sub
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
Me.Close()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Packagegroesse = DivFnkt.Get_Office_2010_Param(33)
Me.DelayTime = DivFnkt.Get_Office_2010_Param(34)
Me.Dtvon.Value = DivFnkt.Get_Office_2010_Param(35)
Me.DTBis.Value = DivFnkt.Get_Office_2010_Param(36)
End Sub
Private Sub txtBPNr_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtBPNr.TextChanged
End Sub
End Class

View File

@@ -0,0 +1,108 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FrmDokMDSA_Fortschritt
Inherits System.Windows.Forms.Form
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Wird vom Windows Form-Designer benötigt.
Private components As System.ComponentModel.IContainer
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.Label5 = New System.Windows.Forms.Label()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label3 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label1 = New System.Windows.Forms.Label()
Me.ProgressBar1 = New System.Windows.Forms.ProgressBar()
Me.SuspendLayout()
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.Location = New System.Drawing.Point(12, 12)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(69, 13)
Me.Label5.TabIndex = 11
Me.Label5.Text = "Druckauftrag"
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(488, 31)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(25, 13)
Me.Label4.TabIndex = 10
Me.Label4.Text = "100"
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(252, 34)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(19, 13)
Me.Label3.TabIndex = 9
Me.Label3.Text = "50"
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(253, 34)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(19, 13)
Me.Label2.TabIndex = 8
Me.Label2.Text = "50"
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(9, 31)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(13, 13)
Me.Label1.TabIndex = 7
Me.Label1.Text = "0"
'
'ProgressBar1
'
Me.ProgressBar1.Location = New System.Drawing.Point(12, 47)
Me.ProgressBar1.Name = "ProgressBar1"
Me.ProgressBar1.Size = New System.Drawing.Size(498, 23)
Me.ProgressBar1.TabIndex = 6
'
'FrmDokMDSA_Fortschritt
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(517, 92)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.ProgressBar1)
Me.Name = "FrmDokMDSA_Fortschritt"
Me.Text = "Fortschrittsanzeige"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents ProgressBar1 As System.Windows.Forms.ProgressBar
End Class

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,3 @@
Public Class FrmDokMDSA_Fortschritt
End Class