-
Notifications
You must be signed in to change notification settings - Fork 2
/
Address.cls
223 lines (116 loc) · 3.38 KB
/
Address.cls
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "Address"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Private cId As Long
Private fLongitude As Double
Private fLatitude As Double
Private lTaxRegionId As Long
Private sCountry As String
Private sPostalCode As String
Private sRegion As String
Private sCity As String
Private sLine3 As String
Private sLine2 As String
Private sLine1 As String
Private sBoundaryLevel As String
Private cTransactionId As Long
Property Get Id() As Long
Let Id = cId
End Property
Property Let Id(Id As Long)
Let cId = Id
End Property
Property Get TransactionId() As Long
Let TransactionId = cTransactionId
End Property
Property Let TransactionId(TransactionId As Long)
Let cTransactionId = TransactionId
End Property
Property Get BoundaryLevel() As String
Let BoundaryLevel = sBoundaryLevel
End Property
Property Let BoundaryLevel(BoundaryLevel As String)
Let sBoundaryLevel = BoundaryLevel
End Property
Property Get Line1() As String
Let Line1 = sLine1
End Property
Property Let Line1(Line1 As String)
Let sLine1 = Line1
End Property
Property Get Line2() As String
Let Line2 = sLine2
End Property
Property Let Line2(Line2 As String)
Let sLine2 = Line2
End Property
Property Get Line3() As String
Let Line3 = sLine3
End Property
Property Let Line3(Line3 As String)
Let sLine3 = Line3
End Property
Property Get City() As String
Let City = sCity
End Property
Property Let City(City As String)
Let sCity = City
End Property
Property Get Region() As String
Let Region = sRegion
End Property
Property Let Region(Region As String)
Let sRegion = Region
End Property
Property Get PostalCode() As String
Let PostalCode = sPostalCode
End Property
Property Let PostalCode(PostalCode As String)
Let sPostalCode = PostalCode
End Property
Property Get Country() As String
Let Country = sCountry
End Property
Property Let Country(Country As String)
Let sCountry = Country
End Property
Property Get TaxRegionId() As Long
Let TaxRegionId = lTaxRegionId
End Property
Property Let TaxRegionId(TaxRegionId As Long)
Let lTaxRegionId = TaxRegionId
End Property
Property Get Latitude() As Double
Let Latitude = fLatitude
End Property
Property Let Latitude(Latitude As Double)
Let fLatitude = Latitude
End Property
Property Get Longitude() As Double
Let Longitude = fLongitude
End Property
Property Let Longitude(Longitude As Double)
Let fLongitude = Longitude
End Property
Function ToJson() As Object
Dim Json As Object
Set Json = JsonConverter.ParseJson("{}")
Json("line1") = Me.Line1
Json("line2") = Me.Line2
Json("line3") = Me.Line3
Json("city") = Me.City
Json("region") = Me.Region
Json("country") = Me.Country
Json("postalCode") = Me.PostalCode
If Round(Me.Latitude, 6) <> Round(0, 6) Or Round(Me.Longitude, 6) <> Round(0, 6) Then
Json("latitude") = Me.Latitude
Json("longitude") = Me.Longitude
End If
Set ToJson = Json
End Function