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.
295 lines
14 KiB
295 lines
14 KiB
Imports System.Data
|
|
Imports System.Data.SqlTypes
|
|
Imports System.Data.SqlClient
|
|
|
|
Public Class frmOffeneDPInstanzen
|
|
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 ImageList1 As System.Windows.Forms.ImageList
|
|
Friend WithEvents ToolBarButton1 As System.Windows.Forms.ToolBarButton
|
|
Friend WithEvents DokList As C1.Win.C1TrueDBGrid.C1TrueDBGrid
|
|
Friend WithEvents ContextMenu1 As System.Windows.Forms.ContextMenu
|
|
Friend WithEvents ToolBarButton2 As System.Windows.Forms.ToolBarButton
|
|
Friend WithEvents mnuOpen As System.Windows.Forms.MenuItem
|
|
Friend WithEvents MnuDelete As System.Windows.Forms.MenuItem
|
|
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
|
|
Me.components = New System.ComponentModel.Container()
|
|
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmOffeneDPInstanzen))
|
|
Dim GridLines1 As C1.Win.C1TrueDBGrid.Util.GridLines = New C1.Win.C1TrueDBGrid.Util.GridLines()
|
|
Me.ToolBar1 = 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.DokList = New C1.Win.C1TrueDBGrid.C1TrueDBGrid()
|
|
Me.ContextMenu1 = New System.Windows.Forms.ContextMenu()
|
|
Me.mnuOpen = New System.Windows.Forms.MenuItem()
|
|
Me.MnuDelete = New System.Windows.Forms.MenuItem()
|
|
CType(Me.DokList, System.ComponentModel.ISupportInitialize).BeginInit()
|
|
Me.SuspendLayout()
|
|
'
|
|
'ToolBar1
|
|
'
|
|
Me.ToolBar1.Buttons.AddRange(New System.Windows.Forms.ToolBarButton() {Me.ToolBarButton1, Me.ToolBarButton2})
|
|
Me.ToolBar1.DropDownArrows = True
|
|
Me.ToolBar1.ImageList = Me.ImageList1
|
|
Me.ToolBar1.Name = "ToolBar1"
|
|
Me.ToolBar1.ShowToolTips = True
|
|
Me.ToolBar1.Size = New System.Drawing.Size(608, 25)
|
|
Me.ToolBar1.TabIndex = 0
|
|
'
|
|
'ToolBarButton1
|
|
'
|
|
Me.ToolBarButton1.ImageIndex = 0
|
|
'
|
|
'ToolBarButton2
|
|
'
|
|
Me.ToolBarButton2.ImageIndex = 3
|
|
'
|
|
'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
|
|
'
|
|
'DokList
|
|
'
|
|
Me.DokList.AllowFilter = True
|
|
Me.DokList.AllowRowSizing = C1.Win.C1TrueDBGrid.RowSizingEnum.AllRows
|
|
Me.DokList.AllowSort = True
|
|
Me.DokList.AllowUpdateOnBlur = False
|
|
Me.DokList.AlternatingRows = True
|
|
Me.DokList.CaptionHeight = 17
|
|
Me.DokList.CollapseColor = System.Drawing.Color.Black
|
|
Me.DokList.ContextMenu = Me.ContextMenu1
|
|
Me.DokList.Cursor = System.Windows.Forms.Cursors.Default
|
|
Me.DokList.DataChanged = False
|
|
Me.DokList.DeadAreaBackColor = System.Drawing.Color.Empty
|
|
Me.DokList.Dock = System.Windows.Forms.DockStyle.Fill
|
|
Me.DokList.ExpandColor = System.Drawing.Color.Black
|
|
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("resource.Images"), System.Drawing.Bitmap))
|
|
Me.DokList.Location = New System.Drawing.Point(0, 25)
|
|
Me.DokList.MarqueeStyle = C1.Win.C1TrueDBGrid.MarqueeEnum.DottedCellBorder
|
|
Me.DokList.MultiSelect = C1.Win.C1TrueDBGrid.MultiSelectEnum.None
|
|
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
|
|
Me.DokList.PrintInfo.ShowOptionsDialog = False
|
|
Me.DokList.RecordSelectorWidth = 16
|
|
GridLines1.Color = System.Drawing.Color.DarkGray
|
|
GridLines1.Style = C1.Win.C1TrueDBGrid.LineStyleEnum.Single
|
|
Me.DokList.RowDivider = GridLines1
|
|
Me.DokList.RowHeight = 15
|
|
Me.DokList.RowSubDividerColor = System.Drawing.Color.DarkGray
|
|
Me.DokList.ScrollTips = True
|
|
Me.DokList.Size = New System.Drawing.Size(608, 276)
|
|
Me.DokList.TabIndex = 26
|
|
Me.DokList.Text = "C1TrueDBGrid1"
|
|
Me.DokList.PropBag = "<?xml version=""1.0""?><Blob><Styles type=""C1.Win.C1TrueDBGrid.Design.ContextWrappe" & _
|
|
"r""><Data>Style11{}Style12{}Style13{}Style5{}Style4{}Style7{}Style6{}EvenRow{Back" & _
|
|
"Color:White;}Selected{ForeColor:HighlightText;BackColor:Highlight;}Heading{Wrap:" & _
|
|
"True;AlignVert:Center;Border:Raised,,1, 1, 1, 1;ForeColor:ControlText;BackColor:" & _
|
|
"Control;}Inactive{ForeColor:InactiveCaptionText;BackColor:InactiveCaption;}Filte" & _
|
|
"rBar{BackColor:255, 255, 192;}OddRow{BackColor:224, 224, 224;}Footer{}Caption{Al" & _
|
|
"ignHorz:Center;}Style27{}Normal{BackColor:Control;}Style26{}HighlightRow{ForeCol" & _
|
|
"or:HighlightText;BackColor:Highlight;}Style10{AlignHorz:Near;}Editor{}RecordSele" & _
|
|
"ctor{AlignImage:Center;}Style9{}Style8{}Style3{}Style2{}Group{BackColor:ControlD" & _
|
|
"ark;Border:None,,0, 0, 0, 0;AlignVert:Center;}Style1{}</Data></Styles><Splits><C" & _
|
|
"1.Win.C1TrueDBGrid.MergeView Name="""" AlternatingRowStyle=""True"" CaptionHeight=""1" & _
|
|
"7"" ColumnCaptionHeight=""17"" ColumnFooterHeight=""17"" FetchRowStyles=""True"" Filter" & _
|
|
"Bar=""True"" MarqueeStyle=""DottedCellBorder"" RecordSelectorWidth=""16"" DefRecSelWid" & _
|
|
"th=""16"" VerticalScrollGroup=""1"" HorizontalScrollGroup=""1""><ClientRect>0, 0, 604," & _
|
|
" 272</ClientRect><BorderSide>0</BorderSide><CaptionStyle parent=""Heading"" me=""St" & _
|
|
"yle10"" /><EditorStyle parent=""Editor"" me=""Style2"" /><EvenRowStyle parent=""EvenRo" & _
|
|
"w"" me=""Style8"" /><FilterBarStyle parent=""FilterBar"" me=""Style27"" /><FooterStyle " & _
|
|
"parent=""Footer"" me=""Style4"" /><GroupStyle parent=""Group"" me=""Style12"" /><Heading" & _
|
|
"Style parent=""Heading"" me=""Style3"" /><HighLightRowStyle parent=""HighlightRow"" me" & _
|
|
"=""Style7"" /><InactiveStyle parent=""Inactive"" me=""Style6"" /><OddRowStyle parent=""" & _
|
|
"OddRow"" me=""Style9"" /><RecordSelectorStyle parent=""RecordSelector"" me=""Style11"" " & _
|
|
"/><SelectedStyle parent=""Selected"" me=""Style5"" /><Style parent=""Normal"" me=""Styl" & _
|
|
"e1"" /></C1.Win.C1TrueDBGrid.MergeView></Splits><NamedStyles><Style parent="""" me=" & _
|
|
"""Normal"" /><Style parent=""Normal"" me=""Heading"" /><Style parent=""Heading"" me=""Foo" & _
|
|
"ter"" /><Style parent=""Heading"" me=""Caption"" /><Style parent=""Heading"" me=""Inacti" & _
|
|
"ve"" /><Style parent=""Normal"" me=""Selected"" /><Style parent=""Normal"" me=""Editor"" " & _
|
|
"/><Style parent=""Normal"" me=""HighlightRow"" /><Style parent=""Normal"" me=""EvenRow""" & _
|
|
" /><Style parent=""Normal"" me=""OddRow"" /><Style parent=""Heading"" me=""RecordSelect" & _
|
|
"or"" /><Style parent=""Normal"" me=""FilterBar"" /><Style parent=""Caption"" me=""Group""" & _
|
|
" /></NamedStyles><vertSplits>1</vertSplits><horzSplits>1</horzSplits><Layout>Mod" & _
|
|
"ified</Layout><DefaultRecSelWidth>16</DefaultRecSelWidth><ClientArea>0, 0, 604, " & _
|
|
"272</ClientArea></Blob>"
|
|
'
|
|
'ContextMenu1
|
|
'
|
|
Me.ContextMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuOpen, Me.MnuDelete})
|
|
'
|
|
'mnuOpen
|
|
'
|
|
Me.mnuOpen.Index = 0
|
|
Me.mnuOpen.Text = "&Dokumentpaket öffnen"
|
|
'
|
|
'MnuDelete
|
|
'
|
|
Me.MnuDelete.Index = 1
|
|
Me.MnuDelete.Text = "&Dokumentpaket löschen"
|
|
'
|
|
'frmOffeneDPInstanzen
|
|
'
|
|
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
|
|
Me.ClientSize = New System.Drawing.Size(608, 301)
|
|
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.DokList, Me.ToolBar1})
|
|
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
|
|
Me.Name = "frmOffeneDPInstanzen"
|
|
Me.Text = "Pendente Dokumentpakete"
|
|
CType(Me.DokList, System.ComponentModel.ISupportInitialize).EndInit()
|
|
Me.ResumeLayout(False)
|
|
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
#Region "Deklarationen"
|
|
Public dpdaten As DataTable
|
|
#End Region
|
|
|
|
|
|
#Region "Init_Load"
|
|
Private Sub frmOffeneDPInstanzen_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
|
Load_Data()
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
#Region "Formhandling"
|
|
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 ' Close
|
|
Me.Close()
|
|
Case 1
|
|
Load_Data()
|
|
End Select
|
|
End Sub
|
|
|
|
Private Sub DokList_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DokList.MouseDown
|
|
Me.DokList.Bookmark = Me.DokList.RowContaining(e.Y)
|
|
End Sub
|
|
|
|
Private Sub DokList_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles DokList.DoubleClick
|
|
Dim f As New frmDokumentpaket(Me.DokList.Columns(0).Value)
|
|
f.MdiParent = Me.MdiParent
|
|
f.Show()
|
|
End Sub
|
|
|
|
Private Sub mnuOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuOpen.Click
|
|
Me.DokList_DoubleClick(sender, e)
|
|
End Sub
|
|
|
|
Private Sub MnuDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MnuDelete.Click
|
|
Generic_Select(2)
|
|
Load_Data()
|
|
|
|
End Sub
|
|
|
|
|
|
#End Region
|
|
|
|
#Region "Daten"
|
|
|
|
Public Sub Load_Data()
|
|
Me.DokList.DataSource = Nothing
|
|
Me.DokList.DataMember = Nothing
|
|
dpdaten = Generic_Select(1)
|
|
Me.DokList.DataSource = dpdaten
|
|
Me.DokList.DataMember = dpdaten.TableName
|
|
DivFnkt.SpaltenTitel_Aktualisieren(Me.DokList, dpdaten, "DPInstanz")
|
|
|
|
Dim bmp1 As New Bitmap(Me.ImageList1.Images(1))
|
|
Dim bmp2 As New Bitmap(Me.ImageList1.Images(2))
|
|
|
|
Dim v1 As New C1.Win.C1TrueDBGrid.ValueItem()
|
|
Dim v2 As New C1.Win.C1TrueDBGrid.ValueItem()
|
|
|
|
v1.DisplayValue = bmp1
|
|
v1.Value = 0
|
|
|
|
v2.DisplayValue = bmp2
|
|
v2.Value = 1
|
|
|
|
Me.DokList.Columns(1).ValueItems.Values.Add(v1)
|
|
Me.DokList.Columns(1).ValueItems.Values.Add(v2)
|
|
|
|
Me.DokList.Columns(1).ValueItems.Translate = True
|
|
|
|
End Sub
|
|
|
|
Public Function Generic_Select(ByVal typ As Integer) As DataTable
|
|
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
|
Select Case typ
|
|
Case 1, 2
|
|
scmCmdToExecute.CommandText = "edex_sp_dpinstanz"
|
|
Case Else
|
|
End Select
|
|
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
|
Dim dtToReturn As DataTable = New DataTable()
|
|
Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute)
|
|
|
|
Select Case typ
|
|
Case 1
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@mitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, Globals.MitarbeiterNr))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@dpinstanznr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, 0))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@fnkt", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, 1))
|
|
Case 2
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@mitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, Globals.MitarbeiterNr))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@dpinstanznr", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, Me.DokList.Columns(0).Value))
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@fnkt", SqlDbType.Int, 4, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, 2))
|
|
|
|
End Select
|
|
|
|
scmCmdToExecute.Connection = conn.scoDBConnection
|
|
Try
|
|
sdaAdapter.Fill(dtToReturn)
|
|
Return dtToReturn
|
|
Catch ex As Exception
|
|
Throw New Exception("Dokumentpaket::Generic_Select::" & scmCmdToExecute.CommandText & "::Error occured." & ex.Message, ex)
|
|
Finally
|
|
scmCmdToExecute.Dispose()
|
|
sdaAdapter.Dispose()
|
|
End Try
|
|
End Function
|
|
#End Region
|
|
|
|
|
|
End Class
|