📄 frmsalarycardnew.frm
字号:
VERSION 5.00
Object = "{FE0065C0-1B7B-11CF-9D53-00AA003C9CB6}#1.1#0"; "COMCT232.OCX"
Begin VB.Form frmSalaryCardNew
BorderStyle = 3 'Fixed Dialog
Caption = "新增工资项目"
ClientHeight = 1890
ClientLeft = 2715
ClientTop = 1950
ClientWidth = 4335
HelpContextID = 60106
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1890
ScaleWidth = 4335
ShowInTaskbar = 0 'False
Begin ComCtl2.UpDown updCard
Height = 300
Index = 0
Left = 1710
TabIndex = 7
Top = 1020
Width = 270
_ExtentX = 476
_ExtentY = 529
_Version = 327681
Value = 1
BuddyControl = "txtCard(0)"
BuddyDispid = 196609
BuddyIndex = 0
OrigLeft = 3720
OrigTop = 1440
OrigRight = 3990
OrigBottom = 1740
Max = 255
Min = 1
SyncBuddy = -1 'True
BuddyProperty = 65547
Enabled = -1 'True
End
Begin VB.TextBox txtCard
DataSource = "UpDown1"
Height = 300
Index = 0
Left = 915
MaxLength = 3
TabIndex = 6
Text = "12"
Top = 1020
Width = 780
End
Begin ComCtl2.UpDown updCard
Height = 300
Index = 1
Left = 1710
TabIndex = 10
Top = 1380
Width = 270
_ExtentX = 476
_ExtentY = 529
_Version = 327681
BuddyControl = "txtCard(1)"
BuddyDispid = 196609
BuddyIndex = 1
OrigLeft = 3720
OrigTop = 1800
OrigRight = 3990
OrigBottom = 2100
Max = 16
SyncBuddy = -1 'True
BuddyProperty = 65547
Enabled = -1 'True
End
Begin VB.TextBox txtCard
DataSource = "UpDown1"
Height = 300
Index = 1
Left = 915
MaxLength = 1
TabIndex = 9
Text = "2"
Top = 1380
Width = 780
End
Begin VB.Frame Frame1
Height = 1755
Left = 90
TabIndex = 0
Top = 30
Width = 2775
Begin VB.ComboBox cboEditItem
Height = 300
Index = 0
ItemData = "frmSalaryCardNew.frx":0000
Left = 840
List = "frmSalaryCardNew.frx":002E
TabIndex = 2
Top = 210
Width = 1785
End
Begin VB.ComboBox cboEditItem
Height = 300
Index = 1
ItemData = "frmSalaryCardNew.frx":00B8
Left = 840
List = "frmSalaryCardNew.frx":00C5
TabIndex = 4
Text = "数字"
Top = 570
Width = 1065
End
Begin VB.Label lblEditItem
Caption = "小数(&D)"
Height = 255
Index = 3
Left = 180
TabIndex = 8
Top = 1380
Width = 945
End
Begin VB.Label lblEditItem
Caption = "名称(&N)"
Height = 195
Index = 0
Left = 180
TabIndex = 1
Top = 240
Width = 645
End
Begin VB.Label lblEditItem
Caption = "长度(&L)"
Height = 225
Index = 2
Left = 180
TabIndex = 5
Top = 1020
Width = 645
End
Begin VB.Label lblEditItem
Caption = "类型(&T)"
Height = 195
Index = 1
Left = 180
TabIndex = 3
Top = 630
Width = 735
End
End
Begin VB.CommandButton cmdAddItem
Height = 350
Index = 2
Left = 3030
Style = 1 'Graphical
TabIndex = 13
Top = 900
UseMaskColor = -1 'True
Width = 1215
End
Begin VB.CommandButton cmdAddItem
Height = 350
Index = 0
Left = 3030
Style = 1 'Graphical
TabIndex = 11
Top = 120
UseMaskColor = -1 'True
Width = 1215
End
Begin VB.CommandButton cmdAddItem
Height = 350
Index = 1
Left = 3030
Style = 1 'Graphical
TabIndex = 12
Top = 480
UseMaskColor = -1 'True
Width = 1215
End
End
Attribute VB_Name = "frmSalaryCardNew"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'新增工资项目卡片
'
'功能:新增、修改工资项目,向导中的刷新项目列表
'
'
'要求:1、对已经发放的项目数字型不允许修改小数位数,字符型不允许变短
' 2、对本次扣零、代扣税额、上次扣零项目只允许修改名称(根据ViewFieldID判断)
' 3、对没有参与发放的项目可以修改任何参数(对于已经参与发放的项目判断是根据在SalaryField中能否找到为准)
' 字符变长先增加一个字段、将原来的项目的值转入新增的项目再删除原来的项目,将新增的项目长度变大。修改
' 类型先将原来的项目删除,再新增项目
' 4、 小数右对齐。将小数的左边添加空格
'作者: 唐吉禹
'98-6-22
Option Explicit
Private mintEditItem As Integer '0 修改项目, 1 删除项目
Private mintSalaryViewID As Integer '工资表视图ID
Private mintSize As Integer '长度
Private mintDec As Integer '小数位
Private mblnEditSize As Boolean '修改大小否
Private mblnEditUsed As Boolean '修改已经使用的项目否
Private Function AddSalaryItem() As Boolean '新增工资项目
'校验各部分录入
Dim fidNew As rdoColumn
Dim strSql As String
Dim recViewField As rdoResultset
Dim strTmp As String
Dim lngViewFieldMaxID As Long
AddSalaryItem = False
Me.MousePointer = vbHourglass
'Strsql = "SELECT strViewFieldDesc,strFieldType,blnIsChoose,bytFieldSize,bytFieldDec,blnIsNotList,lngViewFieldID " _
& ",lngViewId,strTableName,blnIsPrep,lngViewFieldNO,strFieldName,blnIsFilter,bytVersion FROM ViewField " _
& " WHERE lngViewID=" & mintSalaryViewID & " AND blnIsFixed=False"
strSql = "SELECT strViewFieldDesc,strFieldType,blnIsChoose,bytFieldSize,bytFieldDec,blnIsNotList,lngViewFieldID," _
& " lngViewId,strTableName,blnIsPrep,lngViewFieldNO,strFieldName,blnIsFilter,bytVersion FROM ViewField " _
& " WHERE lngViewID=" & mintSalaryViewID & " AND blnIsFixed=0"
Set recViewField = gclsBase.BaseDB.OpenResultset(strSql, rdOpenDynamic, rdConcurRowVer, 64)
'通过校验
If CheckOK() Then
recViewField.AddNew '添加记录到ViewField
recViewField!lngViewId = mintSalaryViewID
recViewField!strViewFieldDesc = Left(Trim(cboEditItem(0).Text), 28)
recViewField!lngViewFieldNO = 8
'recViewField!blnIsPrep = True
'recViewField!blnIsFilter = True
recViewField!blnIsPrep = 1
recViewField!blnisFilter = 1
recViewField!bytVersion = 29
lngViewFieldMaxID = BillPublic.GetNewID("VIEWFIELD")
recViewField!lngViewFieldID = lngViewFieldMaxID
'判断是否为对置项目,取出其类型、大小、名称
Select Case Trim(cboEditItem(0).Text)
Case "文化程度"
recViewField!strTableName = UCase("Education")
recViewField!strFieldName = UCase("Education.strEducationName")
recViewField!strFieldType = "STRING"
recViewField!bytFieldSize = 20
recViewField!bytFieldDec = 0
GoTo InputExit
Case "职务"
recViewField!strTableName = "Title"
recViewField!strFieldName = "Title.strTitleName"
recViewField!strFieldType = "STRING"
recViewField!bytFieldSize = 20
recViewField!bytFieldDec = 0
GoTo InputExit
Case "性别"
recViewField!strTableName = "Employee"
'recViewField!strFieldName = "IIF(Employee.blnIsMale,'男','女')"
recViewField!strFieldName = "DECODE(Employee.blnIsMale,1,'男','女')"
recViewField!strFieldType = "STRING"
recViewField!bytFieldSize = 5
recViewField!bytFieldDec = 0
GoTo InputExit
Case "代发银行"
recViewField!strTableName = "Bank"
recViewField!strFieldName = "Bank.strBankName"
recViewField!strFieldType = "STRING"
recViewField!bytFieldSize = 30
recViewField!bytFieldDec = 0
GoTo InputExit
Case "家庭地址"
recViewField!strTableName = "Employee"
recViewField!strFieldName = "Employee.strAddress"
recViewField!strFieldType = "STRING"
recViewField!bytFieldSize = 40
recViewField!bytFieldDec = 0
GoTo InputExit
Case "邮政编码"
recViewField!strTableName = "Employee"
recViewField!strFieldName = "Employee.strPostalCode"
recViewField!strFieldType = "STRING"
recViewField!bytFieldSize = 6
recViewField!bytFieldDec = 0
GoTo InputExit
Case "办公电话"
recViewField!strTableName = "Employee"
recViewField!strFieldName = "Employee.strOfficePhone"
recViewField!strFieldType = "STRING"
recViewField!bytFieldSize = 20
recViewField!bytFieldDec = 0
GoTo InputExit
Case "住宅电话"
recViewField!strTableName = "Employee"
recViewField!strFieldName = "Employee.strHomePhone"
recViewField!strFieldType = "STRING"
recViewField!bytFieldSize = 20
recViewField!bytFieldDec = 0
GoTo InputExit
Case "身份证号码"
recViewField!strTableName = "Employee"
recViewField!strFieldName = "Employee.strCardNo"
recViewField!strFieldType = "STRING"
recViewField!bytFieldSize = 20
recViewField!bytFieldDec = 0
GoTo InputExit
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -