📄 checkvaluesingleform.frm
字号:
VERSION 5.00
Begin VB.Form checkvaluesingleform
BorderStyle = 1 'Fixed Single
Caption = "Form1"
ClientHeight = 3480
ClientLeft = 45
ClientTop = 435
ClientWidth = 3960
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3480
ScaleWidth = 3960
Begin VB.Frame Frame1
Height = 2895
Left = 0
TabIndex = 7
Top = -120
Width = 3975
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 300
Index = 0
Left = 1560
MaxLength = 40
TabIndex = 1
Top = 240
Visible = 0 'False
Width = 2055
End
Begin VB.TextBox Text1
Height = 300
Index = 1
Left = 1560
MaxLength = 100
TabIndex = 2
Top = 720
Width = 2055
End
Begin VB.TextBox Text1
Height = 1305
Index = 2
Left = 1560
MaxLength = 255
ScrollBars = 3 'Both
TabIndex = 3
Top = 1200
Width = 2055
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "检验值ID"
Height = 180
Index = 0
Left = 600
TabIndex = 10
Top = 360
Visible = 0 'False
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "检验值名称"
Height = 180
Index = 1
Left = 420
TabIndex = 9
Top = 720
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "备注"
Height = 180
Index = 2
Left = 960
TabIndex = 8
Top = 1200
Width = 360
End
End
Begin VB.Frame Frame2
Height = 735
Left = 0
TabIndex = 0
Top = 2760
Width = 3975
Begin VB.CommandButton c_new
Caption = "新增"
Height = 375
Left = 360
TabIndex = 6
Top = 240
Width = 735
End
Begin VB.CommandButton c_save
Caption = "保存"
Height = 375
Left = 1680
TabIndex = 5
Top = 240
Width = 735
End
Begin VB.CommandButton c_cancel
Caption = "退出"
Height = 375
Left = 2880
TabIndex = 4
Top = 240
Width = 735
End
End
End
Attribute VB_Name = "checkvaluesingleform"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'**************************************
'* 模 块 名 称 :检验值设置用户操作界面
'* 功 能 描 述 :检验值设置用户操作界面
'* 程序员姓名 : 石春晓
'* 最后修改人 : 石春晓
'* 最后修改时间:2005/09/19
'**************************************
Option Explicit
Public m_operatorType As Integer ' 操作类型 0 - 新增 1 - 修改
Public m_checkvalueid As String ' 修改时其它窗体传递过来的参数
Private m_checkvalueDAO As checkvalueDAO ' 数据库操作类
Private m_recordset As ADODB.Recordset ' 数据操作数据集对象
Public f As String
Private Sub c_cancel_Click()
Unload Me
End Sub
Private Sub c_new_Click()
If m_operatorType = 0 Then
If f = "0" Then
Exit Sub
Else
Call Newcheckvalue
Call clear
End If
ElseIf m_operatorType = 1 Then
If f = "0" Then
Exit Sub
Else
Call Modifycheckvalue
clear
m_operatorType = 0
End If
End If
End Sub
Private Sub c_save_Click()
Call Check
If m_operatorType = 0 Then
If f = "0" Then
Exit Sub
Else
Call Newcheckvalue
End If
ElseIf m_operatorType = 1 Then
If f = "0" Then
Exit Sub
Else
Call Modifycheckvalue
End If
End If
Unload Me
End Sub
Private Sub Form_Load()
Set m_checkvalueDAO = New checkvalueDAO
Set m_recordset = New ADODB.Recordset
Me.Height = 4320
Me.Width = 4080
SetToCenter Me
If m_operatorType = 0 Then
Me.caption = "检验值_新增"
clear
Else
Me.caption = "检验值_修改"
FindByIdRefresh
End If
End Sub
'**************************************
'* 功 能 描 述 :检验值数据处理函数
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub Newcheckvalue()
'
Dim ret As Boolean
Call Check
ret = m_checkvalueDAO.Newcheckvalue(m_recordset, Trim(Text1(1).text), _
Trim(Text1(2).text))
End Sub
'**************************************
'* 功 能 描 述 :修改检验值处理函数
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub Modifycheckvalue()
'
Dim ret As Boolean
Call Check
ret = m_checkvalueDAO.Modifycheckvalue(m_recordset, Trim(Text1(1).text), _
Trim(Text1(2).text), m_checkvalueid)
End Sub
'**************************************
'* 功 能 描 述 :检验数据的合法性
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub Check()
f = "1"
If Trim(Text1(1).text) = "" Then
MainForm.g_msgText = "检验值名称不能为空!"
HMsgBox MainForm.g_msgText, 0, 1
Text1(1).SetFocus
f = "0"
Exit Sub
End If
End Sub
'**************************************
'* 功 能 描 述 :根据检验值ID找到检验值资料并显示在界面上
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub FindByIdRefresh()
Dim ret As Boolean
ret = m_checkvalueDAO.FindById(m_recordset, m_checkvalueid)
If ret Then
With m_recordset
Text1(0).text = Trim(.Fields(0))
Text1(1).text = Trim(.Fields(1))
Text1(2).text = Trim(.Fields(2))
m_recordset.Close
End With
Else
MainForm.g_msgText = "检验值ID不正确,请重新操作!"
HMsgBox MainForm.g_msgText, 0, 1
Unload Me
End If
End Sub
'**************************************
'* 功 能 描 述 :清除界面上文本框里的所有内容
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub clear()
Text1(0).text = ""
Text1(1).text = ""
Text1(2).text = ""
End Sub
Private Sub Text1_Change(Index As Integer)
If InStr(Trim(Text1(1).text), "%") = 0 Then
Text1(1).text = Trim(Text1(1).text) & "%"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -