Skip to content

clsXDocumentCollection

clsXDocumentCollection is a collection of clsXDocument print job documents. It extends clsBusinessCollectionBase and drives batch/group printing logic via the PrintType enum. On retrieve, it joins XDOCUMENT, XPRINTER_BIN, and XPRINTER to resolve physical bin numbers and printer network names. It also defines the batch-level delete operation that removes all documents for a given print-control batch.

Purpose

  • Retrieve ordered documents for a print-control batch with physical printer/bin routing resolved.
  • Support two printing modes: per-document (ByDocSeq) via SQL-011 and grouped (ByPrintGroup) via SQL-012.
  • Delete all documents belonging to a print-control batch via SQL-021.

Context

  • Namespace: SAIF.Services.Printing.Remote
  • Assembly/package: SAIF.BOF.Services.Printing.Remote
  • Base class: clsBusinessCollectionBase (from SAIF.BOF.Framework/SAIF.BOF.Business)

Public members

Member Signature Purpose
GetXDocumentCollection Public Shared Function GetXDocumentCollection(inSeqNum As Decimal, inPrinterID As String) As clsXDocumentCollection* Factory method — retrieves all documents for a batch, joined to printer/bin routing.*
Criteria (nested class) Public Class Criteria Implements IBusinessCriteria Holds SQL: RetrieveSQL (SQL-011), RetrievePrintSQL (SQL-012, supplemental non-interface property), DeleteSQL (SQL-021); InsertSQL, UpdateSQL throw (empty).
Criteria.PrintType Public Property PrintType As PrintType* Controls which SQL is executed: ByDocSeq (SQL-011, per-document) or ByPrintGroup (SQL-012, grouped).*
Criteria.RetrievePrintSQL Public Property RetrievePrintSQL As String Supplemental property — not part of IBusinessCriteria. Returns SQL-012 text for ByPrintGroup mode.*

Behavioral notes

  • BeforeRetrieve selects between RetrieveSQL and RetrievePrintSQL based on Criteria.PrintType.*
  • Both retrieval paths bind the same two parameters: :XPrintControlSeqNum and :PrinterID.
  • AfterRetrieve iterates IDataReader, loading each document via Load()/Fill().*
  • AfterDelete checks RowsAffected <> 1 per BR-001. However, no BeforeDelete override exists in this class — execution of SQL-021 depends on undocumented base-class default wiring.**
  • InsertSQL unconditionally throws — batch-level insert is not supported; use individual clsXDocument instances for insert.*

Constraints and usage notes

  • Retrieve requires both XPrintControlSeqNum and PrinterID — printer routing cannot be resolved without a specific printer ID.
  • ByPrintGroup mode collapses per-document rows to distinct PRINT_GROUP_TEXT values with literal placeholder values for per-document columns not relevant to group-level printing.*

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • Services\SAIF.Services.Printing.Remote\clsXDocumentCollection.vb