版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、*實(shí)踐教學(xué)* 蘭州理工大學(xué)計(jì)算機(jī)與通信學(xué)院JAVA課程設(shè)計(jì)題 目: 職工信息管理系統(tǒng) 專業(yè)班級(jí):計(jì)算機(jī)科學(xué)與技術(shù)2班 姓 名: 葛曉剛 學(xué) 號(hào): 10240235 指導(dǎo)教師: 張 永 成 績: 摘 要 用計(jì)算機(jī)管理職工信息具有可靠、方便、省時(shí)省力的特點(diǎn)。當(dāng)今各種管理軟件大部分只針對(duì)一個(gè)公司或者更大的范圍來編寫,它具有通用性良好的特點(diǎn),但對(duì)于小領(lǐng)域如一個(gè)系來說,它就很難適應(yīng)這個(gè)系特殊的管理。而該設(shè)計(jì)正是基于職工信息管理的特點(diǎn)來開發(fā)的。它可以實(shí)現(xiàn)職工信息的錄入、添加、修改、刪除、查詢、保存到數(shù)據(jù)庫等基本功能。同時(shí)還為管理者提供統(tǒng)計(jì)、制表、系統(tǒng)日志、開介紹信等特色功能。該系統(tǒng)具有界面友好、操作方便、
2、成本低廉、符合管理者習(xí)慣的特點(diǎn)。另外,系統(tǒng)采用Java語言開發(fā),具有可移植性良好、不依賴于操作系統(tǒng)的特點(diǎn)。同時(shí)采用My SQL數(shù)據(jù)庫管理系統(tǒng)做數(shù)據(jù)庫,是因?yàn)樗哂泄芾矸奖?存儲(chǔ)量大的特點(diǎn),適合計(jì)算機(jī)系信息管理的要求,它主要包含以下幾個(gè)模塊:系統(tǒng)權(quán)限的設(shè)定、原始數(shù)據(jù)錄入、數(shù)據(jù)的匯總及查詢等。本文系統(tǒng)的分析了軟件開發(fā)的背景以過程;首先介紹了軟件的開發(fā)環(huán)境,其次介紹了本軟件的詳細(xì)設(shè)計(jì)過程:數(shù)據(jù)庫的設(shè)計(jì)、各個(gè)模塊的設(shè)計(jì)和實(shí)現(xiàn),以及具體界面的設(shè)計(jì)和功能。關(guān)鍵詞:職工 管理 信息系統(tǒng) 職工信息目 錄TOC o 1-3 h u HYPERLINK l _Toc21788 一、需求分析 PAGEREF _To
3、c21788 1 HYPERLINK l _Toc17142 二、總體設(shè)計(jì) PAGEREF _Toc17142 2 HYPERLINK l _Toc8 三、詳細(xì)設(shè)計(jì) PAGEREF _Toc8 3 HYPERLINK l _Toc23587 基礎(chǔ)數(shù)據(jù)定義3 HYPERLINK l _Toc29548 主要功能實(shí)現(xiàn)5 3.3數(shù)據(jù)庫表定義25 HYPERLINK l _Toc14991 四、測試28 HYPERLINK l _Toc27793 4.1登錄主界面28 HYPERLINK l _Toc3376 4.2管理員身份登錄主界面28 HYPERLINK l _Toc4613 4.3普通用戶身份
4、登錄主界面29 HYPERLINK l _Toc13767 4.4t添加職工信息29 HYPERLINK l _Toc30640 4.5修改職工信息30 HYPERLINK l _Toc7831 4.6職工信息查詢30 HYPERLINK l _Toc7831 4.6刪除職工信息31 HYPERLINK l _Toc7831 4.6添加用戶信息31 HYPERLINK l _Toc7831 4.6修改用戶信息32 HYPERLINK l _Toc7831 4.6用戶信息查詢32 HYPERLINK l _Toc7831 4.6刪除用戶信息.33 HYPERLINK l _Toc7831 4.6
5、用戶密碼修改33 HYPERLINK l _Toc24381 設(shè)計(jì)總結(jié)34 HYPERLINK l _Toc18188 參考文獻(xiàn)35 HYPERLINK l _Toc18381 致謝36TOC o 1-3 h u 一、需求分析問題描述對(duì)職工信息進(jìn)行管理,包括:職工信息的錄入、修改、刪除、更新,還有對(duì)登錄用戶進(jìn)行管理,包括用戶信息的錄入、刪除、修改,密碼修改等管理,還有對(duì)用戶信息的現(xiàn)實(shí)打印,查找等。要求(1)該管理軟件將對(duì)用戶信息進(jìn)行管理和統(tǒng)計(jì),對(duì)職工的信息進(jìn)行錄入更新管理和統(tǒng)計(jì);(2)該管理軟件將為用戶提供賬號(hào)管理工具,以便用戶對(duì)賬號(hào)進(jìn)行管理,具體為添加用戶、刪除用戶、修改用戶密碼;(4)該管
6、理軟件提供人員管理,能夠?qū)T工的分類管理,新員工的加入以及員工刪除,修改進(jìn)本信息等功能。實(shí)現(xiàn)功能(1)由鍵盤輸入職工對(duì)象,以數(shù)據(jù)庫方式保存。程序執(zhí)行時(shí)將文件錄入數(shù)據(jù)庫。(2)對(duì)職工對(duì)象進(jìn)行查找,修改,刪除,更新等操作。(3)對(duì)用戶對(duì)象進(jìn)行查找,修改,刪除,更新等操作。二、總體設(shè)計(jì)根據(jù)需求分析,整個(gè)職工管理系統(tǒng)的功能結(jié)構(gòu)如圖1所示:職工信息管理系統(tǒng)基礎(chǔ)功能信息維護(hù)查詢管理系統(tǒng)管理職工信息錄入用戶信息維護(hù) 信息刪除 修改更新職工信息查詢 密碼修改 退出系統(tǒng)圖1 系統(tǒng)功能結(jié)構(gòu)圖三、詳細(xì)設(shè)計(jì)3.1基礎(chǔ)數(shù)據(jù)類定義public class Staff private String id; / 職工號(hào)pri
7、vate String name; / 姓名private String type; / 任職類型private String xueli; / 學(xué)歷private String address; / 地址private String sex; / 性別private int age; / 年齡private double salary; / 工資public class User private String id; / 用戶編號(hào)private String name; / 用戶姓名private String sex; / 性別private String type; / 用戶類別publ
8、ic class BaseDao protected static String driver = com.mysql.jdbc.Driver; / 數(shù)據(jù)庫驅(qū)動(dòng)protected static String url = jdbc:mysql:/localhost:3306/projectdata?userUnicode=true&characterEncoding=utf8; / 連接urlprotected static String dbUser = root; / 數(shù)據(jù)庫用戶名protected static String dbPwd = root; / 數(shù)據(jù)庫密碼private sta
9、tic Connection conn = null;/ 構(gòu)造方法,創(chuàng)建數(shù)據(jù)庫連接private BaseDao() try if (conn = null) Class.forName(driver); / 加載數(shù)據(jù)庫驅(qū)動(dòng)conn = DriverManager.getConnection(url, dbUser, dbPwd); / 建立數(shù)據(jù)庫連接 elsereturn; catch (Exception ee) System.out.println(數(shù) 據(jù) 庫 連 接 失 敗 !);ee.printStackTrace();/ 執(zhí)行數(shù)據(jù)庫查詢操作public static ResultS
10、et executeQuery(String sql) try if (conn = null)new BaseDao();return conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE).executeQuery(sql); / 執(zhí)行數(shù)據(jù)庫查詢 catch (SQLException e) e.printStackTrace();return null;/ 執(zhí)行數(shù)據(jù)庫更新操作public static int executeUpdate(String sql) try if (con
11、n = null)new BaseDao();return conn.createStatement().executeUpdate(sql); / 執(zhí)行數(shù)據(jù)庫更新 catch (SQLException e) System.out.println(錯(cuò)誤信息:+e.getMessage();return -1; finally public static void close() try conn.close(); catch (SQLException e) e.printStackTrace(); finally conn = null;主要功能實(shí)現(xiàn)3.2.1 職工信息錄入public c
12、lass StaffAdd extends JFrame private JPanel dialogPane;private JPanel contentPanel;private JLabel lb_id;private JTextField tf_id;private JLabel lb_name;private JTextField tf_name;private JLabel lb_type;private JComboBox cb_type;private JLabel lb_xueli;private JTextField tf_xueli;private JLabel lb_ad
13、dress;private JTextField tf_address;private JLabel lb_sex;private JTextField tf_sex;private JLabel lb_salary;private JTextField tf_salary;private JLabel lb_age;private JTextField tf_age;private JPanel buttonBar;private JButton btn_save;private JButton btn_close;public StaffAdd() initComponents();pri
14、vate void initComponents() dialogPane = new JPanel();contentPanel = new JPanel();lb_id = new JLabel();tf_id = new JTextField();lb_name = new JLabel();tf_name = new JTextField();lb_type = new JLabel();cb_type = new JComboBox(Constant.STAFF_TYPES);lb_xueli = new JLabel();tf_xueli = new JTextField();lb
15、_address = new JLabel();tf_address = new JTextField();lb_sex = new JLabel();tf_sex = new JTextField();lb_salary = new JLabel();tf_salary = new JTextField();lb_age = new JLabel();tf_age = new JTextField();buttonBar = new JPanel();btn_save = new JButton();btn_close = new JButton();setTitle(添加職工);setRe
16、sizable(false);Container contentPane = getContentPane();contentPane.setLayout(new BorderLayout();dialogPane.setBorder(new EmptyBorder(12, 12, 12, 12);dialogPane.setLayout(new BorderLayout();contentPanel.setLayout(new GridLayout(5, 4, 6, 6);lb_id.setText(職工號(hào):);lb_id.setHorizontalAlignment(SwingConsta
17、nts.RIGHT);contentPanel.add(lb_id);contentPanel.add(tf_id);lb_sex.setText(性別:);lb_sex.setHorizontalAlignment(SwingConstants.RIGHT);contentPanel.add(lb_sex);contentPanel.add(tf_sex);lb_name.setText(姓名:);lb_name.setHorizontalAlignment(SwingConstants.RIGHT);contentPanel.add(lb_name);contentPanel.add(tf
18、_name);lb_type.setText(任職類型:);lb_type.setHorizontalAlignment(SwingConstants.RIGHT);contentPanel.add(lb_type);contentPanel.add(cb_type);lb_xueli.setText(學(xué)歷:);lb_xueli.setHorizontalAlignment(SwingConstants.RIGHT);contentPanel.add(lb_xueli);contentPanel.add(tf_xueli);lb_salary.setText(工資:);lb_salary.se
19、tHorizontalAlignment(SwingConstants.RIGHT);contentPanel.add(lb_salary);contentPanel.add(tf_salary);lb_address.setText(地址:);lb_address.setHorizontalAlignment(SwingConstants.RIGHT);contentPanel.add(lb_address);contentPanel.add(tf_address);lb_age.setText(年齡:);lb_age.setHorizontalAlignment(SwingConstant
20、s.RIGHT);contentPanel.add(lb_age);contentPanel.add(tf_age);dialogPane.add(contentPanel, BorderLayout.CENTER);buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0);buttonBar.setLayout(new GridBagLayout();(GridBagLayout) buttonBar.getLayout().columnWidths = new int 0, 85, 80 ;(GridBagLayout) buttonBar.getL
21、ayout().columnWeights = new double 1.0, 0.0, 0.0 ;btn_save.setText(保存);btn_save.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e) btn_saveActionPerformed(e););buttonBar.add(btn_save, new GridBagConstraints(1, 0, 1, 1, 0.0,0.0, GridBagConstraints.CENTER,GridBagConstrai
22、nts.BOTH, new Insets(0, 0, 0, 5), 0, 0);btn_close.setText(關(guān)閉);btn_close.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e) btn_closeActionPerformed(e););buttonBar.add(btn_close, new GridBagConstraints(2, 0, 1, 1,0.0, 0.0, GridBagConstraints.CENTER,GridBagConstraints.BO
23、TH, new Insets(0, 0, 0, 0), 0, 0);dialogPane.add(buttonBar, BorderLayout.SOUTH);contentPane.add(dialogPane, BorderLayout.CENTER);setSize(625, 260);setLocationRelativeTo(getOwner();show();private void btn_saveActionPerformed(ActionEvent e) String id = tf_id.getText();String name = tf_name.getText();S
24、tring type = cb_type.getSelectedItem().toString();String xueli = tf_xueli.getText();String address = tf_address.getText();String sex = tf_sex.getText();String salary = tf_salary.getText();String age = tf_age.getText();String sql = insert into staff(id,name,type,xueli,address,sex,salary,age) values(+
25、 id+ ,+ name+ ,+ type+ ,+ xueli+ ,+ address + , + sex + , + salary + , + age + );int i = BaseDao.executeUpdate(sql);if (i = 1) JOptionPane.showMessageDialog(null, 添加成功);dispose();private void btn_closeActionPerformed(ActionEvent e) dispose();public class StaffUpdate extends JFrame private JPanel dia
26、logPane;private JPanel contentPanel;private JLabel lb_cx_id;private JTextField tf_cx_id;private JButton btn_query;private JLabel label12;private JLabel lb_id;private JTextField tf_id;private JLabel lb_name;private JTextField tf_name;private JLabel lb_type;private JComboBox cb_type;private JLabel lb_
27、xueli;private JTextField tf_xueli;private JLabel lb_address;private JTextField tf_address;private JLabel lb_sex;private JTextField tf_sex;private JLabel lb_salary;private JTextField tf_salary;private JLabel lb_age;private JTextField tf_age;private JPanel buttonBar;private JButton btn_save;private JB
28、utton btn_close;public StaffUpdate() initComponents();private void initComponents() dialogPane = new JPanel();contentPanel = new JPanel();lb_cx_id = new JLabel();tf_cx_id = new JTextField();btn_query = new JButton();label12 = new JLabel();lb_id = new JLabel();tf_id = new JTextField();lb_name = new J
29、Label();tf_name = new JTextField();lb_type = new JLabel();cb_type = new JComboBox(Constant.STAFF_TYPES);lb_xueli = new JLabel();tf_xueli = new JTextField();lb_address = new JLabel();tf_address = new JTextField();lb_sex = new JLabel();tf_sex = new JTextField();lb_salary = new JLabel();tf_salary = new
30、 JTextField();lb_age = new JLabel();tf_age = new JTextField();buttonBar = new JPanel();btn_save = new JButton();btn_close = new JButton();setTitle(修改職工信息);setResizable(false);Container contentPane = getContentPane();contentPane.setLayout(new BorderLayout();dialogPane.setBorder(new EmptyBorder(12, 12
31、, 12, 12);dialogPane.setLayout(new BorderLayout();contentPanel.setLayout(new GridLayout(6, 4, 6, 6);lb_cx_id.setText(職工號(hào):);lb_cx_id.setHorizontalAlignment(SwingConstants.RIGHT);contentPanel.add(lb_cx_id);contentPanel.add(tf_cx_id);btn_query.setText(查詢);btn_query.addActionListener(new ActionListener(
32、) public void actionPerformed(ActionEvent e) btn_queryActionPerformed(e););contentPanel.add(btn_query);label12.setText(text);label12.setVisible(false);contentPanel.add(label12);lb_id.setText(職工號(hào):);lb_id.setHorizontalAlignment(SwingConstants.RIGHT);contentPanel.add(lb_id);tf_id.setEditable(false);con
33、tentPanel.add(tf_id);lb_name.setText(姓名:);lb_name.setHorizontalAlignment(SwingConstants.RIGHT);contentPanel.add(lb_name);contentPanel.add(tf_name);lb_type.setText(任職類型:);lb_type.setHorizontalAlignment(SwingConstants.RIGHT);contentPanel.add(lb_type);contentPanel.add(cb_type);lb_xueli.setText(學(xué)歷:);lb_
34、xueli.setHorizontalAlignment(SwingConstants.RIGHT);contentPanel.add(lb_xueli);contentPanel.add(tf_xueli);lb_address.setText(地址:);lb_address.setHorizontalAlignment(SwingConstants.RIGHT);contentPanel.add(lb_address);contentPanel.add(tf_address);lb_sex.setText(性別:);lb_sex.setHorizontalAlignment(SwingCo
35、nstants.RIGHT);contentPanel.add(lb_sex);contentPanel.add(tf_sex);lb_salary.setText(工資:);lb_salary.setHorizontalAlignment(SwingConstants.RIGHT);contentPanel.add(lb_salary);contentPanel.add(tf_salary);lb_age.setText(年齡:);lb_age.setHorizontalAlignment(SwingConstants.RIGHT);contentPanel.add(lb_age);cont
36、entPanel.add(tf_age);dialogPane.add(contentPanel, BorderLayout.CENTER);buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0);buttonBar.setLayout(new GridBagLayout();(GridBagLayout) buttonBar.getLayout().columnWidths = new int 0, 85, 80 ;(GridBagLayout) buttonBar.getLayout().columnWeights = new double 1.0
37、, 0.0, 0.0 ;btn_save.setText(保存);btn_save.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e) btn_saveActionPerformed(e););buttonBar.add(btn_save, new GridBagConstraints(1, 0, 1, 1, 0.0,0.0, GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(0, 0, 0, 5), 0, 0
38、);btn_close.setText(關(guān)閉);btn_close.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e) btn_closeActionPerformed(e););buttonBar.add(btn_close, new GridBagConstraints(2, 0, 1, 1,0.0, 0.0, GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0);dial
39、ogPane.add(buttonBar, BorderLayout.SOUTH);contentPane.add(dialogPane, BorderLayout.CENTER);setSize(625, 260);setLocationRelativeTo(getOwner();show();private void btn_saveActionPerformed(ActionEvent e) / 獲取用戶輸入信息String id = tf_id.getText();String name = tf_name.getText();String type = cb_type.getSele
40、ctedItem().toString();String xueli = tf_xueli.getText();String address = tf_address.getText();String sex = tf_sex.getText();String salary = tf_salary.getText();String age = tf_age.getText();/ 拼接sqlString sql = update staff set name= + name + ,type= + type+ ,xueli= + xueli + ,address= + address + ,se
41、x=+ sex + ,salary= + Double.parseDouble(salary) + ,age=+ age + where id= + id + ;/ 執(zhí)行數(shù)據(jù)庫操作int i = BaseDao.executeUpdate(sql);if (i = 1) JOptionPane.showMessageDialog(null, 修改成功);dispose();private void btn_queryActionPerformed(ActionEvent e) String id = tf_cx_id.getText(); / 職工號(hào)Staff staff = StaffDao
42、.selectStaff(id); / 根據(jù)編號(hào)查詢職工信息/ 設(shè)置職工信息if (staff != null) tf_id.setText(staff.getId();tf_name.setText(staff.getName();cb_type.setSelectedItem(staff.getType();tf_xueli.setText(staff.getXueli();tf_address.setText(staff.getAddress();tf_sex.setText(staff.getSex();tf_salary.setText(String.valueOf(staff.ge
43、tSalary();tf_age.setText(String.valueOf(staff.getAge();private void btn_closeActionPerformed(ActionEvent e) dispose();public class StaffDelete extends JFrame private JPanel dialogPane;private JPanel contentPanel;private JLabel lb_cx_id;private JTextField tf_cx_id;private JButton btn_query;private JL
44、abel label12;private JLabel lb_id;private JTextField tf_id;private JLabel lb_name;private JTextField tf_name;private JLabel lb_type;private JComboBox cb_type;private JLabel lb_xueli;private JTextField tf_xueli;private JLabel lb_address;private JTextField tf_address;private JLabel lb_sex;private JTex
45、tField tf_sex;private JLabel lb_salary;private JTextField tf_salary;private JLabel lb_age;private JTextField tf_age;private JPanel buttonBar;private JButton btn_del;private JButton btn_close;public StaffDelete() initComponents();private void initComponents() dialogPane = new JPanel();contentPanel =
46、new JPanel();lb_cx_id = new JLabel();tf_cx_id = new JTextField();btn_query = new JButton();label12 = new JLabel();lb_id = new JLabel();tf_id = new JTextField();lb_name = new JLabel();tf_name = new JTextField();lb_type = new JLabel();cb_type = new JComboBox();lb_xueli = new JLabel();tf_xueli = new JT
47、extField();lb_address = new JLabel();tf_address = new JTextField();lb_sex = new JLabel();tf_sex = new JTextField();lb_salary = new JLabel();tf_salary = new JTextField();lb_age = new JLabel();tf_age = new JTextField();buttonBar = new JPanel();btn_del = new JButton();btn_close = new JButton();setTitle
48、(刪除職工);setResizable(false);Container contentPane = getContentPane();contentPane.setLayout(new BorderLayout();dialogPane.setBorder(new EmptyBorder(12, 12, 12, 12);dialogPane.setLayout(new BorderLayout();contentPanel.setLayout(new GridLayout(6, 4, 6, 6);lb_cx_id.setText(職工號(hào):);contentPanel.add(lb_cx_id
49、);contentPanel.add(tf_cx_id);btn_query.setText(查詢);btn_query.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e) btn_queryActionPerformed(e););contentPanel.add(btn_query);label12.setText(text);label12.setVisible(false);contentPanel.add(label12);lb_id.setText(職工號(hào):);lb_id
50、.setHorizontalAlignment(SwingConstants.RIGHT);contentPanel.add(lb_id);tf_id.setEditable(false);contentPanel.add(tf_id);lb_name.setText(姓名:);lb_name.setHorizontalAlignment(SwingConstants.RIGHT);contentPanel.add(lb_name);tf_name.setEditable(false);contentPanel.add(tf_name);lb_type.setText(任職類型:);lb_ty
51、pe.setHorizontalAlignment(SwingConstants.RIGHT);contentPanel.add(lb_type);cb_type.setEnabled(false);contentPanel.add(cb_type);lb_xueli.setText(學(xué)歷:);lb_xueli.setHorizontalAlignment(SwingConstants.RIGHT);contentPanel.add(lb_xueli);tf_xueli.setEnabled(false);contentPanel.add(tf_xueli);lb_address.setTex
52、t(地址:);lb_address.setHorizontalAlignment(SwingConstants.RIGHT);contentPanel.add(lb_address);tf_address.setEnabled(false);contentPanel.add(tf_address);lb_sex.setText(性別:);lb_sex.setHorizontalAlignment(SwingConstants.RIGHT);contentPanel.add(lb_sex);tf_sex.setEnabled(false);contentPanel.add(tf_sex);lb_
53、salary.setText(工資:);lb_salary.setHorizontalAlignment(SwingConstants.RIGHT);contentPanel.add(lb_salary);tf_salary.setEnabled(false);contentPanel.add(tf_salary);lb_age.setText(年齡:);lb_age.setHorizontalAlignment(SwingConstants.RIGHT);contentPanel.add(lb_age);tf_age.setEnabled(false);contentPanel.add(tf
54、_age);dialogPane.add(contentPanel, BorderLayout.CENTER);/ = buttonBar =buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0);buttonBar.setLayout(new GridBagLayout();(GridBagLayout) buttonBar.getLayout().columnWidths = new int 0, 85, 80 ;(GridBagLayout) buttonBar.getLayout().columnWeights = new double 1.0
55、, 0.0, 0.0 ;/ btn_del btn_del.setText(u5220u9664);btn_del.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e) btn_delActionPerformed(e););buttonBar.add(btn_del, new GridBagConstraints(1, 0, 1, 1, 0.0,0.0, GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(0,
56、0, 0, 5), 0, 0);/ btn_close btn_close.setText(u5173u95ed);btn_close.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e) btn_closeActionPerformed(e););buttonBar.add(btn_close, new GridBagConstraints(2, 0, 1, 1,0.0, 0.0, GridBagConstraints.CENTER,GridBagConstraints.BOTH,
57、new Insets(0, 0, 0, 0), 0, 0);dialogPane.add(buttonBar, BorderLayout.SOUTH);contentPane.add(dialogPane, BorderLayout.CENTER);setSize(625, 260);setLocationRelativeTo(getOwner();show();private void btn_queryActionPerformed(ActionEvent e) String id = tf_cx_id.getText();Staff staff = StaffDao.selectStaf
58、f(id);if (staff != null) tf_id.setText(staff.getId();tf_name.setText(staff.getName();cb_type.setSelectedItem(staff.getType();tf_xueli.setText(staff.getXueli();tf_address.setText(staff.getAddress();tf_sex.setText(staff.getSex();tf_salary.setText(String.valueOf(staff.getSalary();tf_age.setText(String.
59、valueOf(staff.getAge();private void btn_delActionPerformed(ActionEvent e) String id = tf_id.getText(); / 獲取職工編號(hào)String sql = delete from staff where id= + id + ; / 刪除指定編號(hào)的職工/ 執(zhí)行數(shù)據(jù)庫操作int i = BaseDao.executeUpdate(sql);if (i = 1) JOptionPane.showMessageDialog(null, 刪除成功);dispose();private void btn_clos
60、eActionPerformed(ActionEvent e) dispose();public class StaffUpdate extends JFrame private JPanel dialogPane;private JPanel contentPanel;private JLabel lb_cx_id;private JTextField tf_cx_id;private JButton btn_query;private JLabel label12;private JLabel lb_id;private JTextField tf_id;private JLabel lb
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025標(biāo)準(zhǔn)的小產(chǎn)權(quán)房屋買賣合同
- 中央2024年北京體育大學(xué)秋季招聘筆試歷年典型考點(diǎn)(頻考版試卷)附帶答案詳解
- 2024年科技成果轉(zhuǎn)化項(xiàng)目政府采購招標(biāo)合同3篇
- 國開《廣告學(xué)概論》學(xué)習(xí)活動(dòng)完成情況答案
- 2025二手房中介買賣合同
- 遺傳疾病基因調(diào)控機(jī)制-洞察分析
- 碳纖維強(qiáng)化人造板-洞察分析
- 虛擬現(xiàn)實(shí)編輯技術(shù)-洞察分析
- 云原生時(shí)代下的分布式SQL優(yōu)化-洞察分析
- 2024年02月浙江2024年浦發(fā)銀行杭州分行春季校園招考筆試歷年參考題庫附帶答案詳解
- 《零售藥店實(shí)務(wù)》期末考試復(fù)習(xí)題及答案
- 培訓(xùn)中心商業(yè)計(jì)劃書
- 2024版新能源汽車購置補(bǔ)貼及服務(wù)保障合同3篇
- 2025年上半年事業(yè)單位聯(lián)考內(nèi)蒙古自治區(qū)民政廳招聘3人準(zhǔn)考重點(diǎn)基礎(chǔ)提升(共500題)附帶答案詳解
- 2024年度云計(jì)算中心綜合布線合同5篇
- 2024-2025學(xué)年華東師大新版八年級(jí)上冊(cè)數(shù)學(xué)期末復(fù)習(xí)試卷(含詳解)
- 吉首大學(xué)《管理學(xué)》2023-2024學(xué)年第一學(xué)期期末試卷
- 《道路車輛 48V供電電壓的電氣及電子部件 電性能要求和試驗(yàn)方法》文本以及編制說明
- 《病理科(中心)建設(shè)與配置標(biāo)準(zhǔn)》
- 醫(yī)藥銷售主管市場規(guī)劃
- 測量應(yīng)急管理方案
評(píng)論
0/150
提交評(píng)論