01.
Imports
System.Runtime.InteropServices
02.
03.
<ComVisible(
True
), InterfaceType(ComInterfaceType.InterfaceIsDual), GuidAttribute(
"D5447A7B-FDD0-4869-8B12-69EB1A56E6E0"
)> _
04.
Public
Interface
IEWarootUfl
05.
06.
Function
NumberThai(
ByVal
strPass
As
String
)
As
String
07.
Function
StringDate(
ByVal
pDate
As
DateTime,
ByVal
Date_Format
As
String
,
Optional
ByVal
Era_Type
As
String
=
"en_US"
)
As
String
08.
Function
BahtText(
ByVal
dblPass
As
Double
)
As
String
09.
10.
End
Interface
11.
12.
Imports
System.Runtime.InteropServices
13.
Imports
System.Globalization
14.
<ComVisible(
True
), ClassInterface(ClassInterfaceType.None), GuidAttribute(
"F2AFEC0E-B776-41a7-A4CD-CF7F09386AE5"
)> _
15.
Public
Class
CRUFLWaroot :
Implements
IEWarootUfl
16.
17.
18.
19.
20.
Public
Function
NumberThai(
ByVal
strPass
As
String
)
As
String
Implements
IEWarootUfl.NumberThai
21.
If
String
.IsNullOrEmpty(strPass) =
True
OrElse
strPass.Trim.Length = 0
Then
Return
String
.Empty
22.
For
iSub
As
Byte
= 0
To
9
23.
strPass = strPass.Replace(iSub.ToString, Chr(iSub + 240))
24.
Next
25.
Return
strPass
26.
End
Function
27.
28.
29.
30.
31.
Function
BahtText(
ByVal
dblPass
As
Double
)
As
String
Implements
IEWarootUfl.BahtText
32.
Return
"หนึ่งสองสามสี่"
33.
End
Function
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
Public
Function
StringDate(pDate
As
Date
, Date_Format
As
String
,
Optional
Era_Type
As
String
=
"en_US"
)
As
String
Implements
IEWarootUfl.StringDate
45.
Return
pDate.ToString(Date_Format,
New
CultureInfo(Era_Type))
46.
End
Function
47.
End
Class