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.
283 lines
14 KiB
283 lines
14 KiB
Imports System.Data
|
|
Imports System.Data.SqlTypes
|
|
Imports System.Data.SqlClient
|
|
Imports System.ComponentModel
|
|
Imports System.Drawing
|
|
Imports System.Drawing.Color
|
|
Public Class frmFAQ
|
|
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 ToolBarButton1 As System.Windows.Forms.ToolBarButton
|
|
Friend WithEvents DokList As C1.Win.C1TrueDBGrid.C1TrueDBGrid
|
|
Friend WithEvents Button1 As System.Windows.Forms.Button
|
|
Friend WithEvents Label1 As System.Windows.Forms.Label
|
|
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
|
|
Friend WithEvents ToolBarButton2 As System.Windows.Forms.ToolBarButton
|
|
Friend WithEvents ImageList1 As System.Windows.Forms.ImageList
|
|
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
|
|
Me.components = New System.ComponentModel.Container()
|
|
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmFAQ))
|
|
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.DokList = New C1.Win.C1TrueDBGrid.C1TrueDBGrid()
|
|
Me.Button1 = New System.Windows.Forms.Button()
|
|
Me.Label1 = New System.Windows.Forms.Label()
|
|
Me.TextBox1 = New System.Windows.Forms.TextBox()
|
|
Me.ToolBarButton2 = New System.Windows.Forms.ToolBarButton()
|
|
Me.ImageList1 = New System.Windows.Forms.ImageList(Me.components)
|
|
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(832, 25)
|
|
Me.ToolBar1.TabIndex = 0
|
|
'
|
|
'ToolBarButton1
|
|
'
|
|
Me.ToolBarButton1.ImageIndex = 0
|
|
'
|
|
'DokList
|
|
'
|
|
Me.DokList.AllowFilter = True
|
|
Me.DokList.AllowSort = True
|
|
Me.DokList.AllowUpdate = False
|
|
Me.DokList.AllowUpdateOnBlur = False
|
|
Me.DokList.AlternatingRows = True
|
|
Me.DokList.CaptionHeight = 17
|
|
Me.DokList.CollapseColor = System.Drawing.Color.Black
|
|
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 = 17
|
|
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(832, 484)
|
|
Me.DokList.TabIndex = 28
|
|
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{Wrap" & _
|
|
":True;Trimming:None;BackColor:White;}Selected{ForeColor:HighlightText;BackColor:" & _
|
|
"Highlight;}Heading{Wrap:True;BackColor:Control;Border:Raised,,1, 1, 1, 1;ForeCol" & _
|
|
"or:ControlText;AlignVert:Center;}Inactive{ForeColor:InactiveCaptionText;BackColo" & _
|
|
"r:InactiveCaption;}FilterBar{BackColor:255, 255, 192;}Footer{}Caption{AlignHorz:" & _
|
|
"Center;}Editor{}Normal{Wrap:True;BackColor:Control;}Style27{}Style26{}HighlightR" & _
|
|
"ow{ForeColor:HighlightText;BackColor:Highlight;}Style1{}OddRow{Wrap:True;AlignHo" & _
|
|
"rz:General;BackColor:224, 224, 224;}RecordSelector{AlignImage:Center;}Style9{}St" & _
|
|
"yle8{}Style3{}Style2{}Group{AlignVert:Center;Border:None,,0, 0, 0, 0;BackColor:C" & _
|
|
"ontrolDark;}Style10{AlignHorz:Near;}</Data></Styles><Splits><C1.Win.C1TrueDBGrid" & _
|
|
".MergeView Name="""" AllowRowSizing=""IndividualRows"" AlternatingRowStyle=""True"" Ca" & _
|
|
"ptionHeight=""17"" ColumnCaptionHeight=""17"" ColumnFooterHeight=""17"" FetchRowStyles" & _
|
|
"=""True"" FilterBar=""True"" MarqueeStyle=""DottedCellBorder"" RecordSelectorWidth=""17" & _
|
|
""" DefRecSelWidth=""17"" VerticalScrollGroup=""1"" HorizontalScrollGroup=""1""><ClientR" & _
|
|
"ect>0, 0, 828, 480</ClientRect><BorderSide>0</BorderSide><CaptionStyle parent=""H" & _
|
|
"eading"" me=""Style10"" /><EditorStyle parent=""Editor"" me=""Style2"" /><EvenRowStyle " & _
|
|
"parent=""EvenRow"" me=""Style8"" /><FilterBarStyle parent=""FilterBar"" me=""Style27"" /" & _
|
|
"><FooterStyle parent=""Footer"" me=""Style4"" /><GroupStyle parent=""Group"" me=""Style" & _
|
|
"12"" /><HeadingStyle parent=""Heading"" me=""Style3"" /><HighLightRowStyle parent=""Hi" & _
|
|
"ghlightRow"" me=""Style7"" /><InactiveStyle parent=""Inactive"" me=""Style6"" /><OddRow" & _
|
|
"Style parent=""OddRow"" me=""Style9"" /><RecordSelectorStyle parent=""RecordSelector""" & _
|
|
" me=""Style11"" /><SelectedStyle parent=""Selected"" me=""Style5"" /><Style parent=""No" & _
|
|
"rmal"" me=""Style1"" /></C1.Win.C1TrueDBGrid.MergeView></Splits><NamedStyles><Style" & _
|
|
" parent="""" me=""Normal"" /><Style parent=""Normal"" me=""Heading"" /><Style parent=""He" & _
|
|
"ading"" me=""Footer"" /><Style parent=""Heading"" me=""Caption"" /><Style parent=""Headi" & _
|
|
"ng"" me=""Inactive"" /><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" & _
|
|
"=""RecordSelector"" /><Style parent=""Normal"" me=""FilterBar"" /><Style parent=""Capti" & _
|
|
"on"" me=""Group"" /></NamedStyles><vertSplits>1</vertSplits><horzSplits>1</horzSpli" & _
|
|
"ts><Layout>Modified</Layout><DefaultRecSelWidth>17</DefaultRecSelWidth><ClientAr" & _
|
|
"ea>0, 0, 828, 480</ClientArea></Blob>"
|
|
'
|
|
'Button1
|
|
'
|
|
Me.Button1.Image = CType(resources.GetObject("Button1.Image"), System.Drawing.Bitmap)
|
|
Me.Button1.Location = New System.Drawing.Point(320, 3)
|
|
Me.Button1.Name = "Button1"
|
|
Me.Button1.Size = New System.Drawing.Size(24, 23)
|
|
Me.Button1.TabIndex = 31
|
|
'
|
|
'Label1
|
|
'
|
|
Me.Label1.Location = New System.Drawing.Point(56, 7)
|
|
Me.Label1.Name = "Label1"
|
|
Me.Label1.Size = New System.Drawing.Size(48, 23)
|
|
Me.Label1.TabIndex = 30
|
|
Me.Label1.Text = "Suchen:"
|
|
'
|
|
'TextBox1
|
|
'
|
|
Me.TextBox1.Location = New System.Drawing.Point(104, 3)
|
|
Me.TextBox1.Name = "TextBox1"
|
|
Me.TextBox1.Size = New System.Drawing.Size(214, 20)
|
|
Me.TextBox1.TabIndex = 29
|
|
Me.TextBox1.Text = ""
|
|
'
|
|
'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.ImageStream = CType(resources.GetObject("ImageList1.ImageStream"), System.Windows.Forms.ImageListStreamer)
|
|
Me.ImageList1.TransparentColor = System.Drawing.Color.Transparent
|
|
'
|
|
'frmFAQ
|
|
'
|
|
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
|
|
Me.ClientSize = New System.Drawing.Size(832, 509)
|
|
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.DokList, Me.Button1, Me.Label1, Me.TextBox1, Me.ToolBar1})
|
|
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
|
|
Me.Name = "frmFAQ"
|
|
Me.ShowInTaskbar = False
|
|
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
|
|
Me.Text = "FAQ"
|
|
CType(Me.DokList, System.ComponentModel.ISupportInitialize).EndInit()
|
|
Me.ResumeLayout(False)
|
|
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
Private Sub frmFAQ_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
|
Update_List("")
|
|
End Sub
|
|
|
|
|
|
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
|
|
Update_List(Me.TextBox1.Text)
|
|
End Sub
|
|
|
|
Private Sub Update_List(ByVal searchstring As String)
|
|
Dim d As DataTable
|
|
Dim i As Integer
|
|
d = Get_Data(searchstring)
|
|
Me.DokList.DataSource = d
|
|
DivFnkt.SpaltenTitel_Aktualisieren(Me.DokList, d, "faq")
|
|
For i = 0 To Me.DokList.Splits(0).Rows.Count - 1
|
|
Me.DokList.Splits(0).Rows(i).AutoSize()
|
|
Next
|
|
End Sub
|
|
|
|
Private Function Get_Data(ByVal searchstring As String) As DataTable
|
|
Dim scmCmdToExecute As SqlCommand = New SqlCommand()
|
|
Dim dtToReturn As DataTable = New DataTable()
|
|
Dim sdaAdapter As SqlDataAdapter = New SqlDataAdapter(scmCmdToExecute)
|
|
scmCmdToExecute.CommandText = "dbo.SP_faq"
|
|
scmCmdToExecute.CommandType = CommandType.StoredProcedure
|
|
scmCmdToExecute.Connection = conn.scoDBConnection
|
|
Try
|
|
scmCmdToExecute.Parameters.Add(New SqlParameter("@searchstring", SqlDbType.VarChar, 255, ParameterDirection.Input, True, 10, 0, "", DataRowVersion.Proposed, searchstring))
|
|
sdaAdapter.Fill(dtToReturn)
|
|
Return dtToReturn
|
|
Catch ex As Exception
|
|
' // some error occured. Bubble it to caller and encapsulate Exception object
|
|
Throw New Exception("Dokument_Information_Wert::" & scmCmdToExecute.CommandText & "::Error occured." & ex.Message, ex)
|
|
Finally
|
|
scmCmdToExecute.Dispose()
|
|
sdaAdapter.Dispose()
|
|
End Try
|
|
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 'close button
|
|
Me.Close()
|
|
Case 1
|
|
'2003-12-02 - Druck FAQ - S. Hutter
|
|
Dim fontbold As New Font("Arial", 12, FontStyle.Bold)
|
|
Dim fontregular As New Font("Arial", 12, FontStyle.Regular)
|
|
|
|
With DokList.PrintInfo
|
|
.PageHeaderStyle.Font = fontbold
|
|
.PageSettings.Margins.Bottom = 20
|
|
.PageSettings.Margins.Top = 80
|
|
.PageHeader = "FAQ EDOKA-Version " + Globals.Version + "/" + Globals.Versionsdatum
|
|
.PageSettings.Landscape = True
|
|
.PageFooter = "Seite \p von \P" & vbLf & " Druckdatum " & Now()
|
|
.ShowProgressForm = True
|
|
.UseGridColors = True
|
|
.RepeatColumnHeaders = True
|
|
.VarRowHeight = DokList.PrintInfo.RowHeightEnum.StretchToFit
|
|
.WrapText = C1.Win.C1TrueDBGrid.PrintInfo.WrapTextEnum.LikeColumn
|
|
.PageBreak = DokList.PrintInfo.PageBreaksEnum.FitIntoArea
|
|
.FillAreaWidth = DokList.PrintInfo.FillEmptyEnum.ExtendLast
|
|
.PrintPreview()
|
|
End With
|
|
End Select
|
|
End Sub
|
|
|
|
Private Sub TextBox1_Layout(ByVal sender As Object, ByVal e As System.Windows.Forms.LayoutEventArgs) Handles TextBox1.Layout
|
|
|
|
End Sub
|
|
|
|
Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
|
|
If e.KeyCode = Keys.Enter Then
|
|
Update_List(Me.TextBox1.Text)
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
|
|
|
|
End Sub
|
|
|
|
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
|
|
Update_List(Me.TextBox1.Text)
|
|
End Sub
|
|
End Class
|