📄 frmdeviceoperationlist.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form FrmDeviceOperationList
Caption = "设备操作单列表"
ClientHeight = 7185
ClientLeft = 60
ClientTop = 450
ClientWidth = 10305
Icon = "FrmDeviceOperationList.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 7185
ScaleWidth = 10305
StartUpPosition = 1 '所有者中心
Begin VB.Frame Frame1
Caption = "查询"
Height = 1815
Left = 120
TabIndex = 2
Top = 840
Width = 10095
Begin VB.TextBox txtOperId
Height = 375
Left = 1200
TabIndex = 7
Top = 240
Width = 2175
End
Begin VB.TextBox txtTransactor
Height = 390
Left = 5760
TabIndex = 6
Top = 1200
Width = 2175
End
Begin VB.TextBox txtApplicant
Height = 390
Left = 1200
TabIndex = 5
Top = 1200
Width = 2175
End
Begin VB.CommandButton cmdSearch
Caption = "查找"
Height = 375
Left = 8640
TabIndex = 4
Top = 1200
Width = 1215
End
Begin VB.ComboBox cboOperType
Height = 300
Left = 5760
TabIndex = 3
Text = "Combo1"
Top = 240
Width = 2175
End
Begin NetManager.YMDDate ymdOperrqStart
Height = 375
Left = 1080
TabIndex = 8
Top = 720
Width = 3375
_ExtentX = 5953
_ExtentY = 661
End
Begin NetManager.YMDDate ymdOperrqEnd
Height = 375
Left = 5640
TabIndex = 9
Top = 720
Width = 3375
_ExtentX = 5953
_ExtentY = 661
End
Begin VB.Label Label8
Caption = "操作类型:"
Height = 255
Left = 4680
TabIndex = 15
Top = 360
Width = 975
End
Begin VB.Label Label9
Caption = "日期从:"
Height = 255
Left = 240
TabIndex = 14
Top = 840
Width = 975
End
Begin VB.Label Label6
Caption = "经手人:"
Height = 255
Left = 4680
TabIndex = 13
Top = 1320
Width = 975
End
Begin VB.Label Label5
Caption = "申请人:"
Height = 255
Left = 240
TabIndex = 12
Top = 1320
Width = 975
End
Begin VB.Label Label1
Caption = "流水号:"
Height = 255
Left = 240
TabIndex = 11
Top = 360
Width = 735
End
Begin VB.Label Label2
Caption = "至:"
Height = 255
Left = 4680
TabIndex = 10
Top = 840
Width = 615
End
End
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Height = 4335
Left = 120
TabIndex = 0
Top = 2760
Width = 10095
_ExtentX = 17806
_ExtentY = 7646
_Version = 393216
RowHeightMin = 315
WordWrap = -1 'True
HighLight = 0
FillStyle = 1
AllowUserResizing= 1
End
Begin MSComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 780
Left = 0
TabIndex = 1
Top = 0
Width = 10305
_ExtentX = 18177
_ExtentY = 1376
ButtonWidth = 1773
ButtonHeight = 1376
Style = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 4
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "添加操作单"
Key = "添加操作单"
ImageIndex = 2
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "查看操作单"
Key = "查看操作单"
ImageIndex = 2
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "关闭"
Key = "关闭"
ImageIndex = 4
EndProperty
EndProperty
Begin MSComctlLib.ImageList ImageList1
Left = 8040
Top = 0
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 4
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmDeviceOperationList.frx":08CA
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmDeviceOperationList.frx":11A4
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmDeviceOperationList.frx":1A7E
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmDeviceOperationList.frx":2358
Key = ""
EndProperty
EndProperty
End
End
End
Attribute VB_Name = "FrmDeviceOperationList"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'****************************************************************************
'人人为我,我为人人
'枕善居收藏整理
'发布日期:2007/09/25
'描 述:江苏大学网络信息中心网络管理系统 - v1.0 Beta
'网 站:http://www.Mndsoft.com/ (VB6源码博客)
'网 站:http://www.VbDnet.com/ (VB.NET源码博客,主要基于.NET2005)
'e-mail :Mndsoft@163.com
'e-mail :Mndsoft@126.com
'OICQ :88382850
' 如果您有新的好的代码别忘记给枕善居哦!
'****************************************************************************
Dim txtSQL As String
Dim MsgText As String
Dim HasError As Boolean
Dim searchQuery As String
Dim txtQuery As String
Private WithEvents mMSFlexGrid1 As cFlexGridBinder
Attribute mMSFlexGrid1.VB_VarHelpID = -1
Private Sub cmdSearch_Click()
txtQuery = " where oper_id > 0 "
searchQuery = ""
If Trim(txtOperId) <> "" Then
searchQuery = searchQuery & " and oper_id = '" & Trim(txtOperId) & "' "
End If
If Trim(cboOperType) <> "" Then
searchQuery = searchQuery & " and oper_type = '" & Trim(cboOperType) & "' "
End If
If Trim(ymdOperrqStart.FormatDate) <> "" And Trim(ymdOperrqEnd.FormatDate) <> "" Then
searchQuery = searchQuery & " and operrq >= '" & Trim(ymdOperrqStart.FormatDate) & "' and operrq <= " & Trim(ymdOperrqEnd.FormatDate)
End If
If Trim(txtApplicant) <> "" Then
searchQuery = searchQuery & " and applicant = '" & Trim(txtApplicant) & "' "
End If
If Trim(txtTransactor) <> "" Then
searchQuery = searchQuery & " and transactor = '" & Trim(txtTransactor) & "' "
End If
Grid_Fill
End Sub
Private Sub Form_Load()
cboOperType.AddItem ""
cboOperType.AddItem "设备预领"
cboOperType.AddItem "设备退库"
cboOperType.AddItem "故障退库"
cboOperType.AddItem "设备送修"
cboOperType.AddItem "设备修返"
cboOperType.AddItem "设备借出"
cboOperType.AddItem "设备归还"
cboOperType.AddItem "设备报废"
cboOperType.Text = ""
Grid_Init
Grid_Fill
End Sub
Sub Grid_Init()
With MSFlexGrid1
.FormatString = "|<流水号|<日期|<操作描述|<操作类型|<申请人|<经手人|<备注"
.ColWidth(0) = 0
.ColWidth(1) = 1000
.ColWidth(2) = 1500
.ColWidth(3) = 2500
.ColWidth(4) = 1500
.ColWidth(5) = 1500
.ColWidth(6) = 1500
.ColWidth(7) = 2000
.Rows = 1
End With
Set mMSFlexGrid1 = New cFlexGridBinder
With mMSFlexGrid1
Set .Grid = MSFlexGrid1
.Editable = True
.EditOnMouse = emeNone
.FullRowSelect = True
End With
End Sub
Sub Grid_Fill()
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
txtSQL = "select * from tbl_device_oper " & txtQuery & searchQuery & " order by oper_id desc"
Set rst = ExecuteSQL(txtSQL, MsgText, HasError)
MSFlexGrid1.Rows = 1
Do While Not rst.EOF
MSFlexGrid1.AddItem vbTab _
& rst.Fields("oper_id") & vbTab _
& rst.Fields("operrq") & vbTab _
& rst.Fields("oper_desc") & vbTab _
& rst.Fields("oper_type") & vbTab _
& rst.Fields("applicant") & vbTab _
& rst.Fields("transactor") & vbTab _
& rst.Fields("memo")
rst.MoveNext
Loop
End Sub
Private Sub MSFlexGrid1_DblClick()
If mMSFlexGrid1.HighlightedRow > 0 Then
FrmDeviceOperation.oper_id = MSFlexGrid1.TextMatrix(mMSFlexGrid1.HighlightedRow, 1)
FrmDeviceOperation.mode = "view"
FrmDeviceOperation.Show
Else
MsgBox "必须选择一张操作单", vbOKOnly + vbExclamation, "警告"
End If
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
On Error Resume Next
Select Case Button.key
Case "添加操作单"
FrmDeviceOperation.mode = "add"
FrmDeviceOperation.Show
Case "查看操作单"
If mMSFlexGrid1.HighlightedRow > 0 Then
FrmDeviceOperation.oper_id = MSFlexGrid1.TextMatrix(mMSFlexGrid1.HighlightedRow, 1)
FrmDeviceOperation.mode = "view"
FrmDeviceOperation.Show
Else
MsgBox "必须选择一张操作单", vbOKOnly + vbExclamation, "警告"
End If
Case "关闭"
Unload Me
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -