📄 busmanageframe.java~258~
字号:
}
rs.close(); //关闭结果集
}
catch (SQLException sqle) {
}
if (!stationcunzai) {
JOptionPane.showMessageDialog(null, "要删除站点不存在!");
}
else {
//可以进行删除
delstation(checinum, stationnum, stationname);
}
}
}
class busmanageFrame_jMenuItem2_actionAdapter
implements java.awt.event.ActionListener {
busmanageFrame adaptee;
busmanageFrame_jMenuItem2_actionAdapter(busmanageFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jMenuItem2_actionPerformed(e);
}
}
class busmanageFrame_jButton6_actionAdapter
implements java.awt.event.ActionListener {
busmanageFrame adaptee;
busmanageFrame_jButton6_actionAdapter(busmanageFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton6_actionPerformed(e);
}
}
class busmanageFrame_jButton1_actionAdapter
implements java.awt.event.ActionListener {
busmanageFrame adaptee;
busmanageFrame_jButton1_actionAdapter(busmanageFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
class busmanageFrame_jButton3_actionAdapter
implements java.awt.event.ActionListener {
busmanageFrame adaptee;
busmanageFrame_jButton3_actionAdapter(busmanageFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton3_actionPerformed(e);
}
}
class busmanageFrame_jButton4_actionAdapter
implements java.awt.event.ActionListener {
busmanageFrame adaptee;
busmanageFrame_jButton4_actionAdapter(busmanageFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton4_actionPerformed(e);
}
}
class busmanageFrame_jButton5_actionAdapter
implements java.awt.event.ActionListener {
busmanageFrame adaptee;
busmanageFrame_jButton5_actionAdapter(busmanageFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton5_actionPerformed(e);
}
}
class busmanageFrame_jButton7_actionAdapter
implements java.awt.event.ActionListener {
busmanageFrame adaptee;
busmanageFrame_jButton7_actionAdapter(busmanageFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton7_actionPerformed(e);
}
}
class busmanageFrame_jButton9_actionAdapter
implements java.awt.event.ActionListener {
busmanageFrame adaptee;
busmanageFrame_jButton9_actionAdapter(busmanageFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton9_actionPerformed(e);
}
}
class busmanageFrame_jButton8_actionAdapter
implements java.awt.event.ActionListener {
busmanageFrame adaptee;
busmanageFrame_jButton8_actionAdapter(busmanageFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton8_actionPerformed(e);
}
}
class busmanageFrame_jButton10_actionAdapter
implements java.awt.event.ActionListener {
busmanageFrame adaptee;
busmanageFrame_jButton10_actionAdapter(busmanageFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton10_actionPerformed(e);
}
}
class busmanageFrame_jButton14_actionAdapter
implements java.awt.event.ActionListener {
busmanageFrame adaptee;
busmanageFrame_jButton14_actionAdapter(busmanageFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton14_actionPerformed(e);
}
}
class busmanageFrame_jButton12_actionAdapter
implements java.awt.event.ActionListener {
busmanageFrame adaptee;
busmanageFrame_jButton12_actionAdapter(busmanageFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton12_actionPerformed(e);
}
}
void jButton17_actionPerformed(ActionEvent e) {
//查询车次
int checinum = Integer.parseInt(jComboBox1.getSelectedItem().toString().
trim());
boolean checicunzai = checicunzai(checinum);
if (checicunzai) {
String startstation = "", starttime = "", endstation = "", endtime = "",
kongtiao = "";
String sql = "select * from businfo where 车次号=" + checinum + "";
try {
ResultSet rs = stmt.executeQuery(sql);
while (rs.next()) {
startstation = rs.getString("始发站").trim();
starttime = rs.getString("营运时间上").trim();
endstation = rs.getString("终点站").trim();
endtime = rs.getString("营运时间下").trim();
kongtiao = rs.getString("是否空调").trim();
}
rs.close();
jTextField6.setText(startstation);
jTextField7.setText(starttime);
jTextField8.setText(endstation);
jTextField9.setText(endtime);
jTextField10.setText(kongtiao);
}
catch (SQLException sqle) {
System.out.println(sqle);
}
}
else {
JOptionPane.showMessageDialog(null, "车次不存在!");
}
}
void jButton16_actionPerformed(ActionEvent e) {
//修改车次属性信息
String line, startstation, starttime, endstation, endtime, kongtiao;
line = jComboBox1.getSelectedItem().toString().trim();
int linenum = Integer.parseInt(line);
startstation = jTextField6.getText().trim();
starttime = jTextField7.getText().trim();
endstation = jTextField8.getText().trim();
endtime = jTextField9.getText().trim();
kongtiao = jTextField10.getText().trim();
String sql = "update businfo set 始发站=" + "'" + startstation + "\'" +
" ,营运时间上=" + "\'" + starttime + "\'" +
", 终点站=" + "\'" + endstation + "\'" + " ,营运时间下=" + "\'" + endtime +
"\'" + ",是否空调=" + "\'" + kongtiao + "\'" +
" where 车次号=" + linenum + "";
System.out.println(sql);
if (checicunzai(linenum)) {
try {
if (!stmt.execute(sql)) {
JOptionPane.showMessageDialog(null, "修改成功!");
}
else {
JOptionPane.showMessageDialog(null, "修改失败!");
}
}
catch (SQLException sqle) {
System.out.println(sqle);
}
}
else {
JOptionPane.showMessageDialog(null, "车次不存在,没有办法修改!");
}
}
void jButton18_actionPerformed(ActionEvent e) {
//删除线路
String line = jComboBox1.getSelectedItem().toString().trim();
int linenum = Integer.parseInt(line);
String sql = "delete from businfo where 车次号=" + linenum + "";
if (checicunzai(linenum)) {
int a = JOptionPane.showConfirmDialog(null, "确实要删除" + linenum + "线路");
if (a == 0) {
//确认删除
try {
if (!stmt.execute(sql)) {
JOptionPane.showMessageDialog(null, "删除成功!");
}
else {
JOptionPane.showMessageDialog(null, "删除失败!");
}
}
catch (SQLException sqle) {
System.out.println(sqle);
}
}
}
else {
JOptionPane.showMessageDialog(null, "车次不存在,不能进行删除操作!");
}
}
void jButton15_actionPerformed(ActionEvent e) {
jTextField3.setText("");
jTextField4.setText("");
}
JPanel jPanel13 = new JPanel();
JPanel jPanel14 = new JPanel();
JTextArea jTextArea5 = new JTextArea();
JTextArea jTextArea6 = new JTextArea();
JLabel jLabel1 = new JLabel();
JLabel jLabel2 = new JLabel();
JLabel jLabel3 = new JLabel();
}
class busmanageFrame_jButton13_actionAdapter
implements java.awt.event.ActionListener {
busmanageFrame adaptee;
busmanageFrame_jButton13_actionAdapter(busmanageFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton13_actionPerformed(e);
}
}
class busmanageFrame_jButton11_actionAdapter
implements java.awt.event.ActionListener {
busmanageFrame adaptee;
busmanageFrame_jButton11_actionAdapter(busmanageFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton11_actionPerformed(e);
}
}
class busmanageFrame_jButton1_actionAdapter
implements java.awt.event.ActionListener {
busmanageFrame adaptee;
busmanageFrame_jButton1_actionAdapter(busmanageFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
class busmanageFrame_jButton17_actionAdapter
implements java.awt.event.ActionListener {
busmanageFrame adaptee;
busmanageFrame_jButton17_actionAdapter(busmanageFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton17_actionPerformed(e);
}
}
class busmanageFrame_jButton16_actionAdapter
implements java.awt.event.ActionListener {
busmanageFrame adaptee;
busmanageFrame_jButton16_actionAdapter(busmanageFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton16_actionPerformed(e);
}
}
class busmanageFrame_jButton2_actionAdapter
implements java.awt.event.ActionListener {
busmanageFrame adaptee;
busmanageFrame_jButton2_actionAdapter(busmanageFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton2_actionPerformed(e);
}
}
class busmanageFrame_jButton18_actionAdapter
implements java.awt.event.ActionListener {
busmanageFrame adaptee;
busmanageFrame_jButton18_actionAdapter(busmanageFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton18_actionPerformed(e);
}
}
class busmanageFrame_jButton15_actionAdapter
implements java.awt.event.ActionListener {
busmanageFrame adaptee;
busmanageFrame_jButton15_actionAdapter(busmanageFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton15_actionPerformed(e);
}
}
class busmanageFrame_jButton12_actionAdapter implements java.awt.event.ActionListener {
busmanageFrame adaptee;
busmanageFrame_jButton12_actionAdapter(busmanageFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton12_actionPerformed(e);
}
}
class busmanageFrame_jButton14_actionAdapter implements java.awt.event.ActionListener {
busmanageFrame adaptee;
busmanageFrame_jButton14_actionAdapter(busmanageFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton14_actionPerformed(e);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -