improve item count handling
This commit is contained in:
parent
a85786554c
commit
10558cc9b4
1 changed files with 8 additions and 2 deletions
|
@ -220,7 +220,7 @@ public class OnTransact extends javax.swing.JFrame {
|
||||||
private void transaction_check(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_transaction_check
|
private void transaction_check(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_transaction_check
|
||||||
boolean CLOSING_STATE = false;
|
boolean CLOSING_STATE = false;
|
||||||
|
|
||||||
if (transaction.items_count > 0) {
|
if (transaction.items_count <= 0) {
|
||||||
CLOSING_STATE = true;
|
CLOSING_STATE = true;
|
||||||
} else {
|
} else {
|
||||||
CLOSING_STATE = confirm_discard();
|
CLOSING_STATE = confirm_discard();
|
||||||
|
@ -271,7 +271,13 @@ public class OnTransact extends javax.swing.JFrame {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean confirm_discard() {
|
private static boolean confirm_discard() {
|
||||||
Boolean USER_CHOICE = WindowManagement.confirm("Discrding Items", "There are currently items in the cart. Would you want to discard this?", true);
|
/* Confirm discarding items.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
(boolean) the user's selection
|
||||||
|
*/
|
||||||
|
|
||||||
|
Boolean USER_CHOICE = WindowManagement.confirm("Discarding Items", "There are currently items in the cart. Would you want to discard this?", true);
|
||||||
return (USER_CHOICE);
|
return (USER_CHOICE);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue