Difference between revisions of "VbzCart/archive/code/VBA/clsPackageQueueItem"
Jump to navigation
Jump to search
(Created page with "<VB> ' CLASS: clsPackageQueueItem Option Compare Database Option Explicit Private vID As Long Private vPackage As Long Private vReport As String Private vWhenPrinted As Varia...") |
m |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <VB> | + | <syntaxhighlight lang=VB> |
' CLASS: clsPackageQueueItem | ' CLASS: clsPackageQueueItem | ||
Line 70: | Line 70: | ||
End If | End If | ||
End Property | End Property | ||
− | </ | + | </syntaxhighlight> |
Latest revision as of 12:50, 14 October 2022
' CLASS: clsPackageQueueItem
Option Compare Database
Option Explicit
Private vID As Long
Private vPackage As Long
Private vReport As String
Private vWhenPrinted As Variant
Public Sub Init(iFields As Fields)
With iFields
vID = !ID
vPackage = !ID_Package
vReport = !ReportName
vWhenPrinted = !WhenPrinted
End With
End Sub
Public Sub Create(iPackage As Long, iReport As String)
With clsPackageQueue
.DataOpen
With .Data
.AddNew
vID = !ID
!ID_Package = iPackage
!ReportName = iReport
.Update
End With
.DataShut
End With
End Sub
Public Property Get Package_ID() As Long
Package_ID = vPackage
End Property
Public Property Get Report() As String
Report = vReport
End Property
Public Property Get WhenPrinted() As Date
WhenPrinted = vWhenPrinted
End Property
Public Property Get Printed() As Boolean
Printed = Not IsNull(vWhenPrinted)
End Property
Private Function Located() As Boolean
With clsPackageQueue
.DataOpen
With .Data
.FindFirst "ID=" & vID
Located = Not .NoMatch
End With
.DataShut
End With
End Function
Public Property Let Printed(iDone As Boolean)
If iDone <> Me.Printed Then
With clsPackageQueue
.DataOpen
If Located Then
With .Data
.Edit
If iDone Then
' set the timestamp
!WhenPrinted = Now
Else
!WhenPrinted = Null
End If
.Update
End With
End If
End With
End If
End Property