📄 partcheckmethodsingle.frm
字号:
VERSION 5.00
Begin VB.Form PartCheckMethodsingle
Caption = "Form1"
ClientHeight = 3285
ClientLeft = 60
ClientTop = 240
ClientWidth = 4275
LinkTopic = "Form1"
ScaleHeight = 3285
ScaleWidth = 4275
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "退出"
Height = 375
Left = 3000
TabIndex = 8
Top = 2760
Width = 975
End
Begin VB.CommandButton Command2
Caption = "保存"
Default = -1 'True
Height = 375
Left = 1680
TabIndex = 7
Top = 2760
Width = 975
End
Begin VB.CommandButton Command1
Caption = "新增"
Height = 375
Left = 480
TabIndex = 6
Top = 2760
Width = 975
End
Begin VB.TextBox Text3
Height = 1095
Left = 1320
MaxLength = 255
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 3
Text = "PartCheckMethodsingle.frx":0000
Top = 1320
Width = 2535
End
Begin VB.TextBox Text2
Height = 375
Left = 1320
MaxLength = 4
TabIndex = 1
Text = "Text2"
Top = 210
Width = 2535
End
Begin VB.TextBox Text1
Height = 375
Left = 1320
MaxLength = 50
TabIndex = 2
Text = "Text1"
Top = 720
Width = 2535
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "备注"
Height = 180
Left = 840
TabIndex = 5
Top = 1320
Width = 360
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "序号"
Height = 180
Left = 840
TabIndex = 4
Top = 360
Width = 360
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "零件检验方式"
Height = 180
Left = 120
TabIndex = 0
Top = 840
Width = 1080
End
End
Attribute VB_Name = "PartCheckMethodsingle"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'**************************************
'* 模 块 名 称 :联系目的设置用户操作界面
'* 功 能 描 述 :联系目的设置用户操作界面
'* 程序员姓名 :
'* 最后修改人 :
'* 最后修改时间:
'**************************************
Option Explicit
Public m_operatorType As Integer ' 操作类型 0 - 新增 1 - 修改
Public partcheckmethod As String ' 修改时其它窗体传递过来的参数
Private m_partcheckmethodDAO As PartCheckMethodDAO ' 数据库操作类
Private m_recordset As ADODB.Recordset ' 数据操作数据集对象
Public m_lxmdid As String
Public f As String
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Command1_Click()
Call Check
If m_operatorType = 0 Then
If f = "0" Then
Exit Sub
Else
Call Newlxmd
Call clear
End If
ElseIf m_operatorType = 1 Then
If f = "0" Then
Exit Sub
Else
Call Modifylxmd
clear
m_operatorType = 0
End If
End If
End Sub
Private Sub Command2_Click()
Call Check
If m_operatorType = 0 Then
If f = "0" Then
Exit Sub
Else
Call Newlxmd
End If
ElseIf m_operatorType = 1 Then
If f = "0" Then
Exit Sub
Else
Call Modifylxmd
End If
End If
Unload Me
End Sub
Private Sub Form_Load()
Set m_partcheckmethodDAO = New PartCheckMethodDAO
Set m_recordset = New ADODB.Recordset
SetToCenter Me
If m_operatorType = 0 Then
Me.caption = "零件检验方式_新增"
clear
Else
Me.caption = "零件检验方式_修改"
FindByIdRefresh
End If
End Sub
'**************************************
'* 功 能 描 述 :联系目的数据处理函数
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub Newlxmd()
'
Dim ret As Boolean
ret = m_partcheckmethodDAO.partcheckmethod_new(m_recordset, Trim(Text1.text), Trim(Text2.text), _
Trim(Text3.text))
End Sub
'**************************************
'* 功 能 描 述 :修改联系目的处理函数
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub Modifylxmd()
'
Dim ret As Boolean
Call Check
ret = m_partcheckmethodDAO.partcheckmethod_modify(m_recordset, Trim(Text1.text), Trim(Text2.text), _
Trim(Text3.text), m_lxmdid)
End Sub
'**************************************
'* 功 能 描 述 :检验数据的合法性
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub Check()
f = "1"
If Not IsNumeric(Trim(Text2.text)) Or Trim(Text2.text) = "" Then
MainForm.g_msgText = "序号格式有误!"
HMsgBox MainForm.g_msgText, 0, 1
Text2.SetFocus
f = "0"
Exit Sub
End If
If Trim(Text1.text) = "" Then
MainForm.g_msgText = "零件检验方式名称不能为空!"
HMsgBox MainForm.g_msgText, 0, 1
Text1.SetFocus
f = "0"
Exit Sub
End If
End Sub
'**************************************
'* 功 能 描 述 :根据联系目的ID找到联系目的资料并显示在界面上
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub FindByIdRefresh()
Dim ret As Boolean
ret = m_partcheckmethodDAO.partCheckMethod_findbyid(m_recordset, Trim(m_lxmdid))
If ret Then
With m_recordset
Text3.text = Trim(.Fields("memo"))
Text1.text = Trim(.Fields("checkname"))
Text2.text = Trim(.Fields("number"))
m_recordset.Close
End With
Else
MainForm.g_msgText = "零件检验方式编号不正确,请重新操作!"
HMsgBox MainForm.g_msgText, 0, 1
Unload Me
End If
End Sub
'**************************************
'* 功 能 描 述 :清除界面上文本框里的所有内容
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub clear()
Text1.text = ""
Text2.text = ""
Text3.text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -