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

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

?? studentinfopanel.java~85~

?? 使用JBuilder基于Oracle數據庫的課程作業
?? JAVA~85~
?? 第 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();
    int deleteLimitDays;
    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));

            ResultSet rs=SQLRunner.getResult("select value from parameter where parametername='stu_delete_limit'");
            rs.next();
            deleteLimitDays=rs.getInt("value");
        } 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 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一区二区三区免费野_久草精品视频
欧美精品色一区二区三区| 一区视频在线播放| 中文字幕人成不卡一区| 日韩一区欧美二区| 99热99精品| 久久品道一品道久久精品| 调教+趴+乳夹+国产+精品| 99在线视频精品| 久久九九久久九九| 麻豆精品一二三| 欧美三级视频在线播放| 中文字幕在线一区| 国产美女精品人人做人人爽| 欧美丰满少妇xxxbbb| 一区二区三区四区在线| 不卡一区二区三区四区| 精品国产三级电影在线观看| 午夜婷婷国产麻豆精品| 在线这里只有精品| 亚洲欧美日韩小说| 99久久精品情趣| 国产精品无圣光一区二区| 国产一区二区三区在线观看免费 | 国产精品影音先锋| 欧美一区二区三区免费大片 | 色婷婷综合久久久中文一区二区| 欧美精品一区二区三区蜜桃视频| 日精品一区二区三区| 91久久精品国产91性色tv| 亚洲人成网站色在线观看| 91在线免费视频观看| 国产精品国产三级国产专播品爱网| 国产黄色成人av| 久久精品视频一区二区三区| 国产精品18久久久久久久久久久久| 日韩精品一区二区三区视频 | 亚洲精品成人悠悠色影视| 成人18精品视频| 亚洲欧美一区二区视频| 91日韩一区二区三区| 亚洲另类在线一区| 91国模大尺度私拍在线视频| 亚洲一区二区视频在线观看| 欧美午夜片在线观看| 亚洲aⅴ怡春院| 欧美一区二区精美| 国产综合色在线视频区| 中文字幕高清不卡| 99re热这里只有精品免费视频| 最新高清无码专区| 欧美色大人视频| 麻豆精品一区二区| 国产精品视频一区二区三区不卡| av激情综合网| 亚洲成av人片观看| 亚洲精品在线观看视频| 懂色av一区二区三区免费观看| 18成人在线视频| 8x8x8国产精品| 国产成人自拍高清视频在线免费播放| 中文字幕精品—区二区四季| 欧美丝袜丝交足nylons图片| 免费高清在线视频一区·| 国产偷国产偷精品高清尤物| 色美美综合视频| 精品一区二区三区免费观看| 国产精品成人网| 制服丝袜在线91| av在线综合网| 蜜桃视频在线观看一区| 国产精品福利一区二区| 欧美一区二区网站| www.欧美日韩| 老司机精品视频在线| 亚洲色图20p| 欧美mv日韩mv| 欧美三级日韩三级国产三级| 国产九色sp调教91| 日韩成人精品在线观看| 亚洲欧美综合色| 精品成人一区二区三区| 91国产视频在线观看| 国产成人免费视频网站高清观看视频 | 欧美中文字幕久久| 国内成+人亚洲+欧美+综合在线 | 日本一区二区不卡视频| 337p亚洲精品色噜噜噜| 一本色道久久加勒比精品| 精久久久久久久久久久| 亚洲一区精品在线| 中文字幕色av一区二区三区| 日韩一级片在线观看| 欧美亚洲日本一区| 成人黄色大片在线观看| 国产成人午夜电影网| 极品瑜伽女神91| 青青草原综合久久大伊人精品| 国产精品精品国产色婷婷| 精品乱人伦一区二区三区| 欧美高清dvd| 欧美日韩精品电影| 99国产精品久久久久久久久久| 国产一区视频在线看| 首页国产丝袜综合| 亚洲午夜一区二区| 自拍偷拍亚洲激情| 中文字幕中文字幕一区二区| 国产女同互慰高潮91漫画| 久久久99精品久久| 久久精品欧美一区二区三区麻豆| 日韩美女主播在线视频一区二区三区| 欧美日韩国产成人在线91| 欧美视频中文字幕| 91成人在线观看喷潮| 欧美在线观看你懂的| 欧美日韩一区二区在线观看视频 | 亚洲免费电影在线| 亚洲精品日韩一| 亚洲乱码中文字幕综合| 一区二区欧美国产| 亚洲成年人网站在线观看| 日韩精品成人一区二区三区| 日韩高清不卡在线| 日本欧美在线看| 激情av综合网| 丁香桃色午夜亚洲一区二区三区| 国产成人综合网站| 色综合久久88色综合天天免费| 色狠狠一区二区三区香蕉| 在线一区二区三区| 欧美一区二区网站| 久久久国产精品不卡| 国产精品区一区二区三区| 亚洲欧美日韩国产成人精品影院| 一区二区三区在线观看动漫| 亚洲二区在线观看| 精品中文字幕一区二区小辣椒| 国产在线精品一区二区| 99免费精品在线观看| 欧美日韩一区二区在线观看| 日韩美女一区二区三区四区| 国产视频在线观看一区二区三区 | 亚洲妇熟xx妇色黄| 老汉av免费一区二区三区| 国产成人午夜精品影院观看视频 | 91精品国产色综合久久| 亚洲精品一区二区三区精华液| 日本一区二区三级电影在线观看 | 国产女人aaa级久久久级| 综合精品久久久| 日韩成人免费电影| 粉嫩一区二区三区性色av| 色欧美片视频在线观看| 欧美日本一道本在线视频| 久久久久久亚洲综合| 亚洲一区免费观看| 国产成人99久久亚洲综合精品| 欧美羞羞免费网站| 国产欧美中文在线| 亚洲一区二区在线视频| 国产精品 日产精品 欧美精品| 在线欧美小视频| 久久久欧美精品sm网站| 亚洲va欧美va人人爽| 成人午夜激情片| 日韩欧美一区二区视频| 亚洲另类中文字| 国产伦精品一区二区三区免费| 91久久精品一区二区三| 国产偷国产偷亚洲高清人白洁| 亚洲一区二区影院| 成人高清免费在线播放| 日韩精品一区国产麻豆| 亚洲午夜免费视频| 99久久99久久综合| 久久这里都是精品| 国产激情一区二区三区四区| 欧美日韩你懂得| 亚洲日本在线天堂| 国产精品2024| 日韩精品一区二区三区视频播放 | 欧美老人xxxx18| 亚洲欧美日韩系列| 岛国av在线一区| 亚洲精品在线观看视频| 蜜桃av一区二区在线观看| 欧美精品丝袜久久久中文字幕| 亚洲精品精品亚洲| fc2成人免费人成在线观看播放| 精品成人a区在线观看| 免费亚洲电影在线| 555www色欧美视频| 亚洲一区在线电影| 欧美熟乱第一页| 亚洲一区二区在线免费看| 色婷婷综合久久久中文字幕| 亚洲欧洲国产日韩| 91在线视频免费91| 亚洲精品乱码久久久久久黑人 | 国产精品麻豆一区二区|