-
Notifications
You must be signed in to change notification settings - Fork 0
/
customer.dmd
72 lines (62 loc) · 1.8 KB
/
customer.dmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
** END HEADER -- do not remove this line
//
// Generated on 16/11/2024
//
class customerDATAMODULE of BASECDATAMODULE from :DT_Custom2:base.cdm
with (this.DBASETUTORIAL21)
left = 19.0
top = 135.0
width = 115.0
height = 112.0
endwith
this.CUSTOMER1 = new QUERY(this)
with (this.CUSTOMER1)
onOpen = class::CUSTOMER1_ONOPEN
left = 427.0
top = 41.0
width = 114.0
height = 100.0
database = form.dbasetutorial21
sql = 'Select * from "customer"'
active = true
endwith
with (this.CUSTOMER1.rowset)
canSave = class::ROWSET_CANSAVE
with (fields["State ID"])
lookupSQL = "select * from state order by state"
endwith
with (fields["Country ID"])
lookupSQL = "select * from country order by country"
endwith
with (fields["Full Name"])
beforeGetValue = class::FULLNAME_BEFOREGETVALUE
endwith
indexName = "NAMES"
endwith
this.rowset = this.customer1.rowset
function CUSTOMER1_onOpen()
class::calcField("Full Name",30)
return
function FullName_beforeGetValue()
local a
a = trim( this.parent["first name"].value ) + " " ;
+this.parent["last name"].value
return a
function rowset_canSave()
local cErrors, bRetVal
cErrors = "" // String for errors
if empty( this.fields[ "Last name" ].value )
cErrors += "- LAST NAME cannot be blank" + chr(13)
endif
if empty( this.fields[ "postal" ].value )
cErrors += "- POSTAL CODE cannot be blank" + chr(13)
endif
if "" # cErrors
msgbox( "Can't save current entry because:" + chr(13) + ;
cErrors, "Bad entry", 48 )
bRetVal = false
else
bRetVal = true
endif
return bRetVal
endclass