Module Vendor.wo

     1Use cAutoWebReport.pkg
     2Use cWebBusinessProcess.pkg
     3Use DataDict.pkg
     4Use cWebReport.pkg
     5Use Vendor.DD
     6
     7Object oVendor is a cWebBusinessProcess
     8    Set pbClearAfterSave to False
     9    Set psDescription to "Vendor: Entry, Reporting and Maintenance"
    10
    11    Object Vendor_DD is a Vendor_DataDictionary
    12        Send DefineAllExtendedFields
    13    End_Object    // Vendor_DD
    14
    15    Set Main_DD to Vendor_DD
    16
    17    Object oReport is a cWebReport
    18
    19        Procedure OnPageTop
    20            Send WriteHtmlTableBegin 'border="0" width="99%" Class="ReportTable"'
    21
    22            Send WriteHtmlRowBegin
    23                Send WriteHtmlCellHeader 'Vndr ID' 'Class="Header" Align="right"'
    24                Send WriteHtmlCellHeader 'Name' 'Class="Header" Align="left"'
    25                Send WriteHtmlCellHeader 'Address' 'Class="Header" Align="left"'
    26                Send WriteHtmlCellHeader 'City' 'Class="Header" Align="left"'
    27                Send WriteHtmlCellHeader 'St.' 'Class="Header" Align="left"'
    28                Send WriteHtmlCellHeader 'Zip' 'Class="Header" Align="left"'
    29                Send WriteHtmlCellHeader 'Phone' 'Class="Header" Align="left"'
    30                Send WriteHtmlCellHeader 'Fax' 'Class="Header" Align="left"'
    31            Send WriteHtmlRowEnd
    32        End_Procedure // OnPageTop
    33
    34        Procedure OnBody
    35            String sText
    36            Number nId
    37            String sName sAddress sCity sState sZip sPhone sFax
    38
    39            Get ddValueEncode "Vendor.ID" To nID
    40            Get ddValueEncode "Vendor.Name" To sName
    41            Get ddValueEncode "Vendor.Address" To sAddress
    42            Get ddValueEncode "Vendor.City" To sCity
    43            Get ddValueEncode "Vendor.State" To sState
    44            Get ddValueEncode "Vendor.Zip" To sZip
    45            Get ddValueEncode "Vendor.Phone_Number" To sPhone
    46            Get ddValueEncode "Vendor.Fax_Number" To sFax
    47            Send WriteHtmlRowBegin
    48                Get AddRowIdLink (FormatNumber(nId,0)) To sText
    49                Send WriteHtmlCell sText 'Class="Data" Align="right"'
    50                Send WriteHtmlCell sName 'Class="Data" Align="left"'
    51                Send WriteHtmlCell sAddress 'Class="Data" Align="left"'
    52                Send WriteHtmlCell sCity 'Class="Data" Align="left"'
    53                Send WriteHtmlCell sState 'Class="Data" Align="left"'
    54                Send WriteHtmlCell sZip 'Class="Data" Align="left"'
    55                Send WriteHtmlCell sPhone 'Class="Data" Align="left"'
    56                Send WriteHtmlCell sFax 'Class="Data" Align="left"'
    57            Send WriteHtmlRowEnd
    58        End_Procedure // OnBody
    59
    60        Procedure OnPageBottom
    61            Send WriteHtmlTableEnd
    62        End_Procedure // OnPageBottom
    63
    64        Function RunVendorList Integer iIndex RowId riStart Integer iMax Returns RowId
    65            RowId riEnd
    66            integer  iStat
    67
    68            Set piOrdering           To iIndex
    69            Set piMaxCount           To iMax
    70            Set piMaxCountBreakLevel To 0
    71            Set priStartRowId        To riStart
    72            Get DoRunReport          To iStat
    73            Get priLastRowId         To riEnd
    74            Function_Return riEnd
    75        End_Function // RunVendorList
    76
    77    End_Object    // oReport
    78
    79    { Published = True  }
    80    { Description = ""  }
    81    Procedure SetHRefName String sName
    82        Set psHRefname Of oReport To sName
    83    End_Procedure // SetHRefName
    84
    85    { Published = True  }
    86    { Description = ""  }
    87    Function RunVendorList Integer iIndex string sStart Integer iMax Returns string
    88        RowId riStart riEnd
    89        Move (DeserializeRowID(sStart)) to riStart
    90        Get RunVendorList Of oReport iIndex riStart iMax To riEnd
    91        Function_Return (SerializeRowId(riEnd))
    92    End_Function // RunVendorList
    93
    94    //  Register WBO interfaces
    95    Send RegisterStandardInterface
    96    //Send RegisterDebugInterface
    97    //Send RegisterFullErrorInterface
    98
    99    // These are used by Vendor0.asp as an example of an auto entry, auto-report
   100    Send RegisterAutoEntryInterface
   101    Object oAutoWebReport Is A cAutoWebReport
   102    End_Object
   103
   104End_Object    // oVendor
   105