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

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

?? studentinfopanel.java~78~

?? 使用JBuilder基于Oracle數據庫的課程作業
?? JAVA~78~
?? 第 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一区二区三区免费野_久草精品视频
精品三级在线观看| 欧美日韩一区二区在线视频| 亚洲精品在线三区| 韩国精品一区二区| 国产亚洲一区二区三区在线观看| 国产在线播放一区二区三区| 国产日韩亚洲欧美综合| av影院午夜一区| 亚洲成人av免费| 26uuu国产电影一区二区| 国产精品一区二区在线观看网站| 国产精品久久综合| 欧美日韩成人在线| 极品尤物av久久免费看| 中文字幕日韩精品一区 | 国产日韩欧美一区二区三区乱码| 国产综合一区二区| 亚洲精品中文在线影院| 日韩精品资源二区在线| av电影在线观看一区| 日韩国产在线观看一区| 久久色在线观看| 欧洲一区在线观看| 国产在线一区二区综合免费视频| 亚洲六月丁香色婷婷综合久久| 欧美夫妻性生活| 播五月开心婷婷综合| 亚洲在线视频免费观看| 精品国产不卡一区二区三区| 91老师片黄在线观看| 另类小说视频一区二区| 亚洲色图欧洲色图婷婷| 2020国产精品| 欧美色图片你懂的| 成人毛片老司机大片| 日韩综合在线视频| 中文一区二区完整视频在线观看| 欧美日本韩国一区二区三区视频| 国产91丝袜在线18| 蜜臀a∨国产成人精品| 亚洲美女精品一区| 久久久久久久久久电影| 91精品欧美综合在线观看最新| 成人激情校园春色| 国产一区91精品张津瑜| 日精品一区二区三区| 亚洲乱码国产乱码精品精98午夜 | 综合欧美一区二区三区| 精品久久久三级丝袜| 欧美tk—视频vk| 波多野结衣在线一区| 久久99国产精品免费网站| 一区二区三区四区在线播放 | 日本精品视频一区二区三区| 国产一区二区成人久久免费影院| 午夜一区二区三区视频| 亚洲免费观看高清在线观看| 欧美极品aⅴ影院| 久久蜜桃一区二区| 精品国产制服丝袜高跟| 日韩一级大片在线观看| 欧美日本视频在线| 欧美人狂配大交3d怪物一区| 欧美在线你懂的| 欧洲中文字幕精品| 欧美最新大片在线看| 日本韩国视频一区二区| 91丨porny丨户外露出| 99久久精品费精品国产一区二区 | 99久久精品免费看国产 | 激情偷乱视频一区二区三区| 天天亚洲美女在线视频| 亚洲国产美女搞黄色| 一区二区三区**美女毛片| 亚洲乱码精品一二三四区日韩在线| 欧美国产日韩a欧美在线观看 | 国产一区二区三区国产| 久久精品国产亚洲5555| 久久66热偷产精品| 国产毛片精品视频| 国产成人高清在线| 成人av在线影院| 一本一本大道香蕉久在线精品| 99在线精品视频| 91论坛在线播放| 在线观看不卡视频| 欧美裸体一区二区三区| 日韩女优视频免费观看| 2020日本不卡一区二区视频| 中文字幕 久热精品 视频在线| 国产精品理论片在线观看| 亚洲欧美日韩人成在线播放| 国内精品伊人久久久久av影院| 青青青爽久久午夜综合久久午夜| 久久99蜜桃精品| 国产成人精品亚洲日本在线桃色| 波多野结衣中文一区| 欧洲激情一区二区| 日韩小视频在线观看专区| 久久久精品2019中文字幕之3| 中文一区二区在线观看| 亚洲制服欧美中文字幕中文字幕| 日韩制服丝袜av| 国产精华液一区二区三区| 91网站在线观看视频| 欧美福利一区二区| 久久久久久久一区| 亚洲综合色婷婷| 久久99久久99| 91网站在线观看视频| 欧美一区二区三区免费观看视频| 久久精品在线免费观看| 亚洲国产精品一区二区尤物区| 久久99热这里只有精品| 91丨porny丨中文| 日韩欧美国产1| 亚洲日本一区二区三区| 美女视频黄久久| 一本大道久久a久久精二百| 91麻豆精品久久久久蜜臀| 国产欧美日韩卡一| 奇米综合一区二区三区精品视频| 成人一级黄色片| 91精品国产91久久久久久一区二区 | 精品在线免费视频| 91蜜桃网址入口| 久久久综合视频| 天天色图综合网| eeuss鲁片一区二区三区| 欧美一区二区三区在| 亚洲男帅同性gay1069| 国产精品白丝jk白祙喷水网站| 欧美巨大另类极品videosbest | av动漫一区二区| 精品美女被调教视频大全网站| 亚洲六月丁香色婷婷综合久久| 国内成+人亚洲+欧美+综合在线 | 日韩av一级片| 欧洲视频一区二区| 国产精品三级av| 国内精品自线一区二区三区视频| 欧美亚洲国产一区二区三区 | 成人网在线免费视频| 日韩欧美123| 天堂一区二区在线免费观看| 91小视频在线| 国产精品成人在线观看| 久久精品国产99国产精品| 欧美日韩一区高清| 亚洲夂夂婷婷色拍ww47| 91免费看视频| 18涩涩午夜精品.www| 岛国精品在线播放| 国产欧美视频一区二区| 国产乱人伦偷精品视频不卡| 91精品国产乱码| 午夜精品久久一牛影视| 欧美欧美欧美欧美| 一区二区三区.www| 欧美亚洲综合在线| 亚洲一区二区三区小说| 欧洲国内综合视频| 樱桃国产成人精品视频| 在线看国产一区二区| 夜夜嗨av一区二区三区| 在线观看网站黄不卡| 亚洲综合免费观看高清完整版在线 | 亚洲色图第一区| 91在线无精精品入口| 日韩久久一区二区| 色婷婷av一区二区三区gif| 一区二区在线观看视频| 91激情在线视频| 亚洲.国产.中文慕字在线| 91精品婷婷国产综合久久| 蜜桃视频第一区免费观看| 欧美大片在线观看一区| 精品亚洲欧美一区| 亚洲国产成人一区二区三区| 99综合电影在线视频| 亚洲国产欧美在线人成| 欧美一区二区视频在线观看| 精品亚洲国内自在自线福利| 久久久99免费| 99久久精品国产精品久久| 亚洲一区二区视频在线观看| 8x8x8国产精品| 国产在线麻豆精品观看| 欧美激情在线一区二区| 一本色道**综合亚洲精品蜜桃冫 | 日本在线观看不卡视频| 精品欧美久久久| 不卡高清视频专区| 亚洲bt欧美bt精品777| 日韩精品一区二| 91小视频免费观看| 免费成人av在线| 综合激情成人伊人| 欧美一区二区三区四区五区| 欧美在线|欧美|