?? finalresult.java
字號:
package com.jbaptech.accp.netbar.client;
import java.sql.*;
//此類用于顯示下機(jī)結(jié)果界面上的信息
public class FinalResult {
String cardId ; //卡號
String computerId ; //機(jī)器號
String beginTime ; //上機(jī)時(shí)間
String endTime ; //下機(jī)時(shí)間
int fee ; //本次消費(fèi)
int balance ; //此卡余額
public FinalResult() {
}
public void select(String ComputerId){
Connection con = ConnectionManager.getConnection();
try{
String sql1 = "select * from Record where ComputerId = '"+ComputerId+"'";
Statement s = con.createStatement();
ResultSet rs = s.executeQuery(sql1);
while(rs.next()){
cardId = rs.getString("cardId");
computerId = rs.getString(3);
beginTime = rs.getString(4);
endTime = rs.getString(5);
fee = rs.getInt(6);
}
CheckOutResultPanel.computerIdLabel.setText(computerId);
CheckOutResultPanel.cardIdLabel.setText(cardId);
CheckOutResultPanel.beginTimeLabel.setText(beginTime);
CheckOutResultPanel.endTimeLabel.setText(endTime);
CheckOutResultPanel.consumerFeeLabel.setText(Integer.toString(fee));
OverUse overuse = new OverUse();
overuse.update(cardId,fee);
String sql2 = "select * from Card where Id ='"+cardId+"'";
Statement s2 = con.createStatement();
ResultSet rs2 = s2.executeQuery(sql2);
while(rs2.next()){
balance = rs2.getInt("balance");
}
CheckOutResultPanel.balanceLabel.setText(Integer.toString(balance));
con.close();
}catch (SQLException ce){
ce.printStackTrace();
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -