...
SCREEN SECTION.
...
05 Push-Button
col 32 line 4.5
lines 1 size 8
css-base-style-name "btn btn-success"
css-style-name "btn-sm"
css-icon "fa-save"
self-act
exception-value 9
title "Save"
.
05 Push-Button
col 41 line 4.5
lines 1 size 8
css-base-style-name "btn btn-danger"
css-style-name "btn-sm"
css-icon "fa-trash"
self-act
exception-value 3
title "Delete"
.
05 Push-Button
col 50 line 4.5
lines 1 size 8
css-base-style-name "btn btn-info"
css-style-name "btn-sm"
css-icon "fa-angle-double-left"
self-act
exception-value 5
title "First"
.
05 Push-Button
col 59 line 4.5
lines 1 size 8
css-base-style-name "btn btn-info"
css-style-name "btn-sm"
css-icon "fa-angle-left"
self-act
exception-value 6
title "Previous"
.
05 Push-Button
col 68 line 4.5
lines 1 size 8
css-base-style-name "btn btn-info"
css-style-name "btn-sm"
css-icon "fa-angle-right"
self-act
exception-value 7
title "Next"
.
05 Push-Button
col 77 line 4.5
lines 1 size 8
css-base-style-name "btn btn-info"
css-style-name "btn-sm"
css-icon "fa-angle-double-right"
exception-value 8
title "Last"
.
05 label,
col 32
line 7
title "Customer Code"
size 13 cells
.
05 label
col 32
line 9
title "First Name"
size 10 cells
.
05 label
col 32
line 11
title "Last Name"
size 9 cells
.
05 label
col 32
line 13
title "Street"
size 6 cells
.
05 Label
col 32
line 15
title "City"
size 4 cells
.
05 Label
col 32
line 17
title "State"
size 5 cells
.
05 label
col 32
line 19
title "Zip Code"
size 8 cells
.
05 label,
col 32
line 21
title "PhoneNum"
size 8 cells
.
05 label
col 32
line 23
title "CellphoneNum"
size 12 cells
.
05 entry-field
col 54
line 7
size 7
value cust-code
id 601
.
05 entry-field,
col 54
line 9
size 20
value cust-first-name
.
05 entry-field
col 54
line 11
size 20
value cust-second-name
.
05 entry-field
col 54
line 13
size 20
value cust-street
.
05 entry-field
col 54
line 15
size 20
value cust-city
.
05 entry-field
col 54
line 17
value cust-state
size 20 cells
.
05 entry-field
col 54
line 19
value cust-zip
size 7 cells
.
05 entry-field
col 54
line 21
size 18
value cust-phone
size 15 cells
.
05 entry-field
col 54
line 23
size 18
value cust-cellphone
size 15 cells
.
...
PROCEDURE DIVISION.
...
CALL "PCustomer" using 78-OPEN-I-O
...
perform until key-status = 27
move 4 to accept-control
accept mask-menu on exception continue end-accept
evaluate key-status
WHEN 3 if vis(Simple-file-handler-page) = 1
PERFORM REC-DELETE
end-if
WHEN 5 if vis(Simple-file-handler-page) = 1
PERFORM REC-FIRST
end-if
WHEN 6 if vis(Simple-file-handler-page) = 1
PERFORM REC-PREV
end-if
WHEN 7 if vis(Simple-file-handler-page) = 1
PERFORM REC-NEXT
end-if
WHEN 8 if vis(Simple-file-handler-page) = 1
PERFORM REC-LAST
end-if
WHEN 9 if vis(Simple-file-handler-page) = 1
PERFORM REC-SAVE
end-if
end-evaluate
end-perform.
CALL "PCustomer" using 78-CLOSE
...
REC-FIRST.
MOVE LOW-VALUE TO W-KEY(1:)
CALL "PCustomer" using 78-START-GREAT, W-KEY
CALL "PCustomer" using 78-READ-NEXT, Customer-Rec
IF RETURN-CODE > 9
PERFORM SHOW-ERROR
ELSE
DISPLAY page10
END-IF.
REC-PREV.
CALL "PCustomer" using 78-READ-PREV, Customer-Rec
IF RETURN-CODE > 9
PERFORM SHOW-ERROR
ELSE
DISPLAY page10
END-IF.
REC-NEXT.
CALL "PCustomer" using 78-READ-NEXT, Customer-Rec
IF RETURN-CODE > 9
PERFORM SHOW-ERROR
ELSE
DISPLAY page10
END-IF.
REC-LAST.
MOVE HIGH-VALUE TO W-KEY
CALL "PCustomer" using 78-START-LESS, W-KEY
CALL "PCustomer" using 78-READ-NEXT, Customer-Rec
IF RETURN-CODE > 9
PERFORM SHOW-ERROR
ELSE
DISPLAY page10
END-IF.
REC-DELETE.
DISPLAY MESSAGE
"ARE YOU SURE YOU WANT TO DELETE THIS RECORD?"
TYPE MB-YES-NO GIVING RESP
IF RESP = 1
CALL "PCustomer" using 78-DELETE, Cust-code
IF RETURN-CODE > 9
PERFORM SHOW-ERROR
ELSE
INITIALIZE Customer-Rec
DISPLAY page10
END-IF
END-IF.
REC-SAVE.
CALL "PCustomer" using 78-WRITE, Customer-Rec.
IF RETURN-CODE = 22
CALL "PCustomer" using 78-REWRITE, Customer-Rec
IF RETURN-CODE > 9
PERFORM SHOW-ERROR
END-IF
END-IF.