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

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

?? studentinfopanel.java~79~

?? 使用JBuilder基于Oracle數據庫的課程作業
?? JAVA~79~
?? 第 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 rs=SQLRunner.getResult("select * from studentinfo where stu_no='"+keyValue+"'");
            if (!rs.next())return false;
            String birthday=rs.getString("birthday");
            Date d=new Date(Date.parse(birthday));
            GregorianCalendar gc=new GregorianCalendar(d.getYear(),d.getMonth(),d.getDay());
            Date now=new Date();
            GregorianCalendar gcn=new GregorianCalendar(now.getYear(),now.getMonth(),now.getDay());
            gc.add(GregorianCalendar.DATE,21);
            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;
            if(jComboBox_class.getSelectedItem()==null){
                class_no="";
            }else{
                String clname=(String)(jComboBox_class.getSelectedItem());

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久综合九色欧美综合狠狠| 亚洲一区二区影院| 中文字幕视频一区| 亚洲mv大片欧洲mv大片精品| 激情综合色播激情啊| 成人avav影音| 欧美妇女性影城| 国产清纯白嫩初高生在线观看91 | 欧美精品一卡两卡| 久久夜色精品国产欧美乱极品| 中文字幕日韩一区二区| 日本人妖一区二区| 93久久精品日日躁夜夜躁欧美| 欧美电影免费观看高清完整版 | 欧美一级夜夜爽| 国产精品久久久久一区二区三区| 丝袜美腿亚洲一区二区图片| www.亚洲人| 欧美精品一区二区三区一线天视频| 一色桃子久久精品亚洲| 精品一区二区日韩| 欧美久久久久久久久中文字幕| 国产精品色哟哟网站| 狠狠久久亚洲欧美| 日韩亚洲国产中文字幕欧美| 亚洲欧美一区二区三区极速播放| 久草中文综合在线| 欧美精品777| 亚洲线精品一区二区三区八戒| 成人精品视频一区二区三区尤物| 日韩一区二区三区在线| 亚洲午夜精品久久久久久久久| a级高清视频欧美日韩| 国产三级一区二区| 国产成人免费视| 精品国产亚洲在线| 美女免费视频一区二区| 欧美一级日韩不卡播放免费| 亚洲成人一区二区在线观看| 欧美在线三级电影| 夜夜精品视频一区二区| 色悠悠亚洲一区二区| 18涩涩午夜精品.www| 成年人午夜久久久| 国产精品第13页| 成人动漫一区二区| 中文字幕中文在线不卡住| av资源站一区| 亚洲免费观看在线观看| 在线中文字幕一区| 午夜欧美一区二区三区在线播放| 欧美视频日韩视频| 亚洲成人动漫在线免费观看| 欧美丰满高潮xxxx喷水动漫| 午夜激情一区二区三区| 欧美一区二区三区在线观看 | 免费看黄色91| 精品免费一区二区三区| 激情久久五月天| 国产日产亚洲精品系列| 99久久精品国产网站| 亚洲伦理在线精品| 欧美欧美午夜aⅴ在线观看| 日本欧美肥老太交大片| 久久综合99re88久久爱| 懂色av中文一区二区三区| 亚洲视频图片小说| 欧美日韩综合色| 蜜桃在线一区二区三区| 26uuu色噜噜精品一区| 成人精品国产免费网站| 一区二区三区免费看视频| 欧美一区在线视频| 国产剧情一区二区三区| 亚洲四区在线观看| 欧美一区二区三区视频| 国产91在线|亚洲| 一区二区视频在线| 精品国产成人系列| 97精品电影院| 久久99精品国产.久久久久久| 国产精品毛片大码女人| 欧美日韩一区二区三区免费看| 激情综合色综合久久| 亚洲日本青草视频在线怡红院| 制服丝袜亚洲播放| 成人动漫一区二区在线| 日韩av不卡在线观看| 国产精品毛片无遮挡高清| 欧美一区二区视频在线观看2020| 成人免费毛片app| 秋霞电影一区二区| 亚洲色图另类专区| 久久综合九色综合欧美98| 欧美色综合影院| 成人深夜福利app| 秋霞av亚洲一区二区三| 亚洲免费在线观看视频| 国产日产欧美精品一区二区三区| 欧美日韩免费高清一区色橹橹| 国产精品一区一区三区| 奇米影视一区二区三区| 亚洲色大成网站www久久九九| 久久先锋影音av鲁色资源网| 欧美日韩国产一级二级| 波波电影院一区二区三区| 九九精品视频在线看| 午夜激情久久久| 一区二区三区精品在线观看| 国产欧美1区2区3区| 欧美电影免费提供在线观看| 欧美日韩国产高清一区二区| 91久久国产综合久久| 成人av在线资源| 国产剧情一区二区三区| 精品在线播放午夜| 蜜臀av性久久久久蜜臀aⅴ四虎| 亚洲在线视频网站| 亚洲色图19p| 亚洲日韩欧美一区二区在线| 国产精品国产三级国产aⅴ中文 | 99久久国产综合色|国产精品| 国产一区二区毛片| 久久福利视频一区二区| 男女激情视频一区| 乱中年女人伦av一区二区| 日韩和欧美一区二区| 爽爽淫人综合网网站| 亚洲国产毛片aaaaa无费看| 亚洲伊人色欲综合网| 有码一区二区三区| 亚洲成人午夜影院| 日韩在线a电影| 免费看黄色91| 激情综合色综合久久| 国产精品99久久久久久有的能看| 国产主播一区二区| 粉嫩av一区二区三区| 91美女在线看| 欧美日韩精品一区二区三区四区| 欧美日韩国产美女| 日韩视频一区在线观看| 精品国一区二区三区| 国产视频一区二区在线| |精品福利一区二区三区| 亚洲少妇最新在线视频| 亚洲一区二区三区中文字幕| 日韩精品成人一区二区在线| 激情文学综合网| 成人性视频网站| 精品视频全国免费看| 51午夜精品国产| 久久久精品黄色| 亚洲婷婷综合色高清在线| 亚洲成人7777| 国产一区二区伦理| 一本在线高清不卡dvd| 欧美精品aⅴ在线视频| 国产农村妇女毛片精品久久麻豆| 最新高清无码专区| 蜜桃视频在线观看一区| av激情成人网| 日韩一区二区三区高清免费看看| 久久久久久久久伊人| 一区二区日韩av| 精品午夜一区二区三区在线观看| 99re亚洲国产精品| 欧美videossexotv100| 国产精品成人在线观看| 日本大胆欧美人术艺术动态| 成人一级片在线观看| 欧美欧美午夜aⅴ在线观看| 国产欧美精品国产国产专区| 视频一区二区三区中文字幕| 风间由美一区二区三区在线观看| 欧美老肥妇做.爰bbww视频| 国产精品丝袜在线| 日韩电影在线观看网站| 99re视频精品| 欧美精品一区二区三区高清aⅴ| 亚洲精品亚洲人成人网在线播放| 精品一区二区久久久| 欧美日韩中文一区| 亚洲欧美综合色| 国产综合色在线视频区| 欧美日韩一区二区电影| 中文字幕一区二区三区不卡| 国产一区二区在线观看免费| 欧美三级在线看| 亚洲人成小说网站色在线| 国产在线精品一区二区三区不卡 | 欧美日韩一区二区电影| 1000部国产精品成人观看| 狠狠色狠狠色综合日日91app| 欧美日韩国产一级| 亚洲国产毛片aaaaa无费看 | 久久99精品国产麻豆婷婷洗澡| 欧美日韩亚洲另类| 一区二区久久久| 99久久国产综合色|国产精品|