VbzCart/docs/archive/code/VBA/clsPackageQueueItem: Difference between revisions
Jump to navigation
Jump to search
imported>Woozle (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 (Woozle moved page VbzCart/VbzCart/archive/code/VBA/clsPackageQueueItem to VbzCart/docs/archive/code/VBA/clsPackageQueueItem without leaving a redirect: correct naming (was no way to import directly to this name)) |
||
(2 intermediate revisions by one other 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 01:53, 25 February 2024
' 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