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.
256 lines
11 KiB
256 lines
11 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.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmFAQ))
|
|
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.Button1 = New System.Windows.Forms.Button
|
|
Me.Label1 = New System.Windows.Forms.Label
|
|
Me.TextBox1 = New System.Windows.Forms.TextBox
|
|
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.Location = New System.Drawing.Point(0, 0)
|
|
Me.ToolBar1.Name = "ToolBar1"
|
|
Me.ToolBar1.ShowToolTips = True
|
|
Me.ToolBar1.Size = New System.Drawing.Size(832, 28)
|
|
Me.ToolBar1.TabIndex = 0
|
|
'
|
|
'ToolBarButton1
|
|
'
|
|
Me.ToolBarButton1.ImageIndex = 0
|
|
Me.ToolBarButton1.Name = "ToolBarButton1"
|
|
'
|
|
'ToolBarButton2
|
|
'
|
|
Me.ToolBarButton2.ImageIndex = 1
|
|
Me.ToolBarButton2.Name = "ToolBarButton2"
|
|
'
|
|
'ImageList1
|
|
'
|
|
Me.ImageList1.ImageStream = CType(resources.GetObject("ImageList1.ImageStream"), System.Windows.Forms.ImageListStreamer)
|
|
Me.ImageList1.TransparentColor = System.Drawing.Color.Transparent
|
|
Me.ImageList1.Images.SetKeyName(0, "")
|
|
Me.ImageList1.Images.SetKeyName(1, "")
|
|
Me.ImageList1.Images.SetKeyName(2, "")
|
|
Me.ImageList1.Images.SetKeyName(3, "")
|
|
Me.ImageList1.Images.SetKeyName(4, "")
|
|
Me.ImageList1.Images.SetKeyName(5, "")
|
|
Me.ImageList1.Images.SetKeyName(6, "")
|
|
Me.ImageList1.Images.SetKeyName(7, "")
|
|
Me.ImageList1.Images.SetKeyName(8, "")
|
|
Me.ImageList1.Images.SetKeyName(9, "")
|
|
Me.ImageList1.Images.SetKeyName(10, "")
|
|
Me.ImageList1.Images.SetKeyName(11, "")
|
|
Me.ImageList1.Images.SetKeyName(12, "")
|
|
Me.ImageList1.Images.SetKeyName(13, "")
|
|
'
|
|
'DokList
|
|
'
|
|
Me.DokList.AllowRowSizing = C1.Win.C1TrueDBGrid.RowSizingEnum.IndividualRows
|
|
Me.DokList.AllowUpdate = False
|
|
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, 28)
|
|
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.PageSettings = CType(resources.GetObject("DokList.PrintInfo.PageSettings"), System.Drawing.Printing.PageSettings)
|
|
Me.DokList.ScrollTips = True
|
|
Me.DokList.Size = New System.Drawing.Size(832, 481)
|
|
Me.DokList.TabIndex = 28
|
|
Me.DokList.Text = "C1TrueDBGrid1"
|
|
Me.DokList.PropBag = resources.GetString("DokList.PropBag")
|
|
'
|
|
'Button1
|
|
'
|
|
Me.Button1.Image = CType(resources.GetObject("Button1.Image"), System.Drawing.Image)
|
|
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
|
|
'
|
|
'frmFAQ
|
|
'
|
|
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
|
|
Me.ClientSize = New System.Drawing.Size(832, 509)
|
|
Me.Controls.Add(Me.DokList)
|
|
Me.Controls.Add(Me.Button1)
|
|
Me.Controls.Add(Me.Label1)
|
|
Me.Controls.Add(Me.TextBox1)
|
|
Me.Controls.Add(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)
|
|
Me.PerformLayout()
|
|
|
|
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
|