亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? studentinfopanel.java

?? 使用JBuilder基于Oracle數據庫的課程作業
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package StudentManageSystem.factionpanels.infopanel;

import javax.swing.JFormattedTextField;
import javax.swing.JComboBox;
import javax.swing.JTextField;
import javax.swing.JLabel;
import com.borland.jbcl.layout.XYConstraints;
import StudentManageSystem.link.SQLRunner;
import java.sql.ResultSet;
import javax.swing.JOptionPane;
import java.sql.SQLException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Calendar;
import javax.swing.text.DateFormatter;
import java.text.SimpleDateFormat;
import java.text.DateFormat;
//import java.sql.Date;
import java.util.Date;
import java.util.StringTokenizer;
import java.util.GregorianCalendar;

public class StudentInfoPanel extends InfoPanel {
    JLabel jLabel_name = new JLabel();
    JLabel jLabel_nation = new JLabel();
    JLabel jLabel_source = new JLabel();
    JLabel jLabel_home_phone = new JLabel();
    JLabel jLabel_stu_no = new JLabel();
    JLabel jLabel_birthday = new JLabel();
    JLabel jLabel_score = new JLabel();
    JLabel jLabel_address = new JLabel();
    JLabel jLabel_sex = new JLabel();
    JLabel jLabel_polity = new JLabel();
    JLabel jLabel_college = new JLabel();
    JLabel jLabel13 = new JLabel();
    JLabel jLabel14 = new JLabel();
    JLabel jLabel11 = new JLabel();
    JLabel jLabel15 = new JLabel();
    JTextField jTextField_name = new JTextField();
    JTextField jTextField_stu_no = new JTextField();
    JComboBox jComboBox_sex = new JComboBox();
    JComboBox jComboBox_nation = new JComboBox();
    DateFormat format=new SimpleDateFormat("yyyy-MM-dd");
    DateFormatter df=new DateFormatter(format);
    JFormattedTextField jFormattedTextField_birthday=new JFormattedTextField(df);
    //JFormattedTextField jFormattedTextField_birthday = new JFormattedTextField(new AbstractFormatter());
    JComboBox jComboBox_polity = new JComboBox();
    JTextField jTextField_score = new JTextField();
    JTextField jTextField_home_phone = new JTextField();
    JComboBox jComboBox_source = new JComboBox();
    JTextField jTextField_address = new JTextField();
    JComboBox jComboBox_college = new JComboBox();
    JComboBox jComboBox_department = new JComboBox();
    JComboBox jComboBox_class = new JComboBox();
    JComboBox jComboBox_Build_no = new JComboBox();
    JComboBox jComboBox_apartment_no = new JComboBox();
    public StudentInfoPanel(boolean e){
        try {
            initialize(e);//初始化父類
        } catch (Exception ex) {
        }
    }
    protected void initialize(boolean e){
        try {
            super.initialize(e);
            jLabel_name.setText("姓名");
            jLabel_nation.setText("民族");
            jLabel_source.setText("學生來源");
            jLabel_home_phone.setText("家庭聯系電話");
            jLabel_stu_no.setText("學號");
            jLabel_birthday.setText("出生日期");
            jLabel_score.setText("入學成績");
            jLabel_address.setText("家庭住址");
            jLabel_sex.setText("性別");
            jLabel_polity.setText("政治面貌");
            jLabel_college.setText("學院");
            jLabel13.setText("系");
            jLabel14.setText("班");
            jLabel11.setText("號樓");
            jLabel15.setText("宿舍");

            this.add(jLabel_birthday, new XYConstraints(38, 102, 97, 42));
            this.add(jLabel_score, new XYConstraints(448, 106, 98, 35));
            this.add(jLabel_address, new XYConstraints(38, 240, 97, 35));
            this.add(jLabel_stu_no, new XYConstraints(183, 38, 36, 38));
            this.add(jLabel_name, new XYConstraints(38, 38, 37, 39));
            this.add(jLabel_nation, new XYConstraints(505, 40, 46, 36));
            this.add(jLabel_source, new XYConstraints(38, 171, 73, 42));
            this.add(jLabel_home_phone, new XYConstraints(259, 175, -1, 35));
            this.add(jLabel_polity, new XYConstraints(253, 101, 58, 42));
            this.add(jTextField_home_phone, new XYConstraints(354, 175, 185, 33));
            this.add(jComboBox_source, new XYConstraints(128, 177, 102, 30));
            this.add(jComboBox_polity, new XYConstraints(318, 105, 94, 31));
            this.add(jComboBox_nation, new XYConstraints(552, 40, 100, 30));
            this.add(jTextField_name, new XYConstraints(85, 39, 76, 31));
            this.add(jTextField_stu_no, new XYConstraints(218, 40, 94, 30));
            //jFormattedTextField_birthday.setValue(new Date());
            this.add(jFormattedTextField_birthday, new XYConstraints(104, 107, 140, 32));
            this.add(jTextField_score, new XYConstraints(530, 107, 89, 29));
            this.add(jTextField_address, new XYConstraints(113, 242, 532, 32));
            this.add(jLabel13, new XYConstraints(573, 302, 92, 36));
            this.add(jLabel_college, new XYConstraints(274, 302, 103, 36));
            this.add(jComboBox_class, new XYConstraints(23, 358, 224, 30));
            this.add(jLabel14, new XYConstraints(276, 353, 89, 36));
            this.add(jLabel11, new XYConstraints(423, 358, 86, 33));
            this.add(jLabel15, new XYConstraints(579, 354, 86, 41));
            this.add(jComboBox_college, new XYConstraints(24, 302, 238, 32));
            this.add(jComboBox_department, new XYConstraints(386, 304, 175, 31));
            this.add(jComboBox_Build_no, new XYConstraints(355, 358, 65, 32));
            this.add(jComboBox_apartment_no, new XYConstraints(474, 358, 99, 32));
            this.add(jComboBox_sex, new XYConstraints(395, 40, 59, 29));
            this.add(jLabel_sex, new XYConstraints(345, 35, 51, 36));

        } catch (Exception ex) {
        }
        jComboBox_college.addActionListener(new
                MyStudentInfoPanel_jComboBox_college_actionAdapter(this));
        jComboBox_department.addActionListener(new
                MyStudentInfoPanel_jComboBox_department_actionAdapter(this));
        jComboBox_Build_no.addActionListener(new
                MyStudentInfoPanel_jComboBox_Build_no_actionAdapter(this));
    }
    public void setSwingEnable(boolean e) {//父類初始化調用
        jTextField_home_phone.setEnabled(e);
        jComboBox_source.setEnabled(e);
        jComboBox_polity.setEnabled(e);
        jComboBox_nation.setEnabled(e);
        jTextField_name.setEnabled(e);
        jTextField_stu_no.setEnabled(e);
        jFormattedTextField_birthday.setEnabled(e);
        jTextField_score.setEnabled(e);
        jTextField_address.setEnabled(e);
        jComboBox_class.setEnabled(e);
        jComboBox_college.setEnabled(e);
        jComboBox_department.setEnabled(e);
        jComboBox_Build_no.setEnabled(e);
        jComboBox_apartment_no.setEnabled(e);
        jComboBox_sex.setEnabled(e);

    }

    public boolean delete() {//父類按鈕響應
        try {
            ResultSet rss=SQLRunner.getResult("select value from parameter where parametername='stu_delete_limit'");
            rss.next();
            int deleteLimitDays=rss.getInt("value");
            ResultSet rs=SQLRunner.getResult("select * from studentinfo where stu_no='"+keyValue+"'");
            if (!rs.next())return false;
            String birthday=rs.getString("createdate");
            Date d=new Date(Date.parse(birthday));
            GregorianCalendar gc=new GregorianCalendar();
            gc.setTime(d);
            gc.toString();
            Date now=new Date();
            GregorianCalendar gcn=new GregorianCalendar();
            gcn.setTime(now);
            gcn.toString();
            gc.add(GregorianCalendar.DATE,deleteLimitDays);
            if(!gc.after(gcn)){
                JOptionPane.showMessageDialog(null,"學生紀錄創建已超過指定天數,不得刪除","系統提示",JOptionPane.ERROR_MESSAGE);
                return false;
            }
            return SQLRunner.executSql("delete from student where stu_no='"+keyValue+"'");
        } catch (SQLException ex) {
            return false;
        }


    }

    public boolean update() {//父類按鈕響應
        try{
            boolean roomchanged=true;
            String class_no;
            if(jComboBox_class.getSelectedItem()==null){
                class_no="";
            }else{
                String clname=(String)(jComboBox_class.getSelectedItem());
                ResultSet rs=SQLRunner.getResult("select * from class where clname='"+clname+"'");
                if(!rs.next())return false;
                class_no=rs.getString("class_no").trim();
            }
            String score=jTextField_score.getText().trim();
            if(score.equals(""))score="null";
            String sname=jTextField_name.getText().trim();
            if(sname.equals("")){
                JOptionPane.showMessageDialog(null,"姓名不能為空","系統提示",JOptionPane.ERROR_MESSAGE);
                return false;
            }
            String stu_no=jTextField_stu_no.getText().trim();
            String home_phone=jTextField_home_phone.getText().trim();
            String address=jTextField_address.getText().trim();
            String birthday=jFormattedTextField_birthday.getText().trim();

            String nation;
            if(jComboBox_nation.getSelectedItem()==null){
                nation="";
            }else{
                nation=((String)jComboBox_nation.getSelectedItem()).trim();
            }String Build_no;
            if(jComboBox_Build_no.getSelectedItem()==null){
                Build_no="";
            }else{
                Build_no=((String)jComboBox_Build_no.getSelectedItem()).trim();
            }String sex;
            if(jComboBox_sex.getSelectedItem()==null){
                sex="";
            }else{
                sex=((String)jComboBox_sex.getSelectedItem()).trim();
            }String polity;
            if(jComboBox_polity.getSelectedItem()==null){
                polity="";
            }else{
                polity=((String)jComboBox_polity.getSelectedItem()).trim();
            }String source;
            if(jComboBox_source.getSelectedItem()==null){
                source="";
            }else{
                source=((String)jComboBox_source.getSelectedItem()).trim();
            }String dorm_no;
            if(jComboBox_Build_no.getSelectedItem()==null||jComboBox_apartment_no.getSelectedItem()==null){
                dorm_no="";
            }else{
                dorm_no=((String)jComboBox_Build_no.getSelectedItem()).trim()+((String)jComboBox_apartment_no.getSelectedItem()).trim();
            }
            ResultSet rss=SQLRunner.getResult("select distinct dorm_no from studentinfo where stu_no='"+keyValue+"'");
            if(!rss.next())return false;
            if(dorm_no.equals(rss.getString("dorm_no")))roomchanged=false;
            ResultSet rns=SQLRunner.getResult("select livein from dormitory where dorm_no='"+rss.getString("dorm_no")+"'");
            if(!rns.next())return false;
            String nlive=rns.getString("livein");
            ResultSet room=SQLRunner.getResult("select * from dormitory where dorm_no='"+dorm_no+"'");
            if(!room.next())return false;
            if(!sex.equals(room.getString("sex").trim())){
                JOptionPane.showMessageDialog(null,"性別與宿舍不匹配","系統提示",JOptionPane.ERROR_MESSAGE);
                return false;
            }
            String livein=room.getString("livein").trim();
            String capacity=room.getString("CAPACITY").trim();
            if(Integer.parseInt(livein)>=Integer.parseInt(capacity)&&roomchanged){
                JOptionPane.showMessageDialog(null,"宿舍已滿","系統提示",JOptionPane.ERROR_MESSAGE);
                return false;
            }
            String updatesql="update student set class_no='"+class_no+"',dorm_no='"+dorm_no+"',nation='"+nation+"',polity='"+polity+"',sex='"+sex+"',source='"+source+"',home_phone='"+home_phone+"',address='"+address+"',score="+score+",sname='"+sname+"',birthday=to_date('"+birthday+"','yyyy-mm-dd'"+") where stu_no='"+stu_no+"'";
            return SQLRunner.executSql(updatesql);
        }catch(Exception e){
            JOptionPane.showMessageDialog(null,e.toString(),"系統提示",JOptionPane.ERROR_MESSAGE);
            return false;
        }
    }

    public boolean insert() {//父類按鈕響應
        try{
            String class_no;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产wwwccc36天堂| 色哟哟欧美精品| 色综合中文字幕国产| 欧洲一区二区av| 国产人妖乱国产精品人妖| 亚洲一级二级三级| 国产乱码精品一区二区三| 91麻豆精品久久久久蜜臀| 国产精品色在线| 久久99国产精品麻豆| 欧美日韩国产综合视频在线观看 | 中文字幕不卡在线播放| 日韩中文字幕一区二区三区| bt欧美亚洲午夜电影天堂| 欧美r级电影在线观看| 亚洲国产精品久久久男人的天堂 | 久久精品999| 欧美丰满少妇xxxxx高潮对白| 国产欧美日韩一区二区三区在线观看| 免费观看成人av| 欧美嫩在线观看| 亚洲成av人影院在线观看网| 99视频有精品| 中文字幕一区二区三区不卡 | 亚洲国产精品二十页| 国产在线精品一区二区| 欧美老女人第四色| 亚洲国产成人高清精品| 色综合久久久网| 亚洲精品亚洲人成人网| 99久久综合色| 亚洲精品成人少妇| 91国在线观看| 午夜电影一区二区三区| 777奇米成人网| 麻豆91精品视频| 欧美成人一级视频| 国产精品一区一区| 国产精品天干天干在观线| 丁香婷婷综合色啪| 亚洲欧美一区二区三区久本道91| 成人免费视频免费观看| 中文字幕中文字幕一区二区| 91捆绑美女网站| 亚洲一区二区三区在线看| 91成人在线精品| 午夜精品影院在线观看| 欧美久久久一区| 裸体一区二区三区| 精品对白一区国产伦| 国产一区二区在线看| 中文字幕电影一区| 91麻豆免费看| 天堂在线亚洲视频| 精品999在线播放| 岛国一区二区三区| 亚洲免费av高清| 制服丝袜激情欧洲亚洲| 久久超碰97人人做人人爱| 久久夜色精品一区| 成人h版在线观看| 亚洲一区二区黄色| 欧美xingq一区二区| 国产经典欧美精品| 一区二区久久久| 欧美一区中文字幕| 国产乱理伦片在线观看夜一区| 亚洲色欲色欲www| 在线电影国产精品| 国产精品888| 亚洲成a人片综合在线| 亚洲精品一区二区三区影院| 99久久99久久精品免费观看| 无码av中文一区二区三区桃花岛| 久久女同精品一区二区| 91视视频在线观看入口直接观看www | 精品理论电影在线观看 | 一区二区三区在线观看动漫| 日韩欧美自拍偷拍| 99视频一区二区| 免费看黄色91| 一区二区三区四区不卡视频 | 日韩一区二区麻豆国产| 99久久婷婷国产精品综合| 日欧美一区二区| 日韩一区在线播放| 日韩亚洲国产中文字幕欧美| 成人一道本在线| 美腿丝袜亚洲色图| 亚洲综合色噜噜狠狠| 2021国产精品久久精品| 欧美伊人久久久久久午夜久久久久| 激情伊人五月天久久综合| 亚洲一区在线观看视频| 欧美激情一区二区三区不卡| 日韩一级片网站| 欧美在线观看18| 成人av午夜影院| 国产精品一区二区免费不卡| 亚洲成人免费av| 亚洲综合一二区| 日韩一区有码在线| 国产欧美一区二区精品久导航| 欧美一区二区高清| 欧美视频一区二区在线观看| 菠萝蜜视频在线观看一区| 紧缚奴在线一区二区三区| 日韩精品1区2区3区| 亚洲国产裸拍裸体视频在线观看乱了| 国产精品传媒入口麻豆| 久久久精品综合| 精品日韩99亚洲| 欧美不卡一二三| 欧美一区二区不卡视频| 欧美高清视频在线高清观看mv色露露十八 | 亚洲综合小说图片| 亚洲精品一卡二卡| 亚洲乱码中文字幕| 亚洲欧洲精品一区二区精品久久久 | av不卡一区二区三区| 国产精品88av| 国产99久久久久久免费看农村| 国产成人自拍网| 成人免费高清在线| 91网上在线视频| 在线精品视频免费观看| 欧美色爱综合网| 337p亚洲精品色噜噜噜| 欧美精品123区| 精品区一区二区| 久久精品日韩一区二区三区| 久久香蕉国产线看观看99| 久久精品在这里| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 欧美日韩国产综合视频在线观看| 欧美精品在线观看播放| 日韩一区二区三区四区| 国产亚洲精品aa午夜观看| 中文字幕免费观看一区| 亚洲欧美电影院| 日韩avvvv在线播放| 久久99精品久久久| 国产精品一级黄| 菠萝蜜视频在线观看一区| 日本二三区不卡| 精品国产一区二区在线观看| 欧美激情综合五月色丁香小说| 亚洲美女精品一区| 奇米精品一区二区三区在线观看一| 久久av资源站| 91首页免费视频| 欧美一区二区三区视频在线| 久久久久久9999| 伊人色综合久久天天人手人婷| 五月天国产精品| 国产成人a级片| 欧美日韩综合不卡| 精品99久久久久久| 悠悠色在线精品| 精品午夜一区二区三区在线观看| 成人免费电影视频| 欧美一区二区三区免费在线看| 亚洲国产精品精华液ab| 香蕉久久一区二区不卡无毒影院| 国产精品一卡二卡在线观看| 欧美亚洲国产一区二区三区va | 国产精品夜夜爽| 欧美视频在线一区| 国产欧美视频在线观看| 五月天激情综合| aaa亚洲精品一二三区| 欧美电影精品一区二区| 亚洲欧美日韩电影| 国产一区二区不卡老阿姨| 欧美日韩在线直播| 欧美国产激情二区三区| 精品一区二区精品| 欧美性猛片aaaaaaa做受| 国产欧美日产一区| 日韩av电影免费观看高清完整版在线观看 | 亚洲欧美综合色| 国产精品18久久久久久vr| 欧美日韩成人一区二区| 1000精品久久久久久久久| 国产一区二区女| 欧美mv日韩mv国产网站| 亚洲www啪成人一区二区麻豆| 波多野结衣中文字幕一区| 国产欧美日韩精品一区| 国产精品中文欧美| 精品国产乱码久久久久久1区2区| 天堂va蜜桃一区二区三区| 欧美色图在线观看| 亚洲一区二区视频| 欧美伊人精品成人久久综合97| 综合中文字幕亚洲| 成人h版在线观看| 国产精品久久久久影视| 成人国产电影网| 国产精品乱码久久久久久|