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

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

?? studentinfopanel.java~86~

?? 使用JBuilder基于Oracle數據庫的課程作業
?? JAVA~86~
?? 第 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一区二区三区免费野_久草精品视频
偷拍与自拍一区| 久久久久久夜精品精品免费| 欧美性极品少妇| 欧美亚日韩国产aⅴ精品中极品| 精品国产乱码久久久久久久久| 亚洲免费观看高清在线观看| 国产自产v一区二区三区c| 欧美大胆人体bbbb| av网站免费线看精品| 欧美日韩一级片在线观看| 日本一区二区不卡视频| 男女性色大片免费观看一区二区| 国产成人在线视频网站| 欧美高清视频不卡网| 国产精品久久99| 国产一区二区三区在线观看免费视频 | 欧美日韩国产另类不卡| 国产精品色哟哟| 成人一区二区在线观看| 国产精品国产精品国产专区不蜜| 狠狠色狠狠色综合日日91app| 欧美成人性福生活免费看| 天堂蜜桃91精品| 欧美精品v日韩精品v韩国精品v| 开心九九激情九九欧美日韩精美视频电影 | 国产精品毛片久久久久久| 欧美在线不卡一区| 国产成人精品一区二区三区四区| 亚洲综合图片区| 国产成人精品综合在线观看| 国产午夜精品福利| 欧美伊人久久大香线蕉综合69 | 七七婷婷婷婷精品国产| 69堂国产成人免费视频| 日韩福利视频网| 亚洲国产高清aⅴ视频| 欧美欧美欧美欧美| 国产精品456| 午夜伦理一区二区| 国产精品高潮呻吟久久| 久久综合久久鬼色| 91精品视频网| 欧美丰满嫩嫩电影| 久久99精品久久久久| 石原莉奈在线亚洲三区| 美美哒免费高清在线观看视频一区二区 | 成人av在线一区二区三区| 成人激情小说网站| 国产在线播放一区| av中文字幕亚洲| 一本大道久久a久久精二百| 在线播放中文字幕一区| 91精品国产综合久久久蜜臀图片| 欧美色网一区二区| 精品国产三级a在线观看| 欧美激情综合在线| 亚洲第一av色| 亚洲色图一区二区| 精品福利一区二区三区| 亚洲国产成人在线| 一区二区视频在线| 一级精品视频在线观看宜春院 | 国产乱人伦偷精品视频不卡 | 精品一区二区三区不卡 | 久久只精品国产| 一区二区免费视频| 天堂资源在线中文精品| 精品一区二区三区视频在线观看 | 欧美日本精品一区二区三区| 国产精品乱码人人做人人爱| 免费的成人av| 久久99精品国产麻豆不卡| 精品一区二区三区在线视频| av在线免费不卡| 8v天堂国产在线一区二区| 国产日韩av一区| 婷婷久久综合九色综合伊人色| 久久69国产一区二区蜜臀| 国产91精品在线观看| 欧美一级片在线| 亚洲欧美日韩在线| 国产福利一区在线观看| 欧美日韩国产精选| 亚洲靠逼com| 国产不卡一区视频| 欧美成人一区二区| 午夜日韩在线观看| 91国产免费观看| 国产精品久久三| 国产美女在线观看一区| 欧美日韩成人高清| 樱桃国产成人精品视频| 91丝袜美腿高跟国产极品老师| 久久久综合网站| 国产69精品久久久久毛片 | 精品国产乱码久久久久久1区2区| 亚洲成人午夜电影| 欧日韩精品视频| 亚洲在线视频免费观看| 色8久久精品久久久久久蜜| 亚洲情趣在线观看| 在线观看91视频| 日韩高清中文字幕一区| 欧美高清视频在线高清观看mv色露露十八| 综合久久综合久久| 欧美主播一区二区三区| 三级亚洲高清视频| 2023国产精品自拍| 国产精品综合av一区二区国产馆| 精品av综合导航| 成人免费高清在线| 亚洲一区二区三区四区五区黄 | 日本一二三不卡| 色综合激情五月| 石原莉奈一区二区三区在线观看| 91麻豆精品91久久久久同性| 国产经典欧美精品| 亚洲欧美国产毛片在线| 欧美丰满高潮xxxx喷水动漫| 国产精品一二三| 亚洲美女电影在线| 日韩女优毛片在线| 91麻豆6部合集magnet| 日本免费新一区视频| 日本一区二区三区四区在线视频| 色狠狠色狠狠综合| 经典三级视频一区| 亚洲一区在线观看网站| 精品国产一区二区三区久久影院| 在线免费视频一区二区| 国产成人在线影院| 免费成人在线观看| 亚洲精品欧美二区三区中文字幕| 欧美v日韩v国产v| 欧美日韩一区二区三区不卡| 暴力调教一区二区三区| 麻豆精品在线播放| 三级成人在线视频| 一区二区欧美在线观看| 亚洲欧美成人一区二区三区| 久久精品欧美日韩精品| xfplay精品久久| 欧美一区二区三区男人的天堂| 91豆麻精品91久久久久久| av电影一区二区| 91在线视频免费观看| av日韩在线网站| 91麻豆精品在线观看| 91美女在线看| 欧美在线视频你懂得| 欧美另类高清zo欧美| 欧美电影在线免费观看| 欧美人与z0zoxxxx视频| jizz一区二区| 99久久综合狠狠综合久久| 国产精品主播直播| 亚洲成人激情自拍| 热久久国产精品| 狠狠色综合播放一区二区| 精品一区二区免费在线观看| 国产乱子伦一区二区三区国色天香| 美女国产一区二区三区| 国产一区二区三区免费观看| 不卡电影免费在线播放一区| 成人av电影在线观看| 色诱视频网站一区| 欧美视频三区在线播放| 日韩欧美国产一二三区| 中文字幕欧美激情一区| 2024国产精品视频| 亚洲伦理在线精品| 亚洲电影你懂得| 丝袜亚洲精品中文字幕一区| 美女视频黄 久久| 国产一二精品视频| 日本精品一级二级| 99久久久精品免费观看国产蜜| 老鸭窝一区二区久久精品| 国产亚洲短视频| 国产精品国产三级国产普通话99| 欧美极品美女视频| 亚洲女人的天堂| 亚洲小少妇裸体bbw| av在线不卡免费看| 视频一区二区中文字幕| 国产精品久久久久久久裸模| 在线免费亚洲电影| 国产乱人伦偷精品视频不卡 | 国产女同互慰高潮91漫画| 日韩精品电影在线| 日本成人在线视频网站| 亚洲大片一区二区三区| 美女久久久精品| 粉嫩aⅴ一区二区三区四区五区| 丁香六月综合激情| 国产成人精品亚洲777人妖| 成人性生交大片免费看中文| 一本色道久久加勒比精品| 99精品1区2区| av中文字幕一区|