guaranteebetimesadjust.java~1~

来自「银行信用评估系统」· JAVA~1~ 代码 · 共 431 行 · 第 1/2 页

JAVA~1~
431
字号
package management;import java.awt.*;import javax.swing.*;import javax.swing.border.*;import java.awt.event.*;import com.borland.jbcl.layout.*;import java.sql.*;import com.borland.dx.dataset.*;import com.borland.dx.sql.dataset.*;import com.borland.dbswing.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2004</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class GuaranteeBetimesAdjust extends JPanel {  JLabel jLabel1 = new JLabel();  JTextField txtinfo1 = new JTextField();  JButton cmdfind = new JButton();  JLabel jLabel2 = new JLabel();  JLabel labshow1 = new JLabel();  TitledBorder titledBorder1;  TitledBorder titledBorder2;  JLabel jLabel3 = new JLabel();  JTextField txtinfo2 = new JTextField();  JButton cmdchange = new JButton();  JLabel jLabel4 = new JLabel();  JLabel labshow3 = new JLabel();  TitledBorder titledBorder3;  TitledBorder titledBorder4;  PreparedStatement pstmt1;  PreparedStatement pstmt11;  PreparedStatement pstmt2;  PreparedStatement pstmt22;  PreparedStatement sqlcheck;  Connection con;  String query1;  String query2;  String query11;  String query22;  ResultSet rs1;  ResultSet rs11;  ResultSet sqlrs;  String str1;  String gradechange;  String money;  JButton cmdcancel = new JButton();  JLabel jLabel5 = new JLabel();  JLabel labshow2 = new JLabel();  TitledBorder titledBorder5;  TitledBorder titledBorder6;  JLabel jLabel6 = new JLabel();  GridBagLayout gridBagLayout1 = new GridBagLayout();  public GuaranteeBetimesAdjust() {    try {      jbInit();    }    catch(Exception ex) {      ex.printStackTrace();    }  }  void jbInit() throws Exception {    titledBorder1 = new TitledBorder("");    titledBorder2 = new TitledBorder("");    titledBorder3 = new TitledBorder("");    titledBorder4 = new TitledBorder("");    titledBorder5 = new TitledBorder("");    titledBorder6 = new TitledBorder("");    jLabel1.setFont(new java.awt.Font("Dialog", 0, 13));    jLabel1.setText("请输入新担保人号:");    this.setLayout(gridBagLayout1);    txtinfo1.setFont(new java.awt.Font("Dialog", 0, 13));    txtinfo1.setText("");    cmdfind.setFont(new java.awt.Font("Dialog", 0, 13));    cmdfind.setText("查询");    cmdfind.addActionListener(new GuaranteeBetimesAdjust_cmdfind_actionAdapter(this));    jLabel2.setFont(new java.awt.Font("Dialog", 0, 13));    jLabel2.setText("新担保人信用等级:");    labshow1.setFont(new java.awt.Font("Dialog", 1, 15));    labshow1.setBorder(titledBorder2);    labshow1.setText("");    jLabel3.setFont(new java.awt.Font("Dialog", 0, 13));    jLabel3.setText("请输入申请人号:");    txtinfo2.setEnabled(true);    txtinfo2.setFont(new java.awt.Font("Dialog", 0, 13));    txtinfo2.setDoubleBuffered(false);    txtinfo2.setEditable(false);    txtinfo2.setText("");    cmdchange.setEnabled(false);    cmdchange.setFont(new java.awt.Font("Dialog", 0, 13));    cmdchange.setText("修改");    cmdchange.addActionListener(new GuaranteeBetimesAdjust_cmdchange_actionAdapter(this));    jLabel4.setFont(new java.awt.Font("Dialog", 0, 13));    jLabel4.setText("申请人修改后信用等级:");    labshow3.setFont(new java.awt.Font("Dialog", 1, 15));    labshow3.setBorder(titledBorder4);    labshow3.setText("");    cmdcancel.setFont(new java.awt.Font("Dialog", 0, 13));    cmdcancel.setText("取消");    cmdcancel.addActionListener(new GuaranteeBetimesAdjust_cmdcancel_actionAdapter(this));    jLabel5.setFont(new java.awt.Font("Dialog", 0, 13));    jLabel5.setText("申请人更改后的可透支额:");    labshow2.setFont(new java.awt.Font("Dialog", 0, 13));    labshow2.setBorder(titledBorder6);    labshow2.setText("");    jLabel6.setFont(new java.awt.Font("Dialog", 1, 20));    jLabel6.setText("保证担保及时调整");    this.add(jLabel1,  new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(16, 40, 0, 0), 8, 9));    this.add(jLabel3,  new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(15, 40, 0, 0), 18, 12));    this.add(jLabel4,  new GridBagConstraints(0, 4, 2, 1, 0.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(19, 40, 0, 7), 10, 11));    this.add(jLabel2,  new GridBagConstraints(0, 2, 2, 1, 0.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(18, 40, 0, 18), 25, 11));    this.add(cmdcancel,  new GridBagConstraints(3, 5, 1, 1, 0.0, 0.0            ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(21, 15, 54, 41), 12, -4));    this.add(cmdchange,  new GridBagConstraints(3, 3, 1, 1, 0.0, 0.0            ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(19, 16, 0, 41), 12, -4));    this.add(cmdfind,  new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0            ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(17, 15, 0, 41), 12, -4));    this.add(txtinfo1,  new GridBagConstraints(1, 1, 2, 1, 1.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(17, 0, 0, 0), 116, 1));    this.add(txtinfo2,  new GridBagConstraints(1, 3, 2, 1, 1.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(16, 6, 0, 0), 110, 3));    this.add(labshow1,  new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(17, 42, 0, 0), 32, 17));    this.add(labshow3,  new GridBagConstraints(2, 4, 1, 1, 0.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(21, 42, 0, 0), 33, 17));    this.add(jLabel5,  new GridBagConstraints(0, 5, 2, 1, 0.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(13, 40, 54, 0), 4, 14));    this.add(labshow2,  new GridBagConstraints(2, 5, 1, 1, 0.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(17, 0, 54, 0), 72, 16));    this.add(jLabel6,  new GridBagConstraints(0, 0, 4, 1, 0.0, 0.0            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(10, 137, 0, 97), 13, 6));    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();  }  void cmdfind_actionPerformed(ActionEvent e) {    try {      String url ="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=CCES";      String username = "sa";      String password = "";      con = DriverManager.getConnection(url, username, password);      //查询新担保人信用等级和资格      query1 ="select CreditcardGrade from Creditcard where UserID=?";      query11 ="select DbrUserID from Users where DbrUserID=?";      pstmt1 = con.prepareStatement(query1);      pstmt11 = con.prepareStatement(query11);      String str1=(txtinfo1.getText()).trim();      pstmt1.setString(1, str1);      pstmt11.setString(1, str1);      rs1 = pstmt1.executeQuery();      rs11 = pstmt11.executeQuery();      if(txtinfo1.getText().length()==0){        txtinfo1.setText("");        txtinfo2.setText("");        labshow1.setText("");        labshow2.setText("");        labshow3.setText("");        cmdchange.setEnabled(false);        txtinfo2.setEditable(false);        JOptionPane.showMessageDialog(this,"请输入担保人号!","确认信息",JOptionPane.YES_OPTION);      }      else {      if(rs1.next()){        if(rs11.next()){            labshow1.setText(rs1.getString("CreditcardGrade"));            cmdchange.setEnabled(false);            txtinfo2.setEditable(false);            txtinfo2.setText("");            labshow2.setText("");            labshow3.setText("");            JOptionPane.showMessageDialog(this, "新担保人已为他人担保,不可再次申请!", "确认信息",                                          JOptionPane.YES_OPTION);          }        else {            labshow1.setText(rs1.getString("CreditcardGrade"));            String grade = rs1.getString("CreditcardGrade");            if (grade.equals("A")) {              gradechange = "B";              money = "40000元";              txtinfo2.setText("");              labshow2.setText("");              labshow3.setText("");              cmdchange.setEnabled(true);              txtinfo2.setEditable(true);              cmdfind.setEnabled(false);              txtinfo1.setEditable(false);//              JOptionPane.showMessageDialog(this,"可以让此用户成为申请人的担保人。","确认信息",JOptionPane.YES_OPTION);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?