📄 frmemployee.frm
字号:
' ******************************************************************************
Private Function getcboRetriDepId() As Boolean
getcboRetriDepId = True
If cboRetriveDep.Text <> "" Then
txtTestRetrDep = "select * from tbDep where DepName='" + cboRetriveDep.Text + "'"
If DBExist(txtTestRetrDep) = 0 Then
MsgBox "无此部门", vbOKOnly + vbExclamation, "警告"
getcboRetriDepId = False
Exit Function
Else
getcboRetriDepId = True
strRetriveDepId = CStr(cboRetriveDep.ItemData(cboRetriveDep.ListIndex))
If Len(strRetriveDepId) <> 8 Then
Select Case Len(strRetriveDepId)
Case 7
strRetriveDepId = "0" + strRetriveDepId
Case 6
strRetriveDepId = "00" + strRetriveDepId
Case 5
strRetriveDepId = "000" + strRetriveDepId
Case 4
strRetriveDepId = "0000" + strRetriveDepId
Case 3
strRetriveDepId = "00000" + strRetriveDepId
Case 2
strRetriveDepId = "000000" + strRetriveDepId
Case 1
strRetriveDepId = "0000000" + strRetriveDepId
End Select
End If
End If
End If
End Function
' ******************************************************************************
'过程名:getcboDutyId
'说 明:获取显示职务名称的cboBox所对应的Id值
'参 数:无
'返回值:无
' ******************************************************************************
Private Sub getcboDutyId()
If cboPosition.Text = "" Then
strPosition = ""
Else
strPosition = CStr(cboPosition.ItemData(cboPosition.ListIndex))
If Len(strPosition) <> 8 Then
Select Case Len(strPosition)
Case 7
strPosition = "0" + strPosition
Case 6
strPosition = "00" + strPosition
Case 5
strPosition = "000" + strPosition
Case 4
strPosition = "0000" + strPosition
Case 3
strPosition = "00000" + strPosition
Case 2
strPosition = "000000" + strPosition
Case 1
strPosition = "0000000" + strPosition
End Select
End If
End If
End Sub
' ******************************************************************************
'过程名:getcboNationId
'说 明:获取显示民族名称的cboBox所对应的Id值
'参 数:无
'返回值:无
' ******************************************************************************
Private Sub getcboNationId()
If cboNation.Text = "" Then
strNation = ""
Else
strNation = CStr(cboNation.ItemData(cboNation.ListIndex))
If Len(strNation) <> 3 Then
Select Case Len(strNation)
Case 2
strNation = "0" + strNation
Case 1
strNation = "00" + strNation
End Select
End If
End If
End Sub
' ******************************************************************************
'过程名:getcboEduId
'说 明:获取显示学历名称的cboBox所对应的Id值
'参 数:无
'返回值:无
' ******************************************************************************
Private Sub getcboEduId()
If cboEdu.Text = "" Then
strEdu = ""
Else
strEdu = CStr(cboEdu.ItemData(cboEdu.ListIndex))
If Len(strEdu) <> 2 Then
strEdu = "0" + strEdu
End If
End If
End Sub
' ******************************************************************************
'函数名:getcboRetriEduId
'说 明:获取显示学历名称的cboBox所对应的Id值
'参 数:无
'返回值:无
' ******************************************************************************
Private Function getcboRetriEduId() As Boolean
getcboRetriEduId = True
If cboRetrieveEdu.Text <> "" Then
txtTestRetrEdu = "select * from tbEdu where EduName='" + cboRetrieveEdu.Text + "'"
If DBExist(txtTestRetrEdu) = 0 Then
MsgBox "无此学历", vbOKOnly + vbExclamation, "警告"
getcboRetriEduId = False
Exit Function
Else
getcboRetriEduId = True
strRetriveEduId = CStr(cboRetrieveEdu.ItemData(cboRetrieveEdu.ListIndex))
If Len(strRetriveEduId) <> 2 Then
strRetriveEduId = "0" + strRetriveEduId
End If
End If
End If
End Function
' ******************************************************************************
'函数名:checkIn
'说 明:进行输入值得检验,包括输入位数和值是否合法
'参 数:无
'返回值:各个输入都正确-true,否则-false
' ******************************************************************************
Private Function checkIn() As Boolean
checkIn = True
If txtIsNull(txtId) Then
MsgBox "*项目不能为空!", vbOKOnly + vbExclamation, "警告"
checkIn = False
Exit Function
Else
If Not ISEquelLen(txtId, 8) Then
MsgBox "职员编码为8位!", vbOKOnly + vbExclamation, "警告"
checkIn = False
Exit Function
End If
End If
If txtIsNull(txtName) Then
MsgBox "*项目不能为空!", vbOKOnly + vbExclamation, "警告"
checkIn = False
Exit Function
Else
If IsOverStringLen(txtName.Text, 30) Then
MsgBox "姓名不能超过30位!", vbOKOnly + vbExclamation, "警告"
txtName.SetFocus
txtName.BackColor = BLUE
checkIn = False
Exit Function
End If
End If
If Not IsNumeric(txtAge.Text) Then
MsgBox "年龄必须输入数字", vbOKOnly + vbExclamation, "警告"
txtAge.SetFocus
txtAge.BackColor = BLUE
checkIn = False
Exit Function
End If
If IsOverStringLen(txtPR.Text, 20) Then
MsgBox "籍贯不能超过20位!", vbOKOnly + vbExclamation, "警告"
txtPR.SetFocus
txtPR.BackColor = BLUE
checkIn = False
Exit Function
End If
If IsOverStringLen(txtEmail.Text, 30) Then
MsgBox "Email不能超过30位!", vbOKOnly + vbExclamation, "警告"
txtEmail.SetFocus
txtEmail.BackColor = BLUE
checkIn = False
Exit Function
End If
If IsOverStringLen(txtTelOffice.Text, 20) Then
MsgBox "电话不能超过20位!", vbOKOnly + vbExclamation, "警告"
txtTelOffice.SetFocus
txtTelOffice.BackColor = BLUE
checkIn = False
Exit Function
End If
If IsOverStringLen(txtTelHome.Text, 20) Then
MsgBox "电话不能超过20位!", vbOKOnly + vbExclamation, "警告"
txtTelHome.SetFocus
txtTelHome.BackColor = BLUE
checkIn = False
Exit Function
End If
If IsOverStringLen(txtTelMobile.Text, 20) Then
MsgBox "电话不能超过20位!", vbOKOnly + vbExclamation, "警告"
txtTelMobile.SetFocus
txtTelMobile.BackColor = BLUE
checkIn = False
Exit Function
End If
If txtIsNull(txtIndentityId) Then
MsgBox "*项目不能为空!", vbOKOnly + vbExclamation, "警告"
checkIn = False
Exit Function
Else
If IsOverStringLen(txtIndentityId.Text, 20) Then
MsgBox "身份证号不能超过20位!", vbOKOnly + vbExclamation, "警告"
txtIndentityId.SetFocus
txtIndentityId.BackColor = BLUE
checkIn = False
Exit Function
End If
End If
If cboState.Text = "" Then
MsgBox "请选择职员类型!", vbOKOnly + vbExclamation, "警告"
cboState.SetFocus
checkIn = False
Exit Function
End If
If txtBirth.Text <> "" Then
If IsDate(txtBirth.Text) Then
dateBirth = CDate(txtBirth.Text)
Else
MsgBox "日期类型输入不正确,应该为yyyy-mm-dd", vbOKOnly + vbExclamation, "警告"
txtBirth.SetFocus
txtBirth.BackColor = BLUE
checkIn = False
Exit Function
End If
End If
If txtInComp.Text <> "" Then
If IsDate(txtInComp.Text) Then
dateInComp = CDate(txtInComp.Text)
Else
MsgBox "日期类型输入不正确,应该为yyyy-mm-dd", vbOKOnly + vbExclamation, "警告"
txtInComp.SetFocus
txtInComp.BackColor = BLUE
checkIn = False
Exit Function
End If
End If
If IsOverStringLen(txtHomeAddress.Text, 100) Then
MsgBox "住址输入不能超过100位!", vbOKOnly + vbExclamation, "警告"
txtHomeAddress.SetFocus
txtHomeAddress.BackColor = BLUE
checkIn = False
Exit Function
End If
If IsOverStringLen(txtCode.Text, 10) Then
MsgBox "邮政编码不能超过10位!", vbOKOnly + vbExclamation, "警告"
txtCode.SetFocus
txtCode.BackColor = BLUE
checkIn = False
Exit Function
End If
If IsOverStringLen(txtLocation.Text, 50) Then
MsgBox "户口所在地不能超过50位!", vbOKOnly + vbExclamation, "警告"
txtLocation.SetFocus
txtLocation.BackColor = BLUE
checkIn = False
Exit Function
End If
If IsOverStringLen(txtRecordId.Text, 10) Then
MsgBox "档案号不能超过10位!", vbOKOnly + vbExclamation, "警告"
txtRecordId.SetFocus
txtRecordId.BackColor = BLUE
checkIn = False
Exit Function
End If
If Me.cboSex.Text = "" Then
MsgBox "*项目不能为空!", vbOKOnly + vbExclamation, "警告"
checkIn = False
Exit Function
End If
If Me.cboNation.Text = "" Then
MsgBox "*项目不能为空!", vbOKOnly + vbExclamation, "警告"
checkIn = False
Exit Function
End If
If Me.cboPolitic.Text = "" Then
MsgBox "*项目不能为空!", vbOKOnly + vbExclamation, "警告"
checkIn = False
Exit Function
End If
If Me.cboMerry.Text = "" Then
MsgBox "*项目不能为空!", vbOKOnly + vbExclamation, "警告"
checkIn = False
Exit Function
End If
If Me.cboEdu.Text = "" Then
MsgBox "*项目不能为空!", vbOKOnly + vbExclamation, "警告"
checkIn = False
Exit Function
End If
If Me.cboDep.Text = "" Then
MsgBox "*项目不能为空!", vbOKOnly + vbExclamation, "警告"
checkIn = False
Exit Function
End If
If Me.cboPosition.Text = "" Then
MsgBox "*项目不能为空!", vbOKOnly + vbExclamation, "警告"
checkIn = False
Exit Function
End If
End Function
' ******************************************************************************
'过程名:Clear
'说 明:获取显示学历名称的cboBox所对应的Id值
'参 数:无
'返回值:无
' ******************************************************************************
Private Sub Clear()
Me.txtId.Text = ""
Me.txtName.Text = ""
Me.txtAge.Text = ""
Me.txtBirth.Text = ""
Me.txtInComp.Text = ""
Me.txtPR.Text = ""
Me.txtIndentityId.Text = ""
Me.txtEmail.Text = ""
Me.txtTelOffice.Text = ""
Me.txtTelHome.Text = ""
Me.txtTelMobile.Text = ""
Me.txtHomeAddress.Text = ""
Me.txtCode.Text = ""
Me.txtRecordId.Text = ""
Me.txtLocation.Text = ""
End Sub
Private Sub txtId_Change()
txtId.BackColor = WHITE
End Sub
Private Sub txtInComFrom_Change()
txtInComFrom.BackColor = WHITE
End Sub
Private Sub txtInComp_Change()
txtInComp.BackColor = WHITE
End Sub
Private Sub txtInComUntil_Change()
txtInComUntil.BackColor = WHITE
End Sub
Private Sub txtIndentityId_Change()
txtIndentityId.BackColor = WHITE
End Sub
Private Sub txtLocation_Change()
txtLocation.BackColor = WHITE
End Sub
Private Sub txtName_Change()
txtName.BackColor = WHITE
End Sub
Private Sub txtAge_Change()
txtAge.BackColor = WHITE
End Sub
Private Sub txtBirth_Change()
txtBirth.BackColor = WHITE
End Sub
Private Sub txtPR_Change()
txtPR.BackColor = WHITE
End Sub
Private Sub txtRecordId_Change()
txtRecordId.BackColor = WHITE
End Sub
Private Sub txtTelHome_Change()
txtTelHome.BackColor = WHITE
End Sub
Private Sub txtTelMobile_Change()
txtTelMobile.BackColor = WHITE
End Sub
Private Sub txtTelOffice_Change()
txtTelOffice.BackColor = WHITE
End Sub
Private Sub txtCode_Change()
txtCode.BackColor = WHITE
End Sub
Private Sub txtEmail_Change()
txtEmail.BackColor = WHITE
End Sub
Private Sub txtHomeAddress_Change()
txtHomeAddress.BackColor = WHITE
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -