package code;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JTextField;
import java.awt.GridLayout;
import javax.swing.ButtonGroup;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JButton;
import javax.swing.BorderFactory;
import javax.swing.border.TitledBorder;
import javax.swing.JInternalFrame;
import java.awt.Font;
import java.awt.Color;
import java.awt.Rectangle;
import java.util.Date;
import java.util.Locale;
import java.sql.*;
import java.text.DateFormat;
import javax.sql.rowset.*;
import com.sun.rowset.*;
import javax.swing.ListSelectionModel;
import javax.swing.JOptionPane;
import javax.swing.JRadioButton;
import javax.swing.JComboBox;
import javax.swing.SwingConstants;
public class Cdevmain extends JInternalFrame {
private static final long serialVersionUID = 1L;
private JPanel jContentPane = null;
private JPanel jPanel = null;
private JPanel jPanel1 = null;
private JLabel jLabel1 = null;
private JTextField jTextField1 = null;
private JLabel jLabel2 = null;
private JTextField jTextField2 = null;
private JLabel jLabel3 = null;
private JTextField jTextField3 = null;
private JLabel jLabel4 = null;
private JTextField jTextField4 = null;
private JLabel jLabel5 = null;
private JTextField jTextField5 = null;
private JPanel jPanel2 = null;
private JScrollPane jScrollPane = null;
private JTable jTable = null;
private JPanel jPanel3 = null;
private JButton jButton1_1 = null;
private String localDate = null; // @jve:decl-index=0:
private Date currentDate = null;
private DateFormat localDateTimeFormat = null;
private Statement stat = null; // @jve:decl-index=0:
private JLabel jLabel6 = null;
private JLabel jLabel7 = null;
private JLabel jLabel8 = null;
private JLabel jLabel9 = null;
private JTextField jTextField6 = null;
private JLabel jLabel = null;
private JComboBox jComboBox = null;
private JButton jButton2 = null;
private JLabel jLabel10 = null;
private JLabel jLabel11 = null;
private ButtonGroup group1 = null;
private ButtonGroup group2 = null;
private JRadioButton jRadioButton1 = null;
private JRadioButton jRadioButton2 = null;
private JRadioButton jRadioButton3 = null;
private JRadioButton jRadioButton4 = null;
private boolean scrolling = false;
private JPanel jPanel4 = null;
private JButton jButton1_2 = null;
private JButton jButton1_3 = null;
public Cdevmain() {
super();
initialize();
}
private void initialize() {
this.setSize(744, 576);
this.setClosable(true);
this.setIconifiable(true);
this.setTitle("DMS — 设备维护管理");
try {
DatabaseMetaData meta = Cdms.conn.getMetaData();
if (meta.supportsResultSetType(ResultSet.TYPE_SCROLL_INSENSITIVE)) {
scrolling = true;
stat = Cdms.conn.createStatement(
ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
} else {
stat = Cdms.conn.createStatement();
scrolling = false;
}
} catch (SQLException e) {
e.printStackTrace();
}
this.setContentPane(getJContentPane());
getButtonGroup1();
getButtonGroup2();
if (Cdms.pwr.getPower() == 2) {
if (jRadioButton3 != null) {
jRadioButton3.setEnabled(false);
}
if (jRadioButton4 != null) {
jRadioButton4.setEnabled(false);
}
} else {
if (jRadioButton3 != null) {
jRadioButton3.setEnabled(true);
}
if (jRadioButton4 != null) {
jRadioButton4.setEnabled(true);
}
}
this.setVisible(true);
this
.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter() {
public void internalFrameClosed(
javax.swing.event.InternalFrameEvent e) {
CdmsMdi.devmainV = 0;
}
});
}
private ButtonGroup getButtonGroup1() {
if (group1 == null) {
group1 = new ButtonGroup();
group1.add(jRadioButton1);
group1.add(jRadioButton2);
}
return group1;
}
private ButtonGroup getButtonGroup2() {
if (group2 == null) {
group2 = new ButtonGroup();
group2.add(jRadioButton3);
group2.add(jRadioButton4);
}
return group2;
}
private JPanel getJContentPane() {
if (jContentPane == null) {
GridLayout gridLayout1 = new GridLayout();
gridLayout1.setRows(1);
jContentPane = new JPanel();
jContentPane.setLayout(gridLayout1);
jContentPane.add(getJPanel(), null);
}
return jContentPane;
}
private JPanel getJPanel() {
if (jPanel == null) {
jPanel = new JPanel();
jPanel.setLayout(null);
jPanel.add(getJPanel2(), null);
jPanel.add(getJPanel3(), null);
jPanel.add(getJPanel1(), null);
jPanel.add(getJButton2(), null);
}
return jPanel;
}
private JPanel getJPanel1() {
if (jPanel1 == null) {
jLabel11 = new JLabel();
jLabel11.setBounds(new Rectangle(14, 225, 112, 27));
jLabel11.setText("审批意见");
jLabel9 = new JLabel();
jLabel9.setBounds(new Rectangle(336, 102, 141, 27));
jLabel9.setHorizontalAlignment(SwingConstants.CENTER);
jLabel9.setText("");
jLabel8 = new JLabel();
jLabel8.setBounds(new Rectangle(266, 102, 112, 27));
jLabel8.setText("当前状态");
jLabel7 = new JLabel();
jLabel7.setBounds(new Rectangle(13, 102, 112, 27));
jLabel7.setForeground(Color.red);
jLabel7.setText("维护方式");
jLabel6 = new JLabel();
jLabel6.setBounds(new Rectangle(13, 180, 112, 27));
jLabel6.setText("维护结果");
jLabel5 = new JLabel();
jLabel5.setBounds(new Rectangle(13, 141, 112, 27));
jLabel5.setForeground(Color.red);
jLabel5.setText("维护原因");
jLabel4 = new JLabel();
jLabel4.setBounds(new Rectangle(13, 63, 112, 27));
jLabel4.setText("维护人");
jLabel4.setForeground(Color.red);
jLabel3 = new JLabel();
jLabel3.setBounds(new Rectangle(265, 63, 112, 27));
jLabel3.setText("维护时间");
jLabel2 = new JLabel();
jLabel2.setBounds(new Rectangle(265, 24, 112, 27));
jLabel2.setText("\u8bbe\u5907\u540d\u79f0");
jLabel1 = new JLabel();
jPanel1 = new JPanel();
jLabel1.setBounds(new Rectangle(13, 24, 112, 27));
jLabel1.setText("\u8bbe\u5907\u7f16\u53f7");
jPanel1.setLayout(null);
jPanel1.setBorder(BorderFactory.createTitledBorder(null,
"\u8bbe\u5907\u7ef4\u62a4\u7ba1\u7406",
TitledBorder.DEFAULT_JUSTIFICATION,
TitledBorder.DEFAULT_POSITION, new Font("Dialog",
Font.BOLD, 12), new Color(51, 51, 51)));
jPanel1.setBounds(new Rectangle(27, 234, 537, 292));
jPanel1.add(jLabel1, null);
jPanel1.add(getJTextField1(), null);
jPanel1.add(jLabel2, null);
jPanel1.add(getJTextField2(), null);
jPanel1.add(jLabel3, null);
jPanel1.add(getJTextField3(), null);
jPanel1.add(jLabel4, null);
jPanel1.add(getJTextField4(), null);
jPanel1.add(jLabel5, null);
jPanel1.add(getJTextField5(), null);
jPanel1.add(jLabel6, null);
jPanel1.add(jLabel7, null);
jPanel1.add(jLabel8, null);
jPanel1.add(getJRadioButton1(), null);
jPanel1.add(getJRadioButton2(), null);
jPanel1.add(jLabel9, null);
jPanel1.add(getJTextField6(), null);
jPanel1.add(jLabel11, null);
jPanel1.add(getJRadioButton3(), null);
jPanel1.add(getJRadioButton4(), null);
}
return jPanel1;
}
private JTextField getJTextField1() {
if (jTextField1 == null) {
jTextField1 = new JTextField();
jTextField1.setEditable(false);
jTextField1.setBounds(new Rectangle(74, 24, 142, 27));
}
return jTextField1;
}
private JTextField getJTextField2() {
if (jTextField2 == null) {
jTextField2 = new JTextField();
jTextField2.setEditable(false);
jTextField2.setBounds(new Rectangle(335, 24, 142, 27));
}
return jTextField2;
}
private JTextField getJTextField3() {
if (jTextField3 == null) {
jTextField3 = new JTextField();
jTextField3.setBound