更新 src/ElmBusinessEntry.java
This commit is contained in:
parent
7e6bbd473b
commit
9669d977ea
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Date: 2024-06-18
|
* Date: 2024-12-20
|
||||||
* Design By JRNitre
|
* Design By JRNitre
|
||||||
* */
|
* */
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ public class ElmBusinessEntry {
|
|||||||
Display dis = new Display('+', '-', 30);
|
Display dis = new Display('+', '-', 30);
|
||||||
BusinessView buv = new BusinessView();
|
BusinessView buv = new BusinessView();
|
||||||
|
|
||||||
// Login 方法登录系统
|
// Login 方法登录系统
|
||||||
Business business = new BusinessView().login();
|
Business business = new BusinessView().login();
|
||||||
|
|
||||||
// Business business = new Business();
|
// Business business = new Business();
|
||||||
@ -36,49 +36,49 @@ public class ElmBusinessEntry {
|
|||||||
int key;
|
int key;
|
||||||
while (true){
|
while (true){
|
||||||
dis.titleLine("Business - " + dis.deleteSpaceToString(business.getBusinessName()), true);
|
dis.titleLine("Business - " + dis.deleteSpaceToString(business.getBusinessName()), true);
|
||||||
dis.showItem("[0] 查看商家信息", true);
|
dis.showItem("[0] 查看商家信息", true);
|
||||||
dis.showItem("[1] 修改商家信息", true);
|
dis.showItem("[1] 修改商家信息", true);
|
||||||
dis.showItem("[2] 修改商家密码", true);
|
dis.showItem("[2] 修改商家密码", true);
|
||||||
dis.showItem("[3] 管理食品信息", true);
|
dis.showItem("[3] 管理食品信息", true);
|
||||||
dis.showItem("[" + exitCode + "] 退出系统", true);
|
dis.showItem("[" + exitCode + "] 退出系统", true);
|
||||||
dis.showLine(true);
|
dis.showLine(true);
|
||||||
|
|
||||||
key = dis.getKeyNumber();
|
key = dis.getKeyNumber();
|
||||||
|
|
||||||
switch (key){
|
switch (key){
|
||||||
// 查看商家信息
|
// 查看商家信息
|
||||||
case 0:
|
case 0:
|
||||||
buv.printBusinessInfo(business);
|
buv.printBusinessInfo(business);
|
||||||
break;
|
break;
|
||||||
// 修改商家信息
|
// 修改商家信息
|
||||||
case 1:
|
case 1:
|
||||||
buv.updateBusinessInfo(business);
|
buv.updateBusinessInfo(business);
|
||||||
break;
|
break;
|
||||||
// 修改商家密码
|
// 修改商家密码
|
||||||
case 2:
|
case 2:
|
||||||
buv.updatePassword(business);
|
buv.updatePassword(business);
|
||||||
break;
|
break;
|
||||||
// 管理食品信息
|
// 管理食品信息
|
||||||
case 3:
|
case 3:
|
||||||
food_work(business);
|
food_work(business);
|
||||||
break;
|
break;
|
||||||
case exitCode:
|
case exitCode:
|
||||||
if (dis.MessageYesOrNo("提示", "是否确定退出系统?")) {
|
if (dis.MessageYesOrNo("提示", "是否确定退出系统?")) {
|
||||||
dis.titleLine("提示", true);
|
dis.titleLine("提示", true);
|
||||||
System.out.println("+ 系统退出");
|
System.out.println("+ 系统退出");
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dis.titleLine("ERROR", true);
|
dis.titleLine("ERROR", true);
|
||||||
System.out.println("+ 操作数不合法!");
|
System.out.println("+ 操作数不合法!");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dis.titleLine("ERROR", true);
|
dis.titleLine("ERROR", true);
|
||||||
System.out.println("+ 错误次数过多! 退出系统");
|
System.out.println("+ 错误次数过多! 退出系统");
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -89,40 +89,40 @@ public class ElmBusinessEntry {
|
|||||||
|
|
||||||
int key;
|
int key;
|
||||||
while (true){
|
while (true){
|
||||||
dis.titleLine("商家食品管理", true);
|
dis.titleLine("商家食品管理", true);
|
||||||
dis.showItem("[0] 查看食品列表", true);
|
dis.showItem("[0] 查看食品列表", true);
|
||||||
dis.showItem("[1] 添加食品", true);
|
dis.showItem("[1] 添加食品", true);
|
||||||
dis.showItem("[2] 修改食品信息", true);
|
dis.showItem("[2] 修改食品信息", true);
|
||||||
dis.showItem("[3] 删除食品", true);
|
dis.showItem("[3] 删除食品", true);
|
||||||
dis.showItem("[" + exitCode + "] 返回上级菜单", true);
|
dis.showItem("[" + exitCode + "] 返回上级菜单", true);
|
||||||
|
|
||||||
key = dis.getKeyNumber();
|
key = dis.getKeyNumber();
|
||||||
|
|
||||||
switch ( key ){
|
switch ( key ){
|
||||||
// 查看食品列表
|
// 查看食品列表
|
||||||
case 0:
|
case 0:
|
||||||
buv.printAllBusinessFoodInfo(business);
|
buv.printAllBusinessFoodInfo(business);
|
||||||
break;
|
break;
|
||||||
// 添加食品
|
// 添加食品
|
||||||
case 1:
|
case 1:
|
||||||
buv.addBusinessNewFood(business);
|
buv.addBusinessNewFood(business);
|
||||||
break;
|
break;
|
||||||
// 修改食品信息
|
// 修改食品信息
|
||||||
case 2:
|
case 2:
|
||||||
buv.updateBusinessFoodInfo(business);
|
buv.updateBusinessFoodInfo(business);
|
||||||
break;
|
break;
|
||||||
// 删除食品
|
// 删除食品
|
||||||
case 3:
|
case 3:
|
||||||
buv.deleteFood(business);
|
buv.deleteFood(business);
|
||||||
break;
|
break;
|
||||||
case exitCode:
|
case exitCode:
|
||||||
if (dis.MessageYesOrNo("提示", "确定返回上级菜单?")) {
|
if (dis.MessageYesOrNo("提示", "确定返回上级菜单?")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dis.titleLine("ERROR", true);
|
dis.titleLine("ERROR", true);
|
||||||
System.out.println("+ 操作数不合法!");
|
System.out.println("+ 操作数不合法!");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user