home *** CD-ROM | disk | FTP | other *** search
- //--------------------------------------------------------------
- //
- // InvoiceOpen.wfm - Mugs Sample Application
- //
- // Invoice Open dialog for selecting an Invoice from the
- // Customer data entry form..
- //
- // Dependencies: <none>
- //
- // Visual dBASE Samples Group
- //
- // $Revision: 1.7 $
- //
- // Copyright (c) 1997, Borland International, Inc.
- // All rights reserved.
- //
- //---------------------------------------------------------------
- ** END HEADER -- do not remove this line
- //
- // Generated on 10/23/97
- //
- parameter bModal
- local f
- f = new InvoiceOpenForm()
- if (bModal)
- f.mdi = false // ensure not MDI
- f.readModal()
- else
- f.open()
- endif
-
- class InvoiceOpenForm of FORM
- with (this)
- autoCenter = true
- scaleFontSize = 8
- scaleFontBold = false
- height = 11
- left = 30
- top = 0
- width = 35
- text = ""
- endwith
-
-
- this.DMCONNECT = new DATAMODREF()
- this.DMCONNECT.parent = this
- with (this.DMCONNECT)
- filename = "connect.dmd"
- dataModClass = "ConnectDataModule"
- share = 0
- active = true
- left = 0
- top = 0
- endwith
-
-
- this.LISTINVOICE = new LISTBOX(this)
- with (this.LISTINVOICE)
- onOpen := { ; this.curSel := 1 }
- height = 8
- left = 2
- top = 2
- width = 17
- metric = 0
- id = 101
- fontName = "MS Sans Serif"
- fontSize = 8
- colorHighLight = "HighLightText/HighLight"
- endwith
-
-
- this.BUTTONOPEN = new PUSHBUTTON(this)
- with (this.BUTTONOPEN)
- onClick = class::BUTTONOPEN_ONCLICK
- height = 1.2105
- left = 21
- top = 2.3684
- width = 12
- text = "&Open"
- metric = 0
- default = true
- fontName = "MS Sans Serif"
- fontSize = 8
- group = true
- colorNormal = "BtnText/BtnFace"
- value = false
- endwith
-
-
- this.BUTTONCANCEL = new PUSHBUTTON(this)
- with (this.BUTTONCANCEL)
- onClick = {; this.form.close()}
- height = 1.2105
- left = 21
- top = 4.2632
- width = 12
- text = "Cancel"
- metric = 0
- fontName = "MS Sans Serif"
- fontSize = 8
- group = true
- colorNormal = "BtnText/BtnFace"
- value = false
- endwith
-
-
- this.TEXT1 = new TEXT(this)
- with (this.TEXT1)
- height = 1
- left = 2
- top = 1
- width = 9
- metric = 0
- colorNormal = "BtnText"
- fontName = "MS Sans Serif"
- fontSize = 8
- text = "Invoice:"
- endwith
-
-
- // {Linked Method} form.buttonopen.onClick
- function BUTTONOPEN_OnClick
- local nInvoiceID
- nInvoiceID = VAL(this.form.listInvoice.value)
- if ( TYPE("this.form.app") == "O" )
- this.form.app.openInvoiceForm( nInvoiceID )
- endif
- return ( this.form.close() )
-
- function FillInvoiceList( nCustomerID )
- local i, q
- i = 1
- q = new Query()
- with ( q )
- database := this.dmConnect.ref.dbMugs
- sql := 'SELECT invoice."Invoice ID" ' + ;
- ' FROM "invoice.dbf" invoice ' + ;
- ' WHERE invoice."Customer ID" = ' + STR(nCustomerID)
- active := true
- endwith
-
- this.iCount = q.rowset.count()
-
- if ( this.iCount > 0 )
- this.aInvoice = new Array( this.iCount )
- for i = 1 to this.iCount
- this.aInvoice[i] = q.rowset.fields["Invoice ID"].value
- q.rowset.next()
- next
- this.aInvoice.sort()
- this.listInvoice.dataSource := "ARRAY form.aInvoice"
- this.listInvoice.curSel := this.iCount
- endif
-
- q.active := false
- this.text := "Customer - " + LTRIM(STR(nCustomerID))
- return ( this.iCount > 0 )
- endclass
-