⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clslistadjustprice.cls

📁 金算盘软件代码
💻 CLS
字号:
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsListAdjustPrice"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False

Private intFormType As Integer
Private WithEvents mfrmAdjustPrice As frmAListTemplate  '模版窗体
Attribute mfrmAdjustPrice.VB_VarHelpID = -1
Private mclsAdjust As clsAdjust                         '接口类
Private frmEdit As Form                                 '接口窗体
Private blnIsVoid    As Boolean                         '是否已作废
Private blnIsInvoice As Boolean                         '开票标志
Private blnChange As Boolean                            '只能编辑和删除自己制作的单据
Private mblnFinish As Boolean
Private mIsShowEdit As Boolean

Private clsListType As String
'列表类型
Public Function SetListType(ByVal strList As String)
    mfrmAdjustPrice.strListType = strList
    clsListType = strList
End Function
Private Sub cMsgBox(strMsg As String, Optional strTitle As String)
    If Trim(strTitle) = "" Then
        strTitle = "提示信息"
    End If

    ShowMsg mfrmAdjustPrice.hWnd, strMsg, MB_OK + MB_ICONEXCLAMATION + MB_SYSTEMMODAL, strTitle
End Sub
'类的初始化
Private Sub Class_Initialize()
    Set mfrmAdjustPrice = New frmAListTemplate
    mfrmAdjustPrice.blnReceptionList = True
    mfrmAdjustPrice.mTitle = "调价单列表"
    mfrmAdjustPrice.mHelpID = 10529
    mfrmAdjustPrice.Tabs = 1
    mfrmAdjustPrice.SpViewID(0) = 83
    mfrmAdjustPrice.blnEditByRight(0) = IsCanDo(frmRightsID.frmListAdjustPriceID, gclsBase.OperatorID)
    
    
    mfrmAdjustPrice.SpSelect(0) = "ItemActivity.lngActivityID , Min(decode(ItemActivity.blnIsVoid,1,'√',' ')) AS ""作废"""
    If Not IsCanDo(272, gclsBase.OperatorID) Then
        mfrmAdjustPrice.SpWhere(0) = "ItemActivity.lngActivityTypeID=29 And ItemActivity.lngOperatorID = " & gclsBase.OperatorID
    Else
        mfrmAdjustPrice.SpWhere(0) = "ItemActivity.lngActivityTypeID=29"
    End If
    
    mfrmAdjustPrice.SpGoupBy(0) = "ItemActivity.lngActivityID"
    mfrmAdjustPrice.ShowAll(0) = "ItemActivity.blnIsVoid=0"
    
    mfrmAdjustPrice.SpPrintID(0) = 53
    mfrmAdjustPrice.SpPrintTitle(0) = "调价单列表" & Chr(1) & gclsBase.BaseName & Chr(1) & gclsBase.OperatorName
    mfrmAdjustPrice.MenuEnbaleOnPage(0) = 1
    mfrmAdjustPrice.MenuEnbaleOnPage(1) = 1
    mfrmAdjustPrice.MenuEnbaleOnPage(2) = 1
    mfrmAdjustPrice.MenuEnbaleOnPage(3) = 1
    mfrmAdjustPrice.MenuEnbaleOnPage(4) = 1
    mfrmAdjustPrice.MenuEnbaleOnPage(5) = 1
    mfrmAdjustPrice.MenuEnbaleOnPage(6) = 1
    mfrmAdjustPrice.MenuEnbaleOnPage(7) = 1
End Sub
'调用接口
Public Function Showlist()
    mfrmAdjustPrice.Show
    mfrmAdjustPrice.ZOrder 0
    Set mclsAdjust = New clsAdjust
    mclsAdjust.SethWnd mfrmAdjustPrice.hWnd
    Set frmEdit = frmAdjustPrice
End Function
'处理消息
Private Sub mfrmAdjustPrice_ListChildActive()
    Dim vntMessage As Variant
    For Each vntMessage In mfrmAdjustPrice.mclsMainControl.Messages
        If vntMessage = Message.msgReceipt29 Then
            mfrmAdjustPrice.ToolRefresh
            mfrmAdjustPrice.mclsMainControl.Messages.Remove CStr(vntMessage) '清除消息
        End If
    Next
    mfrmAdjustPrice.mclsMainControl.Messages.Clear
End Sub
'删除
Private Sub mfrmAdjustPrice_ListDel()
    Dim lngActivityID As Long
    lngActivityID = mfrmAdjustPrice.ListID
    If lngActivityID = 0 Then Exit Sub
    If GetItemStatus(lngActivityID) = False Then Exit Sub
    If mIsShowEdit Then
        If lngActivityID = frmEdit.getID Then
            cMsgBox "不能删除当前编辑的单据!"
            Exit Sub
        End If
    End If
    If Not blnChange Then
        cMsgBox "不能删除由他人制作的单据!"
        Exit Sub
    End If
    If Not mclsAdjust.DeleteAdjustPrice(lngActivityID) Then Exit Sub
    mfrmAdjustPrice.ToolRefresh
End Sub
'编辑
Private Sub mfrmAdjustPrice_ListEdite()
    Dim lngActivityID As Long
    
    mfrmAdjustPrice.Enabled = False
    mblnFinish = True
    lngActivityID = mfrmAdjustPrice.ListID
    If mIsShowEdit Then
        frmEdit.ShowAOldBill (lngActivityID) '调用接口
    Else
        mIsShowEdit = True
        frmEdit.ShowAOldBill (lngActivityID) '调用接口
    End If
    mblnFinish = False
    mfrmAdjustPrice.Enabled = True
End Sub

Private Sub mfrmAdjustPrice_oListInActive()
    Dim lngActivityID As Long
    
On Error GoTo TheErr
    lngActivityID = mfrmAdjustPrice.ListID
    If lngActivityID = 0 Then Exit Sub
    If mfrmAdjustPrice.IsInActive Then Exit Sub
    If Not GetItemStatus(lngActivityID) Then Exit Sub
    If Not blnChange Then
        cMsgBox "不能作废由他人制作的单据!"
        Exit Sub
    End If
    If Not mclsAdjust.DeleteAdjustPrice(lngActivityID, True) Then Exit Sub
    mfrmAdjustPrice.ToolRefresh
    Exit Sub
TheErr:
    'cMsgBox "操作失败!"
End Sub
'
Private Sub mfrmAdjustPrice_ListInActive(blnLevel As Boolean, blnSuceess As Boolean)
     Dim lngActivityID As Long
    
On Error GoTo TheErr
blnLevel = False
blnSuceess = False
    lngActivityID = mfrmAdjustPrice.ListID
    If lngActivityID = 0 Then Exit Sub
    If mfrmAdjustPrice.IsInActive Then Exit Sub
    If Not GetItemStatus(lngActivityID) Then Exit Sub
    If Not blnChange Then
        cMsgBox "不能作废由他人制作的单据!"
        Exit Sub
    End If
    If Not mclsAdjust.DeleteAdjustPrice(lngActivityID, True) Then Exit Sub
    'mfrmAdjustPrice.ToolRefresh
    blnSuceess = True
    Exit Sub
TheErr:
    'cMsgBox "操作失败!"
End Sub

Private Sub mfrmAdjustPrice_ListNew()
    mblnFinish = True
    If mIsShowEdit Then
        frmEdit.ShowANewBill
    Else
        frmEdit.ShowANewBill
        mIsShowEdit = True
    End If
    mblnFinish = False
End Sub

Private Sub mfrmAdjustPrice_ListPrintReceipt()
    frmPrintReceipt.ShowfrmPrintReceipt 31
End Sub

Private Sub mfrmAdjustPrice_ListShowAll()
    With mfrmAdjustPrice
        If .chkShowall = 0 Then
            .ShowAll(0) = " ItemActivity.blnIsVoid=0"
        Else
            .ShowAll(0) = ""
        End If
        .ToolRefresh
    End With
End Sub

Private Function GetItemStatus(lngActivityID As Long) As Boolean
    Dim recTemp As rdoResultset
    
    strSql = "SELECT ItemActivity.lngVoucherID, ItemActivity.lngOperatorID From ItemActivity" _
            & " WHERE (ItemActivity.lngActivityID)=" & lngActivityID
    Set recTemp = gclsBase.BaseDB.OpenResultset(strSql, rdOpenForwardOnly)
    If recTemp.BOF And recTemp.EOF Then Exit Function
    If gclsBase.OperatorID = recTemp(1) Then
        blnChange = True
    Else
        blnChange = False
    End If
    GetItemStatus = True
End Function

'告诉列表:编辑窗口已关闭
Public Sub IAmCLosed()
    mIsShowEdit = False
End Sub



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -