📄 resch.vb
字号:
Imports System.Data.SqlClient
Imports System.Data.SqlTypes
Imports System.Collections
Imports System.String
Imports System.Data
Imports System.Drawing.Printing
Public Class resch
Inherits System.Windows.Forms.Form
Dim sql As New SqlConnection
Dim adapter As SqlDataAdapter
Dim BSearchStrEmpty As Boolean
Dim StrBrowseBy As String
Dim result As Integer
Dim StrQuery As String
Dim DataSet1 As New DataSet
Dim SqlDataAdapter1 As New SqlDataAdapter
Dim SqlDataAdapter2 As SqlDataAdapter
Dim SqlDataAdapter3 As SqlDataAdapter
Dim SqlSelectCommand1 As New SqlCommand
Dim DrRowPicker As DataRow
Dim DataSet2 As New DataSet
Dim DataTable2 As DataTable
Dim str As String
Dim DataTable1 As DataTable
Dim pdlg As New PrintDialog
Friend WithEvents PDocument As New PrintDocument
#Region " Windows 窗体设计器生成的代码 "
Public Sub New()
MyBase.New()
'该调用是 Windows 窗体设计器所必需的。
InitializeComponent()
'在 InitializeComponent() 调用之后添加任何初始化
End Sub
'窗体重写 dispose 以清理组件列表。
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
'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer
'注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改此过程。
'不要使用代码编辑器修改它。
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents ComboBox2 As System.Windows.Forms.ComboBox
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents ComboBox3 As System.Windows.Forms.ComboBox
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents ListView2 As System.Windows.Forms.ListView
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents StatusBar1 As System.Windows.Forms.StatusBar
Friend WithEvents StatusBarPanel1 As System.Windows.Forms.StatusBarPanel
Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents CheckBox1 As System.Windows.Forms.CheckBox
Friend WithEvents CheckBox2 As System.Windows.Forms.CheckBox
Friend WithEvents CheckBox3 As System.Windows.Forms.CheckBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label
Me.ComboBox1 = New System.Windows.Forms.ComboBox
Me.Label2 = New System.Windows.Forms.Label
Me.ComboBox2 = New System.Windows.Forms.ComboBox
Me.Label3 = New System.Windows.Forms.Label
Me.ComboBox3 = New System.Windows.Forms.ComboBox
Me.Button1 = New System.Windows.Forms.Button
Me.ListView2 = New System.Windows.Forms.ListView
Me.Button2 = New System.Windows.Forms.Button
Me.Button3 = New System.Windows.Forms.Button
Me.StatusBar1 = New System.Windows.Forms.StatusBar
Me.StatusBarPanel1 = New System.Windows.Forms.StatusBarPanel
Me.GroupBox1 = New System.Windows.Forms.GroupBox
Me.CheckBox3 = New System.Windows.Forms.CheckBox
Me.CheckBox2 = New System.Windows.Forms.CheckBox
Me.CheckBox1 = New System.Windows.Forms.CheckBox
CType(Me.StatusBarPanel1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.GroupBox1.SuspendLayout()
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(96, 32)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(64, 16)
Me.Label1.TabIndex = 8
Me.Label1.Text = "系部"
'
'ComboBox1
'
Me.ComboBox1.Enabled = False
Me.ComboBox1.Location = New System.Drawing.Point(168, 32)
Me.ComboBox1.Name = "ComboBox1"
Me.ComboBox1.Size = New System.Drawing.Size(144, 20)
Me.ComboBox1.TabIndex = 9
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(88, 72)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(56, 16)
Me.Label2.TabIndex = 10
Me.Label2.Text = "名称"
'
'ComboBox2
'
Me.ComboBox2.Enabled = False
Me.ComboBox2.Location = New System.Drawing.Point(168, 72)
Me.ComboBox2.Name = "ComboBox2"
Me.ComboBox2.Size = New System.Drawing.Size(144, 20)
Me.ComboBox2.TabIndex = 11
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(88, 112)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(72, 16)
Me.Label3.TabIndex = 12
Me.Label3.Text = "状态"
'
'ComboBox3
'
Me.ComboBox3.Enabled = False
Me.ComboBox3.Items.AddRange(New Object() {"空闲", "使用", "报废", "转移"})
Me.ComboBox3.Location = New System.Drawing.Point(168, 112)
Me.ComboBox3.Name = "ComboBox3"
Me.ComboBox3.Size = New System.Drawing.Size(144, 20)
Me.ComboBox3.TabIndex = 13
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(464, 48)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(104, 32)
Me.Button1.TabIndex = 17
Me.Button1.Text = "查 找"
'
'ListView2
'
Me.ListView2.Alignment = System.Windows.Forms.ListViewAlignment.SnapToGrid
Me.ListView2.AllowColumnReorder = True
Me.ListView2.AllowDrop = True
Me.ListView2.FullRowSelect = True
Me.ListView2.GridLines = True
Me.ListView2.HoverSelection = True
Me.ListView2.ImeMode = System.Windows.Forms.ImeMode.NoControl
Me.ListView2.LabelEdit = True
Me.ListView2.Location = New System.Drawing.Point(0, 208)
Me.ListView2.Name = "ListView2"
Me.ListView2.Size = New System.Drawing.Size(640, 288)
Me.ListView2.Sorting = System.Windows.Forms.SortOrder.Ascending
Me.ListView2.TabIndex = 7
Me.ListView2.View = System.Windows.Forms.View.Details
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(464, 104)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(104, 32)
Me.Button2.TabIndex = 18
Me.Button2.Text = "打 印"
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(464, 160)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(104, 32)
Me.Button3.TabIndex = 19
Me.Button3.Text = "关 闭"
'
'StatusBar1
'
Me.StatusBar1.Location = New System.Drawing.Point(0, 222)
Me.StatusBar1.Name = "StatusBar1"
Me.StatusBar1.Panels.AddRange(New System.Windows.Forms.StatusBarPanel() {Me.StatusBarPanel1})
Me.StatusBar1.Size = New System.Drawing.Size(640, 24)
Me.StatusBar1.TabIndex = 20
'
'StatusBarPanel1
'
Me.StatusBarPanel1.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Contents
Me.StatusBarPanel1.Text = "StatusBarPanel1"
Me.StatusBarPanel1.Width = 107
'
'GroupBox1
'
Me.GroupBox1.Controls.Add(Me.CheckBox3)
Me.GroupBox1.Controls.Add(Me.CheckBox2)
Me.GroupBox1.Controls.Add(Me.CheckBox1)
Me.GroupBox1.Controls.Add(Me.Label2)
Me.GroupBox1.Controls.Add(Me.ComboBox2)
Me.GroupBox1.Controls.Add(Me.Label3)
Me.GroupBox1.Controls.Add(Me.ComboBox3)
Me.GroupBox1.Controls.Add(Me.ComboBox1)
Me.GroupBox1.Controls.Add(Me.Label1)
Me.GroupBox1.Location = New System.Drawing.Point(64, 40)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(352, 152)
Me.GroupBox1.TabIndex = 21
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "查找方式"
'
'CheckBox3
'
Me.CheckBox3.Location = New System.Drawing.Point(56, 104)
Me.CheckBox3.Name = "CheckBox3"
Me.CheckBox3.Size = New System.Drawing.Size(24, 24)
Me.CheckBox3.TabIndex = 16
'
'CheckBox2
'
Me.CheckBox2.Location = New System.Drawing.Point(56, 64)
Me.CheckBox2.Name = "CheckBox2"
Me.CheckBox2.Size = New System.Drawing.Size(24, 24)
Me.CheckBox2.TabIndex = 15
'
'CheckBox1
'
Me.CheckBox1.Location = New System.Drawing.Point(56, 24)
Me.CheckBox1.Name = "CheckBox1"
Me.CheckBox1.Size = New System.Drawing.Size(24, 24)
Me.CheckBox1.TabIndex = 14
'
'resch
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.BackColor = System.Drawing.SystemColors.Control
Me.ClientSize = New System.Drawing.Size(640, 246)
Me.Controls.Add(Me.GroupBox1)
Me.Controls.Add(Me.StatusBar1)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.ListView2)
Me.ForeColor = System.Drawing.SystemColors.ControlText
Me.Name = "resch"
Me.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "-----------查找"
CType(Me.StatusBarPanel1, System.ComponentModel.ISupportInitialize).EndInit()
Me.GroupBox1.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub resch_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ListView2.Visible = False
ListView2.View = View.Details
ListView2.Columns.Add("资产代号", 80, HorizontalAlignment.Left)
ListView2.Columns.Add("资产名称", 80, HorizontalAlignment.Left)
ListView2.Columns.Add("部门名称", 80, HorizontalAlignment.Left)
ListView2.Columns.Add("购进的时间", 60, HorizontalAlignment.Left)
ListView2.Columns.Add("数量", 80, HorizontalAlignment.Left)
ListView2.Columns.Add("价格", 80, HorizontalAlignment.Left)
ListView2.Columns.Add("购进人", 80, HorizontalAlignment.Left)
ListView2.Columns.Add("负责人", 80, HorizontalAlignment.Left)
ListView2.Columns.Add("使用人", 80, HorizontalAlignment.Left)
ListView2.Columns.Add("登记的日期", 80, HorizontalAlignment.Left)
ListView2.Columns.Add("登记人", 80, HorizontalAlignment.Left)
ListView2.Columns.Add("资产状态", 80, HorizontalAlignment.Left)
ListView2.Columns.Add("备注说明", 80, HorizontalAlignment.Left)
sql = New SqlConnection(StrData)
sql.Open()
SqlDataAdapter2 = New SqlDataAdapter("select distinct ASSET_NAME from T_ASSET_MAIN ", sql)
SqlDataAdapter2.Fill(DataSet1)
DataTable1 = DataSet1.Tables(0)
Dim i As Integer
For i = 0 To DataTable1.Rows.Count - 1
ComboBox2.Items.Add(DataTable1.Rows.Item(i).Item("ASSET_NAME"))
Next
SqlDataAdapter3 = New SqlDataAdapter("select * from T_DEPARTMENT ", sql)
SqlDataAdapter3.Fill(DataSet2)
DataTable2 = DataSet2.Tables(0)
Dim k As Integer
For k = 0 To DataTable2.Rows.Count - 1
ComboBox1.Items.Add(DataTable2.Rows.Item(k).Item("TYPE_NAME"))
Next
End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
ListView2.Items.Clear()
ListView2.Visible = True
Me.ClientSize = New System.Drawing.Size(640, 518)
StatusBar1.ShowPanels = True
Dim message As String
Dim a As Integer
If CheckBox1.Checked = True And CheckBox2.Checked = True And CheckBox3.Checked = True Then
StrBrowseBy = ComboBox3.Text.ToString
If StrBrowseBy = "空闲" Then
a = 1
ElseIf StrBrowseBy = "使用" Then
a = 2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -