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

📄 dailypperationsystembookschaxunpanel1.java

📁 图书管理系统源代码,05年某人写的,还算不错
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
        jPanel2.setBorder(null);
        jPanel2.setBounds(new Rectangle(5, 4, 120, 154));
        jPanel2.setLayout(null);
        jPanel3.setBorder(BorderFactory.createEtchedBorder());
        jPanel3.setBounds(new Rectangle(128, 6, 447, 150));
        jPanel3.addComponentListener(new
                DailyPperationSystemBooksChaXunPanel1_jPanel3_componentAdapter(this));
        jPanel3.setLayout(null);
        jScrollPane1.setBounds(new Rectangle(15, 41, 438, 100));
        jButtonB.setBounds(new Rectangle(3, 145, 116, 22));
        jButtonB.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        jButtonB.setForeground(Color.blue);
        jButtonB.setMargin(new Insets(2, 2, 2, 2));
        jButtonB.setText("再过二天的情况");
        jButtonB.addActionListener(new
                DailyPperationSystemBooksChaXunPanel1_jButtonB_actionAdapter(this));
        jButtonC.setBounds(new Rectangle(3, 197, 116, 22));
        jButtonC.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        jButtonC.setForeground(Color.blue);
        jButtonC.setMargin(new Insets(2, 2, 2, 2));
        jButtonC.setText("再过三天的情况");
        jButtonC.addActionListener(new
                DailyPperationSystemBooksChaXunPanel1_jButtonC_actionAdapter(this));
        jButtonA.setBounds(new Rectangle(5, 92, 116, 22));
        jButtonA.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        jButtonA.setForeground(Color.blue);
        jButtonA.setMargin(new Insets(2, 2, 2, 2));
        jButtonA.setText("再过一天的情况");
        jButtonA.addActionListener(new
                DailyPperationSystemBooksChaXunPanel1_jButtonA_actionAdapter(this));
        jLabel4.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        jLabel4.setForeground(Color.blue);
        jLabel4.setToolTipText("");
        jLabel4.setText("相关查询");
        jLabel4.setBounds(new Rectangle(21, 7, 68, 27));
        jButtonD.setBounds(new Rectangle(5, 42, 116, 22));
        jButtonD.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        jButtonD.setForeground(Color.magenta);
        jButtonD.setMargin(new Insets(2, 2, 2, 2));
        jButtonD.setText("当天的情况");
        jButtonD.addActionListener(new
                DailyPperationSystemBooksChaXunPanel1_jButtonD_actionAdapter(this));
        jScleft.addComponentListener(new
                DailyPperationSystemBooksChaXunPanel1_jScleft_componentAdapter(this));
        jtxBooksNum.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
        jtxBooksNum.setForeground(Color.red);
        jtxBooksNum.setText("");
        jtxBooksNum.setBounds(new Rectangle(75, 333, 154, 22));
        jLabel5.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
        jLabel5.setForeground(Color.red);
        jLabel5.setText("逾期书编号");
        jLabel5.setBounds(new Rectangle(2, 336, 76, 16));
        this.add(jPanelSystemTop);
        jPanelSystemTop.add(jBtyqts);
        this.add(jSpSystemPanel);
        jSpSystemPanel.add(jScleft, JSplitPane.LEFT);
        jScleft.getViewport().add(jPanRight);
        jSpSystemPanel.add(jScright, JSplitPane.RIGHT);
        jScright.getViewport().add(jPanel1);
        jPanel1.add(jLabel11);
        jPanel1.add(jLabel33);
        jPanel1.add(jLabel6);
        jPanel1.add(jLabel14);
        jPanel1.add(jLabel27);
        jPanel1.add(jLabel13);
        jPanel1.add(jLabel12);
        jPanel1.add(jLabel3);
        jPanel1.add(jLabel28);
        jPanel1.add(jLabel10);
        jPanel1.add(jLabel2);
        jPanel1.add(jLabel5);
        jPanel1.add(jtxbookTypeX);
        jPanel1.add(jTxbookConcernX);
        jPanel1.add(jTxpurchaseMoneyX);
        jPanel1.add(jTxNumberX);
        jPanel1.add(jtxbooksNamex);
        jPanel1.add(jtxbooksNumX);
        jPanel1.add(jTextField2);
        jPanel1.add(jTxReaderNumX);
        jPanel1.add(jTxbookAuthorX);
        jPanel1.add(jTextField1);
        jPanel1.add(jtxBooksNum);
        jPanel1.add(jButton5);
        jPanel1.add(jButton6);
        jPanRight.add(jPanelRightTop);
        jPanelRightTop.add(jPanel2);
        jPanel2.add(jLabel4);
        jPanel2.add(jButtonA);
        jPanel2.add(jButtonC);
        jPanel2.add(jButtonB);
        jPanel2.add(jButtonD);
        jPanelRightTop.add(jPanel3);
        jPanel3.add(jLabelTop);
        jPanel3.add(jScrollPane1);
        jScrollPane1.getViewport().add(jTabBooks);
        jPanRight.add(jPaneRightBottom);
        jPaneRightBottom.add(jTpRightBottom);
        jPaneRightBottom.add(jLabel1);
        jTpRightBottom.add(jScrollPaneBottom);
        jScrollPaneBottom.getViewport().add(jTableReader);
    }


    public void yuqiserchar(int a)
    {
        ResultSet re =null;
        Object[][] data;
        String sql="";
        String sql2 = "";
        //到当前的时间 逾期图书查询语句
        if(a==0){
            sql = "select bookId,snum= count(bookid) from booksBoorowInfo where datediff(dd,beginTime,getdate()) >30 and isreturnbook = '否'  group by bookid";
            sql2 = "select DISTINCT booksnum, booksName,bookConcern,purchaseMoney,booksLairage,borrowMoneynum from booksInfo inner join booksBoorowInfo on booksnum = bookid and datediff(dd,beginTime,getdate())>30 and isreturnbook='否' order by booksnum";
        }
            //到指定的时间的逾期查询语句
        else{
            sql =  "select bookId,snum= count(bookid) from booksBoorowInfo where datediff(dd,beginTime,dateadd(dd,"+a+",getdate())) >30 and isreturnbook = '否'  group by bookid";

            sql2 = "select DISTINCT booksnum, booksName,bookConcern,purchaseMoney,booksLairage,borrowMoneynum from booksInfo inner join booksBoorowInfo on booksnum = bookid and datediff(dd,beginTime,dateadd(dd,"+a+",getdate()))>30 and isreturnbook='否' order by booksnum";


        }
        String str="0";
        re = db.search(sql);
        int size=0;
        try {
            while (re.next()) {
                size++;
            }
            data = new Object[size][title.length];
            boolean temp = re.first();
            for(int i=0;temp;i++)
            {
                for (int j=0;j<2;j++)
                {
                    data[i][j] = re.getString(j+1).trim();

                }

                str = str+","+(String)data[i][0];
                temp = re.next();
            }
            db.myClose(1);
            re = db.search(sql2);
            temp = re.next();
            for(int i=0;temp;i++)
            {
                for (int j=2;j<title.length;j++)
                {
                    data[i][j] = re.getString(j).trim();
                }
                temp = re.next();
            }
            DefaultTableModel model = new DefaultTableModel(data,title);
            jTabBooks.setModel(model);
            jTabBooks.updateUI();


        } catch (SQLException ex) {
            System.out.println(ex.toString());
        }
        db.myClose(1);
    }



    public void jScright_ancestorResized(HierarchyEvent e) {
        jPanRight.setSize((jScright.getWidth() - 1), (jScright.getHeight() - 1));
    }


    public void jScright_componentResized(ComponentEvent e) {
        jPanRight.setSize((jSpSystemPanel.getWidth() - jScleft.getWidth()),
                          (jSpSystemPanel.getHeight() - 1));
    }

    public void jPaneRightBottom_componentResized(ComponentEvent e) {
        jLabel1.setBounds((jPaneRightBottom.getWidth() - 140) / 2, 1, 140, 24);
        jTpRightBottom.setSize(jPaneRightBottom.getWidth() - 1,
                               jPaneRightBottom.getHeight() - 26);

    }

    public void jSpSystemPanel_componentResized(ComponentEvent e) {
        jPanRight.setSize((jSpSystemPanel.getWidth() - jScleft.getWidth()),
                          (jSpSystemPanel.getHeight() - 1));

    }




    public void btnReset_actionPerformed(ActionEvent e) {
    }


    public void jPanRight_componentResized(ComponentEvent e) {
        jPanelRightTop.setBounds(1,1,(jPanRight.getWidth() - 1),(jPanRight.getHeight()) / 2 - 3);

        // jSpSystemPanel.setDividerLocation(0.21);
        jPaneRightBottom.setBounds(jPanRight.getX(),
                                   jPanRight.getHeight() / 2 - 1,
                                   (jPanRight.getWidth() - 1),
                                   (jPanRight.getHeight()) / 2 - 1);
    }

    public void this_componentResized(ComponentEvent e) {

        jSpSystemPanel.setSize((this.getWidth()) - 5, (this.getHeight() - 30));
        jSpSystemPanel.setDividerLocation(0.73);
        jPanRight.setSize((jSpSystemPanel.getWidth() - jScleft.getWidth()),
                          (jSpSystemPanel.getHeight() - 1));
    }

    public void this_ancestorResized(HierarchyEvent e) {
        jSpSystemPanel.setSize((this.getWidth()) - 5, (this.getHeight() - 30));
        jSpSystemPanel.setDividerLocation(0.73);
        jPanRight.setSize((jSpSystemPanel.getWidth() - jScleft.getWidth()),
                          (jSpSystemPanel.getHeight() - 1));
        jPanelSystemTop.setSize(this.getWidth() - 5, 30);
    }

    public void jTpRightBottom_componentResized(ComponentEvent e) {
        jScrollPaneBottom.setBounds(1,1,jTpRightBottom.getWidth() - 1,jTpRightBottom.getHeight() - 1);
        jTableReader.setBounds(0,0,jScrollPaneBottom.getWidth() - 5,
                             jScrollPaneBottom.getHeight() - 5);
    }

    public void jPanelRightTop_componentResized(ComponentEvent e) {
        jPanel2.setBounds(1,1,120,jPanelRightTop.getHeight()-2);
        jPanel3.setBounds( 130, 1, jPanelRightTop.getWidth()-131, jPanelRightTop.getHeight()-2);
    }

    public void jPanRight_ancestorResized(HierarchyEvent e) {
        jPanelRightTop.setBounds(1,1,(jPanRight.getWidth() - 1),(jPanRight.getHeight()) / 2 - 3);

       // jSpSystemPanel.setDividerLocation(0.21);
       jPaneRightBottom.setBounds(jPanRight.getX(),
                                  jPanRight.getHeight() / 2 - 1,
                                  (jPanRight.getWidth() - 1),
                                  (jPanRight.getHeight()) / 2 - 1);

    }

    public void jPanel3_componentResized(ComponentEvent e) {
        jScrollPane1.setBounds(1,25,(jPanel3.getWidth()),
                             jPanel3.getHeight()-26);
        jLabelTop.setBounds(( jPanel3.getWidth() - 140) / 2, 1, 140, 24);

    }

    public void jButtonC_actionPerformed(ActionEvent e) {
        yuqiserchar(3);
    }

    public void jButtonB_actionPerformed(ActionEvent e) {
        yuqiserchar(2);
    }

    public void jButtonA_actionPerformed(ActionEvent e) {
        yuqiserchar(1);
    }

    public void jButtonD_actionPerformed(ActionEvent e) {
        yuqiserchar(0);
    }

    public void jTabBooks_mouseClicked(MouseEvent e) {
        //获得逾期图书的编号,查询读者编号列表
        if (jTabBooks.getSelectedRow() > -1) {
            String booksNum = jTabBooks.getValueAt(jTabBooks.getSelectedRow(),
                                                   0).toString().trim();
            //JOptionPane.showMessageDialog(null,booksNum);
            String sql =
                    "select * from dbo.booksBoorow_readerInfo where bookid = '" +
                    booksNum + "' and isreturnbook='否'";
            ResultSet re = null;
            re = db.search(sql);
            int size = 0;
            try {
                while (re.next())
                    size++;
                dateReader = new Object[size][titleReader.length];
                dataReader2 = new Object[size][titleReader2.length];
                boolean temp = re.first();
                for (int i = 0; i < size; i++) {
                    for (int j = 0; j < titleReader2.length; j++) {
                        Object a = re.getString(j + 1);
                        if (a == null)
                            a = "null";
                        a = a.toString().trim();
                        if (a.equals(new Integer(1)))
                            a = "是";
                        if (a.equals(new Integer(0)))
                            a = "否";
                        dataReader2[i][j] = a;
                    }
                    temp = re.next();
                }
                for (int i = 0; i < size; i++) {
                    for (int j = 0; j < titleReader.length; j++) {
                        if (j < 2)
                            dateReader[i][j] = dataReader2[i][j];
                        else
                            dateReader[i][j] = dataReader2[i][j + 3];
                    }

⌨️ 快捷键说明

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