📄 budgetsetcard.frm
字号:
VERSION 5.00
Object = "{F42BDC2B-FC9B-11D1-9ABD-444553540000}#3.4#0"; "ATLEDIT1.OCX"
Begin VB.Form frmBudgetSetCard
BorderStyle = 1 'Fixed Single
Caption = "Form1"
ClientHeight = 3090
ClientLeft = 45
ClientTop = 330
ClientWidth = 4755
KeyPreview = -1 'True
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3090
ScaleWidth = 4755
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmdBudget
Height = 345
Index = 2
Left = 3480
Style = 1 'Graphical
TabIndex = 17
Top = 900
UseMaskColor = -1 'True
Width = 1215
End
Begin VB.CheckBox chkBudget
Caption = "自动报警"
Height = 300
Index = 9
Left = 3480
TabIndex = 18
Top = 1290
Width = 1215
End
Begin VB.ComboBox cboBudget
Height = 300
Left = 1320
Style = 2 'Dropdown List
TabIndex = 3
Top = 540
Width = 2055
End
Begin VB.CheckBox chkBudget
Caption = "数量"
Height = 300
Index = 8
Left = 2520
TabIndex = 14
Top = 2550
Width = 735
End
Begin VB.CheckBox chkBudget
Caption = "原币"
Height = 300
Index = 7
Left = 1440
TabIndex = 13
Top = 2550
Width = 735
End
Begin VB.CheckBox chkBudget
Caption = "本币"
Height = 300
Index = 6
Left = 360
TabIndex = 12
Top = 2550
Width = 735
End
Begin VB.CheckBox chkBudget
Caption = "项目"
Height = 300
Index = 5
Left = 2520
TabIndex = 10
Top = 1710
Width = 735
End
Begin VB.CheckBox chkBudget
Caption = "统计"
Height = 300
Index = 4
Left = 2520
TabIndex = 9
Top = 1290
Width = 735
End
Begin VB.CheckBox chkBudget
Caption = "职员"
Height = 300
Index = 3
Left = 1440
TabIndex = 8
Top = 1710
Width = 735
End
Begin VB.CheckBox chkBudget
Caption = "部门"
Height = 300
Index = 2
Left = 1440
TabIndex = 7
Top = 1290
Width = 735
End
Begin VB.CheckBox chkBudget
Caption = "单位"
Height = 300
Index = 1
Left = 360
TabIndex = 6
Top = 1710
Width = 735
End
Begin VB.CommandButton cmdBudget
Height = 345
Index = 1
Left = 3480
Style = 1 'Graphical
TabIndex = 16
Top = 510
UseMaskColor = -1 'True
Width = 1215
End
Begin VB.CommandButton cmdBudget
Height = 345
Index = 0
Left = 3480
Style = 1 'Graphical
TabIndex = 15
Top = 120
UseMaskColor = -1 'True
Width = 1215
End
Begin AtlEdit.TEdit tedBudget
Height = 300
Left = 1320
TabIndex = 1
Top = 120
Width = 2055
_ExtentX = 3625
_ExtentY = 529
maxchar = 30
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Text = ""
End
Begin VB.CheckBox chkBudget
Caption = "科目"
Height = 300
Index = 0
Left = 360
TabIndex = 5
Top = 1290
Width = 735
End
Begin VB.Label lblbudget
Caption = "数据类型"
Height = 210
Index = 3
Left = 240
TabIndex = 11
Top = 2220
Width = 750
End
Begin VB.Label lblbudget
Caption = "预算对象(&T)"
Height = 210
Index = 1
Left = 240
TabIndex = 2
Top = 600
Width = 990
End
Begin VB.Label lblbudget
Caption = "预算项目"
Height = 210
Index = 2
Left = 240
TabIndex = 4
Top = 990
Width = 765
End
Begin VB.Label lblbudget
Caption = "预算名称(&N)"
Height = 210
Index = 0
Left = 240
TabIndex = 0
Top = 150
Width = 1095
End
End
Attribute VB_Name = "frmBudgetSetCard"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private mlngID As Long
Private mblnChanged As Boolean
Private mblnSuccess As Boolean
Public Function AddCard(Optional strName As String = "") As Long
Me.Caption = "新增预算方案"
chkBudget(0).Value = 1
chkBudget(0).Enabled = False
chkBudget(6).Value = 1
tedBudget.Text = strName
cboBudget.ListIndex = 0
mlngID = 0
If strName = "" Then
mblnChanged = False
Else
mblnChanged = True
End If
Me.Show vbModal
AddCard = mlngID
End Function
Public Function EditCard(ByVal lngID As Long) As Boolean
Me.Caption = "修改预算方案"
mlngID = lngID
mblnSuccess = False
InitBudgetType
If Not GetBudget Then
EditCard = False
Exit Function
End If
mblnChanged = False
chkBudget(0).Enabled = False
cmdBudget(2).Visible = False
UpdateAlarm
Me.Show vbModal
EditCard = mblnSuccess
End Function
'预算方案:财务(经营)+方案名称+预算项目(8)+预算类型(3)+预算对象+自动报警
'格式:财务预算+chr(9)+方案名称+chr(9)+预算项目(科目+单位+..)+chr(9)+预算类型(本币+原币+数量)+预算对象+自动报警
Public Function LoadFromString(ByVal strValue As String) As Long
Dim strResult As String, strObj As String
Dim intCount As Integer, intIndex As Integer
Dim lngID As Long
'方案名称
intCount = 2
If GetString(strValue, strResult, intCount) Then
tedBudget.Text = strResult
End If
'预算项目
intCount = intCount + 1
If GetString(strValue, strResult, intCount) Then
For intIndex = 1 To 8
If GetString(strResult, strObj, intIndex, Asc("+")) Then
Select Case strObj
Case "科目"
chkBudget(0).Value = 1
Case "单位"
chkBudget(1).Value = 1
Case "部门"
chkBudget(2).Value = 1
Case "职员"
chkBudget(3).Value = 1
Case "商品"
Case "统计"
chkBudget(4).Value = 1
Case "项目"
chkBudget(5).Value = 1
Case "工程"
End Select
End If
Next intIndex
End If
'预算类型
intCount = intCount + 1
If GetString(strValue, strResult, intCount) Then
For intIndex = 1 To 3
If GetString(strResult, strObj, intIndex, Asc("+")) Then
Select Case strObj
Case "本位币"
chkBudget(6).Value = 1
Case "原币"
chkBudget(7).Value = 1
Case "数量"
chkBudget(8).Value = 1
End Select
End If
Next intIndex
End If
'预算对象
intCount = intCount + 1
If GetString(strValue, strResult, intCount) Then
Select Case strResult
Case "实际发生额"
cboBudget.ListIndex = 0
Case "借方发生额"
cboBudget.ListIndex = 1
Case "贷方发生额"
cboBudget.ListIndex = 2
Case "余额"
cboBudget.ListIndex = 3
End Select
End If
'自动报警
intCount = intCount + 1
If GetString(strValue, strResult, intCount) Then
chkBudget(9).Value = 1
End If
If SaveBudget(lngID) Then
LoadFromString = lngID
Else
Dim strSql As String
Dim recBudget As rdoResultset
strSql = "SELECT lngBudgetID FROM Budget WHERE strBudgetName='" & tedBudget.Text & "'"
Set recBudget = gclsBase.BaseDB.OpenResultset(strSql, rdOpenStatic)
If Not recBudget.EOF Then
LoadFromString = recBudget("lngBudgetID")
End If
recBudget.Close
Set recBudget = Nothing
End If
Unload Me
End Function
Private Function GetBudget() As Boolean
Dim recTemp As rdoResultset
Dim strSql As String
strSql = "select * from Budget where lngbudgetid=" & mlngID
Set recTemp = gclsBase.BaseDB.OpenResultset(strSql, rdOpenStatic)
If Not recTemp.EOF Then
tedBudget.Text = recTemp("strbudgetname")
chkBudget(0).Value = IIf(recTemp("blnIsAccount"), 1, 0)
chkBudget(1).Value = IIf(recTemp("blnIsCustomer"), 1, 0)
chkBudget(2).Value = IIf(recTemp("blnIsDepartment"), 1, 0)
chkBudget(3).Value = IIf(recTemp("blnIsEmployee"), 1, 0)
chkBudget(4).Value = IIf(recTemp("blnIsClass1"), 1, 0)
chkBudget(5).Value = IIf(recTemp("blnIsClass2"), 1, 0)
chkBudget(6).Value = IIf(recTemp("blnIsNatualCurrency"), 1, 0)
chkBudget(7).Value = IIf(recTemp("blnIsOriginalCurrency"), 1, 0)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -