-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUtil.bbj
More file actions
55 lines (45 loc) · 1.82 KB
/
Util.bbj
File metadata and controls
55 lines (45 loc) · 1.82 KB
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
use com.basiscomponents.db.ResultSet
use com.basiscomponents.db.DataRow
class public Util
method public static void buildError(Object errors!, BBjString message!, BBjString multipleMessage!)
declare BBjVector errVec!
declare ResultSet errRs!
errRs! = cast(ResultSet,errors!,err=*next)
if (errRs! <> null()) then
#buildErrorFromRS(errRs!,message!,multipleMessage!)
endif
errVec! = cast(BBjVector,errors!,err=*next)
if (errVec! <> null()) then
#buildErrorFromVector(errRs!,message!,multipleMessage!)
endif
methodend
method public static void buildErrorFromRS(ResultSet errorRs!, BBjString message!, BBjString multipleMessage!)
if (!errorRs!.isEmpty()) then
if errorRs!.size() > 1 then
message! = multipleMessage!
endif
for i = 0 to errorRs!.size() -1
dr! = errorRs!.get(i)
if(dr!.contains("MESSAGE")) then
error! = dr!.getFieldAsString("MESSAGE")
else
error! = dr!.getFieldAsString("error")
endif
message! = message! + $0a$ + error!
next i
a = msgbox(message!,1,"Error")
methodret
endif
methodend
method public static void buildErrorFromVector(BBjVector errors!, BBjString message!, BBjString multipleMessage!)
escape
methodend
method public static DataRow removeFields(DataRow row!, BBjVector fields!)
if(row! = null() or row!.isEmpty()) then methodret row!
if(fields! = null() or fields!.isEmpty()) then methodret row!
for i = 0 to fields!.size() -1
row!.removeField(str(fields!.get(i)),err=*next)
next i
methodret row!
methodend
classend