📄 frmaddemp.frm
字号:
VERSION 5.00
Begin VB.Form FrmAddEmp
BorderStyle = 3 'Fixed Dialog
Caption = "新进员工"
ClientHeight = 1980
ClientLeft = 45
ClientTop = 330
ClientWidth = 4680
Icon = "FrmAddEmp.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1980
ScaleWidth = 4680
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton ExitCmd
Cancel = -1 'True
Caption = "返回(&X)"
Height = 375
Left = 3240
TabIndex = 4
Top = 975
Width = 1215
End
Begin VB.CommandButton NextCmd
Caption = "下一个(&N)"
Height = 375
Left = 3240
TabIndex = 3
Top = 600
Width = 1215
End
Begin VB.CommandButton OkCmd
Caption = "确认(&Y)"
Height = 375
Left = 3240
TabIndex = 2
Top = 225
Width = 1215
End
Begin VB.TextBox ChsNameText
Height = 345
Left = 1200
TabIndex = 1
Top = 960
Width = 1695
End
Begin VB.TextBox EmpIdText
Height = 345
Left = 1200
TabIndex = 0
Top = 240
Width = 1695
End
Begin VB.Label Label1
Caption = "注:使用本功能增加部门的职员,之后对本部门的每个职员输入档案"
ForeColor = &H8000000C&
Height = 375
Index = 2
Left = 120
TabIndex = 7
Top = 1560
Width = 4215
End
Begin VB.Label Label1
Caption = "姓名(中文):"
Height = 375
Index = 1
Left = 120
TabIndex = 6
Top = 960
Width = 1095
End
Begin VB.Label Label1
Caption = "职员工号:"
Height = 375
Index = 0
Left = 120
TabIndex = 5
Top = 240
Width = 1095
End
End
Attribute VB_Name = "FrmAddEmp"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Sub LoadRes()
Me.Caption = LoadResString(256) & " " & LoadResString(257) & NowSelectDepartName
Label1(0).Caption = LoadResString(250)
Label1(1).Caption = LoadResString(251)
Label1(2).Caption = LoadResString(252)
OkCmd.Caption = LoadResString(253)
NextCmd.Caption = LoadResString(254)
ExitCmd.Caption = LoadResString(255)
End Sub
Sub NullText()
EmpIdText = ""
ChsNameText = ""
End Sub
Function SaveEmp()
On Error GoTo SaveErr
Dim TempStr As String, TempObj As New EmpCls
Set TempObj = New EmpCls
TempStr = TempObj.AddEmployee(Trim$(EmpIdText), Trim$(ChsNameText), NowSelectDepartDir)
If TempStr <> "" Then
MsgBox TempStr, vbCritical
Else
ShowMsgBox LoadResString(262), vbInformation
NullText
EmpIdText.SetFocus
End If
Set TempObj = Nothing
Exit Function
SaveErr:
ShowMsgBox Err.Description
End Function
Private Sub ChsNameText_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub EmpIdText_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
End If
End Sub
Private Sub ExitCmd_Click()
Unload Me
End Sub
Private Sub Form_Load()
LoadRes
End Sub
Private Sub NextCmd_Click()
NullText
End Sub
Private Sub OkCmd_Click()
SaveEmp
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -