⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 edit_reckoning.java

📁 在个一个诊所系统,实现数据的查询和删除等的操作.
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
package clinique;

import java.awt.*;

import javax.swing.*;
import java.awt.Rectangle;
import com.borland.dx.sql.dataset.Database;
import com.borland.dx.sql.dataset.QueryDataSet;
import com.borland.dbswing.JdbTable;
import com.borland.dx.sql.dataset.ConnectionDescriptor;
import com.borland.dx.sql.dataset.Load;
import com.borland.dx.sql.dataset.QueryDescriptor;
import javax.swing.BorderFactory;
import java.awt.Font;
import com.borland.dx.dataset.Column;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseAdapter;
import java.sql.DriverManager;
import java.sql.Statement;
import java.sql.Connection;
import java.sql.SQLException;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2007</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class edit_reckoning extends JPanel {
    String id;
    int x=-1;
    public edit_reckoning() {
        try {
            jbInit();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }

    private void jbInit() throws Exception {
        this.setLayout(null);
        jScrollPane1.setBorder(BorderFactory.createEtchedBorder());
        jScrollPane1.setBounds(new Rectangle(9, 10, 662, 231));
        database1.setConnection(new ConnectionDescriptor(
                "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=clinique",
                "sa", "", false, "com.microsoft.jdbc.sqlserver.SQLServerDriver"));
        queryDataSet1.setQuery(new QueryDescriptor(database1,
                "select * from reckoning", null, true, Load.ALL));
        jdbTable1.setDataSet(queryDataSet1);
        jdbTable1.setEditable(false);
        jdbTable1.addMouseListener(new edit_reckoning_jdbTable1_mouseAdapter(this));
        edit_r.setBounds(new Rectangle(431, 13, 90, 23));
        edit_r.setText("提交修改");
        edit_r.addActionListener(new edit_reckoning_edit_r_actionAdapter(this));
        exit.setBounds(new Rectangle(551, 13, 68, 23));
        exit.setText("取消");
        exit.addActionListener(new edit_reckoning_exit_actionAdapter(this));
        look.setBounds(new Rectangle(233, 13, 67, 23));
        look.setText("查询");
        look.addActionListener(new edit_reckoning_look_actionAdapter(this));
        lookname.setBounds(new Rectangle(122, 15, 77, 20));
        jLabel1.setText("姓名查找:");
        jLabel1.setBounds(new Rectangle(49, 16, 73, 15));
        jPanel1.setBorder(BorderFactory.createEtchedBorder());
        jPanel1.setBounds(new Rectangle(9, 352, 662, 47));
        jPanel1.setLayout(null);
        jPanel2.setBorder(BorderFactory.createEtchedBorder());
        jPanel2.setBounds(new Rectangle(57, 44, 680, 405));
        jPanel2.setLayout(null);
        jLabel2.setFont(new java.awt.Font("宋体", Font.BOLD, 15));
        jLabel2.setText("帐单信息修改");
        jLabel2.setBounds(new Rectangle(28, 15, 99, 25));
        column1.setColumnName("id");
        column1.setDataType(com.borland.dx.dataset.Variant.INT);
        column1.setRowId(true);
        column1.setTableName("reckoning");
        column1.setWidth(9);
        column1.setServerColumnName("id");
        column1.setSqlType(4);
        column2.setColumnName("patientname");
        column2.setDataType(com.borland.dx.dataset.Variant.STRING);
        column2.setPrecision(50);
        column2.setTableName("reckoning");
        column2.setWidth(10);
        column2.setServerColumnName("patientname");
        column2.setSqlType(1);
        column3.setColumnName("medicine");
        column3.setDataType(com.borland.dx.dataset.Variant.STRING);
        column3.setPrecision(100);
        column3.setTableName("reckoning");
        column3.setWidth(10);
        column3.setServerColumnName("medicine");
        column3.setSqlType(1);
        column4.setColumnName("price");
        column4.setDataType(com.borland.dx.dataset.Variant.BIGDECIMAL);
        column4.setPrecision(19);
        column4.setScale(4);
        column4.setTableName("reckoning");
        column4.setWidth(10);
        column4.setServerColumnName("price");
        column4.setSqlType(3);
        column5.setColumnName("number");
        column5.setDataType(com.borland.dx.dataset.Variant.INT);
        column5.setTableName("reckoning");
        column5.setWidth(9);
        column5.setServerColumnName("number");
        column5.setSqlType(4);
        column6.setColumnName("doctor");
        column6.setDataType(com.borland.dx.dataset.Variant.STRING);
        column6.setPrecision(50);
        column6.setTableName("reckoning");
        column6.setWidth(10);
        column6.setServerColumnName("doctor");
        column6.setSqlType(1);
        jPanel3.setBorder(BorderFactory.createEtchedBorder());
        jPanel3.setBounds(new Rectangle(9, 251, 415, 98));
        jPanel3.setLayout(null);
        jLabel3.setText("病人姓名:");
        jLabel3.setBounds(new Rectangle(41, 23, 68, 15));
        jLabel4.setText("主治医生:");
        jLabel4.setBounds(new Rectangle(37, 27, 72, 15));
        jLabel5.setText("所用药品:");
        jLabel5.setBounds(new Rectangle(226, 23, 71, 15));
        jLabel6.setText("帐单日期:");
        jLabel6.setBounds(new Rectangle(37, 62, 68, 15));
        jLabel7.setText("药瓶单价:");
        jLabel7.setBounds(new Rectangle(42, 61, 68, 15));
        jPanel4.setBorder(BorderFactory.createEtchedBorder());
        jPanel4.setBounds(new Rectangle(431, 251, 240, 98));
        jPanel4.setLayout(null);
        pname.setBounds(new Rectangle(116, 22, 76, 20));
        pprice.setBounds(new Rectangle(116, 58, 60, 20));
        pmedicine.setBounds(new Rectangle(304, 22, 72, 20));
        doctor.setBounds(new Rectangle(123, 22, 75, 20));
        day.setBounds(new Rectangle(123, 58, 75, 20));
        jLabel8.setText("药品数量:");
        jLabel8.setBounds(new Rectangle(226, 61, 69, 15));
        pnumber.setBounds(new Rectangle(304, 58, 72, 20));
        column7.setColumnName("date");
        column7.setDataType(com.borland.dx.dataset.Variant.DATE);
        column7.setTableName("reckoning");
        column7.setServerColumnName("DATE");
        column7.setSqlType(93);
        jLabel9.setText("元");
        jLabel9.setBounds(new Rectangle(180, 61, 20, 15));
        show.setBounds(new Rectangle(321, 13, 87, 23));
        show.setText("显示全部");
        show.addActionListener(new edit_reckoning_show_actionAdapter(this));
        jPanel1.add(exit);
        jPanel1.add(edit_r);
        jPanel1.add(jLabel1);
        jPanel1.add(lookname);
        jPanel1.add(look);
        jPanel1.add(show);
        jPanel2.add(jScrollPane1);
        jScrollPane1.getViewport().add(jdbTable1);
        jPanel3.add(jLabel7);
        jPanel3.add(jLabel3);
        jPanel3.add(pname);
        jPanel3.add(pprice);
        jPanel3.add(jLabel8);
        jPanel3.add(jLabel5);
        jPanel3.add(pmedicine);
        jPanel3.add(pnumber);
        jPanel3.add(jLabel9);
        jPanel2.add(jPanel4);
        jPanel4.add(jLabel6);
        jPanel4.add(jLabel4);
        jPanel4.add(doctor);
        jPanel4.add(day);
        jPanel2.add(jPanel1);
        jPanel2.add(jPanel3);
        this.add(jLabel2);
        this.add(jPanel2);
        queryDataSet1.setColumns(new Column[] {column1, column2, column3,
                                 column4, column5, column6, column7});
    }

    JScrollPane jScrollPane1 = new JScrollPane();
    Database database1 = new Database();
    QueryDataSet queryDataSet1 = new QueryDataSet();
    JdbTable jdbTable1 = new JdbTable();
    JButton edit_r = new JButton();
    JButton exit = new JButton();
    JButton look = new JButton();
    JTextField lookname = new JTextField();
    JLabel jLabel1 = new JLabel();
    JPanel jPanel1 = new JPanel();
    JPanel jPanel2 = new JPanel();
    JLabel jLabel2 = new JLabel();
    Column column1 = new Column();
    Column column2 = new Column();
    Column column3 = new Column();
    Column column4 = new Column();
    Column column5 = new Column();
    Column column6 = new Column();
    JPanel jPanel3 = new JPanel();
    JLabel jLabel3 = new JLabel();
    JLabel jLabel4 = new JLabel();
    JLabel jLabel5 = new JLabel();
    JLabel jLabel6 = new JLabel();
    JLabel jLabel7 = new JLabel();
    JPanel jPanel4 = new JPanel();
    JTextField pname = new JTextField();
    JTextField pprice = new JTextField();
    JTextField pmedicine = new JTextField();
    JTextField doctor = new JTextField();
    JTextField day = new JTextField();
    JLabel jLabel8 = new JLabel();
    JTextField pnumber = new JTextField();
    Column column7 = new Column();

⌨️ 快捷键说明

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