📄 accountlist.frm
字号:
Else
Showlist = False
End If
End With
Else
Showlist = False
End If
.Close
End With
End Function
'反映是否有卡片存在
Public Property Let IsShowCard(ByVal Index As Integer, vNewValue As Boolean)
mIsShowCard(Index) = vNewValue
End Property
Public Property Get IsShowCard(ByVal Index As Integer) As Boolean
IsShowCard = mIsShowCard(Index)
End Property
'按照部门职员ID提取记录
Public Function GetbyListID(ByVal intTab As Integer, ByVal lngID As Long) As rdoResultset
Dim recRecordset As rdoResultset
Dim strSql As String
strSql = "Select * From Account Where lngAccountID = " & lngID
Set recRecordset = gclsBase.BaseDB.OpenResultset(strSql, rdOpenStatic)
Set GetbyListID = recRecordset
End Function
'按照部门职员ID更新停用标志
Private Function UpdateListInActive(ByVal intTab As Integer, ByVal lngID As Long, ByVal blnIsInActive As Boolean) As Boolean
Dim strSql As String
strSql = "UPDATE Account SET blnIsInActive = " & IIf(blnIsInActive, 1, 0) & " WHERE lngAccountID = " & lngID
UpdateListInActive = gclsBase.ExecSQL(strSql)
End Function
'删除部门职员ID指定记录
Private Function DelByPaymentMethodID(ByVal lngID As Long, ByVal intTab As Integer) As Boolean
Dim strSql As String
strSql = "Delete From Account WHERE lngAccountID = " & lngID
DelByPaymentMethodID = gclsBase.ExecSQL(strSql)
End Function
'判断部门职员ID是否使用
Private Function IsUsePaymentMethodID(ByVal lngID As Long) As Boolean
Dim recRecordset As rdoResultset
Dim strSql As String
strSql = "Select lngAccountID From VoucherDetail Where lngAccountID = " & lngID
Set recRecordset = gclsBase.BaseDB.OpenResultset(strSql, rdOpenStatic)
IsUsePaymentMethodID = (recRecordset.RowCount >= 1)
recRecordset.Close
End Function
' 部门职员ID
Public Property Get ListID(ByVal intTab As Integer) As Long
With mclsList(intTab).FlexGrid
If .TextArray(.Row * .Cols) <> "" And .Row > 0 Then
ListID = CLng(.TextArray(.Row * .Cols))
Else
ListID = 0
End If
End With
End Property
' 部门职员停用标志
Public Property Get ListIsInActive(ByVal intTab As Integer) As Boolean
If chkShowall.Value Then
With mclsList(intTab).FlexGrid
ListIsInActive = Not (.TextArray(.Row * .Cols + 1) = "")
End With
Else
ListIsInActive = False
End If
End Property
'根据列表中记录数,设置菜单可用属性
Private Sub UpdateMenuStatus()
Dim blnIsnotEmpty As Boolean
Dim blnFindNoChange As Boolean
Dim IsHaveRight As Boolean
IsHaveRight = IsCanDo(10, gclsBase.OperatorID)
With mclsList(sstCustom.Tab).FlexGrid
If .Rows > 1 And .ColSel <> 0 And .RowHeight(.Row) > 0 Then
blnIsnotEmpty = True
Else
blnIsnotEmpty = False
End If
End With
With frmMain
.mnuEditCopy.Enabled = blnIsnotEmpty
.mnuEditEdit.Enabled = blnIsnotEmpty And IsHaveRight
.mnuEditNew.Enabled = True And IsHaveRight
.mnuEditDel.Enabled = blnIsnotEmpty And IsHaveRight
.mnuEditInActive.Checked = False
.mnuEditInActive.Visible = False
.mnuEditInActive.Enabled = blnIsnotEmpty And IsHaveRight
.mnuEditShowAll.Checked = chkShowall.Value
.mnuEditShowAll.Enabled = True
.mnuEditUse.Enabled = blnIsnotEmpty
.mnuEditSearch.Enabled = True
.mnuEditColumn.Enabled = True
.mnuEditFilter.Enabled = True
.mnuFilePrint.Enabled = True
.mnuReportQuick.Enabled = blnIsnotEmpty
.mnuToolRefresh.Enabled = True
.mnuFilePrintSetup.Enabled = True
End With
If mclsList(sstCustom.Tab).FlexGrid.ColSel = 0 Then '无当前选定行
blnFindNoChange = mclsList(sstCustom.Tab).FindNoChange
mclsList(sstCustom.Tab).FindNoChange = True
txtFind.Text = ""
mclsList(sstCustom.Tab).FindNoChange = blnFindNoChange
cmdAgain.Enabled = False
End If
frmMain.SetToolBar
End Sub
'重画Form
Private Sub RedrawForm()
On Error Resume Next
With sstCustom
.Left = ListFormLeft
Debug.Print "Form WidTh:" & Me.ScaleWidth
Debug.Print "Form Height:" & Me.ScaleHeight
.width = Me.ScaleWidth - ListFormLeft - ListFormRight
.Height = Me.ScaleHeight - ssTabUpAreaHeight - ListDownAreaHeight
End With
'重画MS FlexGrid 控件
With mclsList(sstCustom.Tab).FlexGrid
.Left = ListGridLeft
.width = sstCustom.width - ListGridLeft - ListGridRight
.Height = sstCustom.Height - sstCustom.TabHeight - ListGridTop - ListGridBottom
End With
'重画其余控件
txtFind.width = Me.ScaleWidth - txtFind.Left - ListFormBottom - cmdAgain.width - 15
cmdAgain.Left = txtFind.Left + txtFind.width
cmdEAR(0).top = Me.ScaleHeight - cmdEAR(0).Height - ListFormBottom
cmdEAR(1).top = cmdEAR(0).top
cmdEAR(2).top = cmdEAR(0).top
cmdEAR(3).top = cmdEAR(0).top
chkShowall.top = cmdEAR(0).top
chkShowall.Left = Me.ScaleWidth - chkShowall.width - ListFormBottom
End Sub
'命令控件数组
Private Sub cmdEAR_Click(Index As Integer)
Dim PosX, PosY As Integer
Dim intCol As Integer
Dim strAccountName As String
Dim intFlag As Integer
Dim recTemplete As rdoResultset
PosX = cmdEAR(Index).Left
PosY = cmdEAR(Index).top + cmdEAR(Index).Height
With frmMain
Select Case Index
Case 0
MakeListEditMenu
PopupMenu .mnuListEdit, , PosX, PosY
Case 1
With mclsList(sstCustom.Tab).FlexGrid
If .Row > 0 Then
Set recTemplete = GetbyListID(sstCustom.Tab, ListID(sstCustom.Tab))
'intCol = GetCol("科目名称")
If recTemplete.RowCount > 0 Then
strAccountName = recTemplete!strAccountName '.TextMatrix(.Row, intCol)
'intCol = GetCol("科目性质")
'If .Row > 0 Then
intFlag = recTemplete!lngAccountNatureID '.TextMatrix(.Row, intCol)
End If
End If
End With
MakeListReportMenu strAccountName
Select Case intFlag
Case 1, 2
.mnuListReportMenu(0).Caption = "日记帐:" & Mid(.mnuListReportMenu(0).Caption, 4)
Case Else
.mnuListReportMenu(0).Caption = "明细帐:" & Mid(.mnuListReportMenu(0).Caption, 4)
End Select
PopupMenu .mnuListReport, , PosX, PosY
' MakeListReportMenu (getDepEmp())
' PopupMenu .mnuListReport, , PosX, PosY
Case 2
'期初余额定
Me.MousePointer = vbHourglass
Me.Enabled = False
frmAccountInit.Show
frmAccountInit.ZOrder 0
Me.Enabled = True
Me.MousePointer = vbDefault
Case 3
Me.MousePointer = vbHourglass
Me.Enabled = False
With frmBudgetList
.Showlist 0
End With
Me.Enabled = True
Me.MousePointer = vbDefault
End Select
End With
End Sub
'取部门职员
Private Function getDepEmp() As String
Dim strDepEmp As String
Select Case sstCustom.Tab
Case 0
strDepEmp = GetNameStr(msgCustom0, "自定项目名称")
Case 1
strDepEmp = GetNameStr(msgCustom1, "自定项目名称")
Case 2
strDepEmp = GetNameStr(msgCustom2, "自定项目名称")
Case 3
strDepEmp = GetNameStr(msgCustom3, "自定项目名称")
Case 4
strDepEmp = GetNameStr(msgCustom4, "自定项目名称")
Case 5
strDepEmp = GetNameStr(msgCustom5, "自定项目名称")
End Select
getDepEmp = strDepEmp
End Function
Private Sub Form_Deactivate()
frmMain.SetEditUnEnabled
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
On Error Resume Next
If KeyAscii = vbKeyEscape Then
Unload Me
ElseIf KeyAscii = vbKeyReturn Then
BKKEY Me.ActiveControl.hwnd, vbKeyTab
End If
End Sub
'
'窗体 Form 控件
'
Private Sub Form_Load()
Dim intCount As Integer
Dim i As Integer
Dim intSortCol As Integer
Dim intResponse As Integer
On Error GoTo ErrHandle
' Me.Hide
' Me.Left = -30000
MsgForm.PleaseWait
Me.HelpContextID = 30002
' InitsstCustom
'部门职员列表窗体初始化
Debug.Print "Load Start: ", Timer
inintTabName
intViewID(0) = 6
intViewID(1) = 385
intViewID(2) = 386
intViewID(3) = 387
intViewID(4) = 388
intViewID(5) = 389
For i = 0 To 5
Set mclsList(i) = New list
Set mclsList(i).FindKind = cboFindKind
'Set mclsList(i).Again = cmdAgain
Set mclsList(i).Find = txtFind
Next
Set mclsList(0).FlexGrid = msgCustom0
Set mclsList(1).FlexGrid = msgCustom1
Set mclsList(2).FlexGrid = msgCustom2
Set mclsList(3).FlexGrid = msgCustom3
Set mclsList(4).FlexGrid = msgCustom4
Set mclsList(5).FlexGrid = msgCustom5
' Unload Me
'设置钩子对象
Set mclsSubClass = New SubClass32.SubClass
mclsSubClass.Messages(WM_PAINT) = True
mclsSubClass.Messages(WM_LBUTTONUP) = True
mclsSubClass.Messages(WM_LBUTTONDOWN) = True
mclsSubClass.Messages(WM_MOUSEMOVE) = True
' mclsSubClass.Messages(WM_KEYDOWN) = True
Set mclsSubClassform = New SubClass32.SubClass
mclsSubClassform.hwnd = Me.hwnd
' mclsSubClassform.Messages(WM_PAINT) = True
mclsSubClassform.Messages(WM_GETMINMAXINFO) = True
Unload MsgForm
Set mclsMainControl = gclsSys.MainControls.Add(Me)
' If sstCustom.Tab = 0 Then
' sstCustom_Click 0
' Else
' sstCustom.Tab = 0
' End If
Exit Sub
Dim edtErrReturn As ErrDealType
ErrHandle:
edtErrReturn = Errors.ErrorsDeal
If edtErrReturn = edtResume Then
Resume
Else
On Error Resume Next
Unload MsgForm
Unload Me
End If
'Debug.Print "Load End: ", Timer
End Sub
'右键菜单
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = vbRightButton And frmMain.ActiveForm Is Me Then
MakeListEditMenu
PopupMenu frmMain.mnuListEdit
End If
End Sub
'画格式线
Private Sub Form_Paint()
DrawInSertLine Me.hwnd, ListFormLeft, 500, Me.width - 2 * (ListFormLeft + ListFormRight), 500
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = vbFormControlMenu Then
Select Case True
Case mIsShowCard(0) '科目卡片
ShowMsg Me.hwnd, "请先关闭会计科目卡片!", vbCritical, "会计科目关闭提示"
Cancel = True
' frmAccountListCard.Show
' frmAccountListCard.ZOrder 0
' Case mIsShowCard(1) '期初余额
' ShowMsg Me.hwnd, "请先关闭期初余额卡片!", &H40&, "期初余额关闭提示"
' Cancel = True
' frmAccountInit.Show
' frmAccountInit.ZOrder 0
Case mIsShowCard(2) '科目复制
' ShowMsg Me.hwnd, "请先关闭科目复制卡片!", &H40&, "科目复制关闭提示"
' Cancel = True
' frmAccountCopyCard.Show
' frmAccountCopyCard.ZOrder 0
End Select
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim intCount As Integer
On Error Resume Next
' If mIsShowCard(0) Then Unload frmAccountListCard
' If mIsShowCard(1) Then Unload frmAccountInit
' If mIsShowCard(2) Then Unload frmAccountCopyCard
For intCount = 0 To sstCustom.Tabs - 1
If blnIsLoad(intCount) Then
mclsList(intCount).SaveListSet
End If
blnIsLoad(intCount) = False
Set mclsList(intCount) = Nothing
Next
Set mclsSubClass = Nothing
Set mclsSubClassform = Nothing
gclsSys.MainControls.Remove Me
Set mclsMainControl = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -