Update
This commit is contained in:
1 parent
ba46ad52f6
commit
e534efa80e
6 files changed
+7
-10
No files matched your search
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -34,9 +34,8 @@ public class PermissionJudgment {
|
|||||||
role = rs.getString("juese");
|
role = rs.getString("juese");
|
||||||
System.out.println("当前收银员:" + rs.getString("xingming"));
|
System.out.println("当前收银员:" + rs.getString("xingming"));
|
||||||
loginSuccess = true;
|
loginSuccess = true;
|
||||||
} else {
|
} else
|
||||||
System.out.println("用户名或密码不正确,请重新输入");
|
System.out.println("用户名或密码不正确,请重新输入");
|
||||||
}
|
|
||||||
if (loginSuccess) {
|
if (loginSuccess) {
|
||||||
int choice;
|
int choice;
|
||||||
do {
|
do {
|
||||||
@@ -58,11 +57,10 @@ public class PermissionJudgment {
|
|||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
case 5:
|
case 5:
|
||||||
if ("管理员".equals(role)) {
|
if ("管理员".equals(role))
|
||||||
System.out.println("你可以执行该操作");
|
System.out.println("你可以执行该操作");
|
||||||
} else {
|
else
|
||||||
System.out.println("很抱歉,你没有权限执行该操作");
|
System.out.println("很抱歉,你没有权限执行该操作");
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
System.out.println("无效的选择,请重新选择(1-6)");
|
System.out.println("无效的选择,请重新选择(1-6)");
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ public class ProductAdditionAndInquiry {
|
|||||||
Connection conn = DriverManager.getConnection(DBURL);
|
Connection conn = DriverManager.getConnection(DBURL);
|
||||||
Scanner scanner = new Scanner(System.in);
|
Scanner scanner = new Scanner(System.in);
|
||||||
int choice;
|
int choice;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
System.out.println("===超市商品管理维护====");
|
System.out.println("===超市商品管理维护====");
|
||||||
System.out.println("1、输入商品");
|
System.out.println("1、输入商品");
|
||||||
|
|||||||
@@ -31,9 +31,9 @@ public class ProductModificationAndDeletion {
|
|||||||
pstmt = conn.prepareStatement("SELECT * FROM t_shangping WHERE tiaoma = ?");
|
pstmt = conn.prepareStatement("SELECT * FROM t_shangping WHERE tiaoma = ?");
|
||||||
pstmt.setString(1, codeToDelete);
|
pstmt.setString(1, codeToDelete);
|
||||||
rs = pstmt.executeQuery();
|
rs = pstmt.executeQuery();
|
||||||
if (!rs.next()) {
|
if (!rs.next())
|
||||||
System.out.println("你输入的编码不存在,请重新输入");
|
System.out.println("你输入的编码不存在,请重新输入");
|
||||||
} else {
|
else {
|
||||||
pstmt = conn.prepareStatement("DELETE FROM t_shangping WHERE tiaoma = ?");
|
pstmt = conn.prepareStatement("DELETE FROM t_shangping WHERE tiaoma = ?");
|
||||||
pstmt.setString(1, codeToDelete);
|
pstmt.setString(1, codeToDelete);
|
||||||
pstmt.executeUpdate();
|
pstmt.executeUpdate();
|
||||||
@@ -46,9 +46,9 @@ public class ProductModificationAndDeletion {
|
|||||||
pstmt = conn.prepareStatement("SELECT * FROM t_shangping WHERE tiaoma = ?");
|
pstmt = conn.prepareStatement("SELECT * FROM t_shangping WHERE tiaoma = ?");
|
||||||
pstmt.setString(1, codeToModify);
|
pstmt.setString(1, codeToModify);
|
||||||
rs = pstmt.executeQuery();
|
rs = pstmt.executeQuery();
|
||||||
if (!rs.next()) {
|
if (!rs.next())
|
||||||
System.out.println("你输入的编码不存在,请重新输入");
|
System.out.println("你输入的编码不存在,请重新输入");
|
||||||
} else {
|
else {
|
||||||
System.out.print("商品名称(" + rs.getString("mingcheng") + "):");
|
System.out.print("商品名称(" + rs.getString("mingcheng") + "):");
|
||||||
String name = sc.nextLine();
|
String name = sc.nextLine();
|
||||||
sc.nextLine();
|
sc.nextLine();
|
||||||
|
|||||||
Reference in new issue
Block a user