




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、數(shù)據(jù)庫原理及應(yīng)用課程設(shè)計報告題目:考勤管理系統(tǒng) -課程設(shè)計報告所在學(xué)院:信息工程學(xué)院班 級:計科1001學(xué) 號:10一三04127姓 名: 徐軍指導(dǎo)教師:陳才扣2012年1月4日目錄概述二、需求分析三、概念設(shè)計四、邏輯設(shè)計五、系統(tǒng)實現(xiàn)六、小結(jié)一、概述1.1系統(tǒng)開發(fā)的背景與意義1.1.1系統(tǒng)開發(fā)背景現(xiàn)在不論哪個企業(yè),都要進行考勤,考勤管理系統(tǒng)利用計算機管理考勤工作, 提高工作效率,一些企業(yè)在考勤管理方面用了大量的人力和財力,不說準確度和可信度如何,其效率很低,而且容易出錯,不利于管理。所以人工考勤已經(jīng)很難再滿足企業(yè)規(guī)范化管理的要求,隨著數(shù)據(jù)庫技術(shù)的發(fā)展和企業(yè)信息化建設(shè)的進行,使用計算機管理考勤成
2、為一種主流趨勢,它不僅為企業(yè)減少了人力財力的付出,而且也大大減輕了考勤工作人員的工作量。對于員工們的出勤率有個明顯的記錄,對于公司的職員也有基本了解根據(jù)出勤情況可以計算員工的實際工資。本文系統(tǒng)的闡述了企業(yè)考勤管理設(shè)計開發(fā)的全過程。包括系統(tǒng)需求調(diào)查分析,概念結(jié)構(gòu)設(shè)計,邏輯結(jié)構(gòu)設(shè)計等部分。1.1.2系統(tǒng)開發(fā)意義開發(fā)本系統(tǒng)的目的,就是要解決目前企業(yè)中關(guān)于員工出勤管理中所面臨的一系列問題。 考勤系統(tǒng)進行企業(yè)管理越來越適應(yīng)企業(yè)的需要,集信息的輸入,顯示,修改,刪除等各種處理,信息維護方便,給公司可以帶來很大的便利。開發(fā)出企業(yè)考勤管理系統(tǒng)能有效地提高企業(yè)辦事效率,解決目前員工出勤管理問題,實現(xiàn)員工請出勤信
3、息和缺勤信息對企業(yè)領(lǐng)導(dǎo)透明,使管理人員及時把握員工的情況,及時與員工溝通,提高生產(chǎn)質(zhì)量。二、需求分析作為一個考勤系統(tǒng)最重要的功能當數(shù)考勤了也就是能夠?qū)T工上班簽到的日期與時間記錄下來。當然記錄下簽到信息后,應(yīng)該具有其他的輔助功能比II1查詢員工某天的簽到情況”、”修改簽到情況”、”員工的維護”、”公司上班時間的設(shè)置”等下面就本系統(tǒng)完成的功能做一個簡單的需求分析。2.1系統(tǒng)功能要求2.1.1功能劃分(1)記錄每個員工每天所有進入公司的時刻和離開公司的時刻。(2)每天結(jié)束時自動統(tǒng)計當天的工作時間(3)每天結(jié)束時自動統(tǒng)計當天遲到或早退的次數(shù)。(4)對于彈性工作制,每天結(jié)束時自動統(tǒng)計當月的工時,并自動
4、算出當月欠缺或富余的時間(5)每個月末統(tǒng)計該月的工作時間判斷是否足夠(6)每個月末統(tǒng)計該月的工作天數(shù)并判斷是否足夠(7)管理人員查詢并修改工作時間(特殊情況下修改)(8)管理人員賬戶管理(如設(shè)置密碼等)(9)管理人員設(shè)定早退及遲到的條件,每個月的工作時間(10)管理人員設(shè)定每個月的工作日期及放假日期1.1.2 功能描述實際的管理和記錄工作非常需要快速獲知各個部門員工的每日出勤情況,以便于及時向高層管理者反映員工的出勤,缺勤情況。目前,由于負責(zé)考勤的員工,工作任務(wù)比較多,而且還都是重復(fù)數(shù)據(jù),讓工作者沒有辦法及時的向上報告。工作問題不能及時處理。針對以上的情況,我們提出企業(yè)考勤管理系統(tǒng),實現(xiàn)網(wǎng)上考
5、勤任務(wù),以減輕考勤人員的工作量。我公司準備開發(fā)員工考勤管理系統(tǒng),完成員工基本信息維護、企業(yè)的部門信息維護、企業(yè)基本考勤類型的維護、員工考勤的管理、員工考勤的查詢與分析。實現(xiàn)人事考勤的需要,包括員工遲到、早退的情況的記錄,在每個月底計算工資對員工和對員工進行績效評估的時候,對員工整個月的考勤記錄進行查詢和統(tǒng)計。2.2性能需求此工資管理系統(tǒng)對工資數(shù)據(jù)精度的計算能在默認情況之下精確到小數(shù)點后3位小數(shù),即是精確到分的計算。但在用戶使用過程中,能自行根據(jù)實際情況進行小數(shù)計算精度的設(shè)定,最大能允許保留小數(shù)點后5位的精度。在時間特性上,當用戶發(fā)出命令請求時的服務(wù)器的響應(yīng)時間、對數(shù)據(jù)更新處理、工資數(shù)據(jù)的查詢檢
6、索等上,同樣要求系統(tǒng)響應(yīng)時間不會超過0.5秒時間。系統(tǒng)支持多種操作系統(tǒng)的運行環(huán)境,多不同操作系統(tǒng),不同文件格式的磁盤上的數(shù)據(jù)均能實現(xiàn)信息的互通,及共享。2.3系統(tǒng)層次劃分考勤系統(tǒng)管理考勤系統(tǒng)管理管理系統(tǒng)整合系統(tǒng)考勤系統(tǒng)管理系統(tǒng)整合系統(tǒng)考勤系統(tǒng)記錄時刻統(tǒng)計工作時間統(tǒng)計工時統(tǒng)計遲到早退次數(shù)判斷工作時間足夠判斷工作天數(shù)足夠查詢修改工作時間設(shè)置密碼設(shè)定遲到早退條件設(shè)定工作放假日期記錄時刻統(tǒng)計工作時間統(tǒng)計工時統(tǒng)計遲到早退次數(shù)判斷工作時間足夠判斷工作天數(shù)足夠查詢修改工作時間設(shè)置密碼設(shè)定遲到早退條件設(shè)定工作放假日期2.4數(shù)據(jù)流圖頂層數(shù)據(jù)流圖數(shù)據(jù)庫操作數(shù)據(jù)庫操作操作數(shù)據(jù)系統(tǒng)操作管理信息考勤信息進入基本界面職工
7、信息配置管理管理員登陸員工考勤管理系統(tǒng)帳號和 核對密碼 查詢考勤統(tǒng)計管理員登陸員工考勤管理系統(tǒng)考勤統(tǒng)計密碼 錄入進出情況錄入進出情況錄入遲到情況錄入早退情況錄入工作時間情況刷卡員工進出時間信息 數(shù)據(jù)統(tǒng)計考勤管理分析數(shù)據(jù)進出記錄 遲到記錄早退記錄 時間記錄統(tǒng)計所有記錄的信息月度考勤統(tǒng)計管理員 工作日期及放假日期2.5數(shù)據(jù)字典(1),數(shù)據(jù)項描述數(shù)據(jù)項別名類型長度取值范圍 員工工號Snochar90000000至9999999員工姓名Snamechar10員工性別Ssexchar1“男”或“女”入職時間enter_timechar2000至2050員工年齡Sagesmallint20至70職位pos
8、itionChar10數(shù)據(jù)項描述表(2)數(shù)據(jù)結(jié)構(gòu)描述數(shù)據(jù)結(jié)構(gòu)說明組成員工信息是考勤管理子系統(tǒng)的主體數(shù)據(jù)結(jié)構(gòu),定義了一個員工的有關(guān)信息員工編號,員工姓名,員工性別,出生日期,職位,密碼部門信息是考勤管理子系統(tǒng)的主體數(shù)據(jù)結(jié)構(gòu),定義了一個部門的有關(guān)信息部門編號,部門名稱數(shù)據(jù)結(jié)構(gòu)描述(3)數(shù)據(jù)流描述數(shù)據(jù)流說明數(shù)據(jù)流來源數(shù)據(jù)流去向組成核對密碼根據(jù)不同人員相應(yīng)的權(quán)限登錄時的信息考勤管理系統(tǒng)管理員的帳號密碼與普通員工的帳號密碼完整的考勤數(shù)據(jù)員工的考勤數(shù)據(jù)月度考勤統(tǒng)計工資評估月度考勤編號、員工編號、日期、累計正常工作時間遲到次數(shù)、早退次數(shù)、曠工次數(shù)數(shù)據(jù)流描述(4)數(shù)據(jù)存儲數(shù)據(jù)存儲說明流入數(shù)據(jù)流流出數(shù)據(jù)流組成存
9、取方式月度考勤統(tǒng)計記錄員工每月的考勤情況一個月的信息統(tǒng)計統(tǒng)計好的考勤數(shù)據(jù)月度考勤編號、員工編號、日期、正常工作時間、遲到次數(shù)、早退次數(shù)、曠工次數(shù)更新,順序檢索數(shù)據(jù)存儲三、概念設(shè)計入職時間3.1概念模型入職時間員 工員 工員工號員工姓名員工號員工姓名職 位密 碼員工年齡員工性別職 位密 碼員工年齡員工性別員工屬性圖管理員號性 別管理員管理員號性 別管理員姓 名年 齡姓 名年 齡管理員屬性圖員工姓名員工姓名員工號員工號入職時間密 碼員 工入職時間密 碼員 工員工性別職 位員工性別職 位員工年齡員工年齡每天工作時間 m每天工作時間記錄上班的時 間記錄上班的時 間下班的時 間下班的時 間管理員號管理員
10、號姓 名 n姓 名統(tǒng)計 管理員剩余的時間 n統(tǒng)計 管理員剩余的時間遲到的次數(shù)遲到的次數(shù)年 齡年 齡性 別工作天數(shù)性 別工作天數(shù)早退的次數(shù)早退的次數(shù)四、邏輯設(shè)計4.1關(guān)系模式員工信息(工號,姓名,性別,年齡,職位,密碼,入職時間)記錄數(shù)據(jù)(工號,上班的小時,下班的小時,上班的分鐘,下班的分鐘,每天工作時間)統(tǒng)計數(shù)據(jù)(工號,剩余的時間,遲到的次數(shù),早退的次數(shù),工作天數(shù))管理員(管理員號,姓名,性別,年齡)每天統(tǒng)計信息表(工號,姓名,小時,分鐘,動作,時間) 其中動作指的時入或離開公司員工表(employee)列名別名類型長度備注工號Snochar9primary key員工姓名Snamechar1
11、0員工性別Ssexchar1年齡Sageint3職位Positionchar10密碼Passwordchar6入職時間Enter_timechar10員工表記錄數(shù)據(jù)表(data_record):列名別名類型長度備注員工號Snochar9primary key上班的小時arrive_hourchar2上班的分鐘arrive_minutechar4上班的小時leave_hourchar4下班的分鐘leave_minutechar4每天工作時間Everyday_timechar4記錄數(shù)據(jù)表每天統(tǒng)計信息表everyday_statistics列名別名類型長度備注員工號SnoChar9primary k
12、ey員工姓名SnameChar10時間HourChar2分鐘MinuteChar2動作Actionchar8時間Timechar4統(tǒng)計信息表月統(tǒng)計數(shù)據(jù)表(everymonth_statistics):列名別名類型長度備注員工號Snochar9primary key員工姓名SnameChar10剩余的時間remain_timechar4遲到的次數(shù)Late_timessmallint2早退的次數(shù)Early_timessmallint2工作天數(shù)Work_daysmallint2統(tǒng)計數(shù)據(jù)表管理員表(Administrator)列名別名類型長度備注管理員號anobigint6primary key姓名a
13、namechar20性別asexchar2年齡aageint3管理員表五、系統(tǒng)實現(xiàn)一、登陸界面package kaoqin;import javax.swing.*;import java.awt.*;import java.awt.event.*;import java.io.*;import java.sql.*;public class Main_login extends JFrame implements ActionListenerpublic Main_login()super(選擇用戶類型);this.setSize(300,300);this.setContentPane(n
14、ew JPanel();create();private void create()JButton b1,b2,b3;Box box1,box2,box3,box;b1=new JButton(系統(tǒng)管理員);b2=new JButton(普通用戶);b3=new JButton(退出登陸);b1.addActionListener(this);b2.addActionListener(this);b3.addActionListener(this);box1=Box.createHorizontalBox();box2=Box.createHorizontalBox();box3=Box.cr
15、eateHorizontalBox();box1.add(b1);box2.add(b2);box3.add(b3);box=Box.createVerticalBox();box.add(box1);box.add(Box.createVerticalStrut(20);box.add(box2);box.add(Box.createVerticalStrut(40);box.add(box3);this.add(box);public void actionPerformed(ActionEvent e)if(e.getActionCommand()=系統(tǒng)管理員)login frame=n
16、ew login();dispose();else if(e.getActionCommand()=普通用戶)login1 frame=new login1();dispose();else if(e.getActionCommand()=退出登陸)System.exit(0);public static void main(String args) /ConnectionDB myDB=new ConnectionDB();int flag=0; /判斷是否創(chuàng)建過數(shù)據(jù)庫的標志File file=new File(SQL.txt); try /讀入標志FileReader in=new Fil
17、eReader(file); int len;if(len=in.read()!=-1)flag=1; /已創(chuàng)建了數(shù)據(jù)庫,置1in.close(); catch (FileNotFoundException e) e.printStackTrace(); catch (IOException e) e.printStackTrace();/沒有創(chuàng)建過數(shù)據(jù)庫if(flag=0)ConnectionDB myDB=new ConnectionDB();myDB.createTable(); myDB.breakDB();try /寫入標志FileWriter out=new FileWriter(
18、file);out.write(1);out.close(); catch (IOException e) e.printStackTrace(); Main_login frame1=new Main_login(); frame1.setVisible(true); 二、管理員登陸界面classloginextends JFrame/管理員登陸界面public login() this.setTitle(管理員登陸界面);this.setSize(300,300);this.setContentPane(new JPanel();this.setVisible(true); init();
19、 JTextField jTextField1; JPasswordField jPasswordField1;privatevoid init() JLabel jLabel1=new JLabel(管理員登陸); JLabel jLabel2=new JLabel(用戶名); JLabel jLabel3=new JLabel(密碼);jTextField1=new JTextField(10);jPasswordField1=new JPasswordField(10); JButton button1=new JButton(確定); JButton button2=new JButt
20、on(取消); JButton button3=new JButton(修改密碼); Box box,box1,box2,box3,box4,box5; box1=Box.createHorizontalBox(); box1.add(jLabel1); box1.add(Box.createHorizontalStrut(10); box2=Box.createHorizontalBox(); box2.add(jLabel2); box2.add(Box.createHorizontalStrut(20); box2.add(jTextField1); box3=Box.createHor
21、izontalBox(); box3.add(jLabel3); box3.add(Box.createHorizontalStrut(20); box3.add(jPasswordField1); box4=Box.createHorizontalBox(); box4.add(button1); box4.add(Box.createHorizontalStrut(20); box4.add(button2); box5=Box.createHorizontalBox(); box5.add(button3); box=Box.createVerticalBox(); box.add(bo
22、x1); box.add(Box.createVerticalStrut(20); box.add(box2); box.add(Box.createVerticalStrut(20); box.add(box3); box.add(Box.createVerticalStrut(20); box.add(box4); box.add(Box.createVerticalStrut(20); box.add(box5);this.add(box); button1.addActionListener(new ActionListener() xOverridepublicvoid action
23、Performed(ActionEvent e) / TODO自動生成的方法存根/ login im=new login(); Stringname=jTextField1.getText(),password=jPasswordField1.getText();if(name.equals(admin)&password.equals(123456) MFrame mi=new MFrame(); dispose(); else JOptionPane.showMessageDialog(new JFrame(WARNING), 用戶名或密碼錯誤); ); button2.addAction
24、Listener(new ActionListener() xOverridepublicvoid actionPerformed(ActionEvent e) / TODO 自動生成的方法存根 Main_login frame=new Main_login(); dispose(); ); button3.addActionListener(new ActionListener() xOverridepublicvoid actionPerformed(ActionEvent e) / TODO 自動生成的方法存根 MPwd f1=new MPwd(); dispose(); ); 三、主功
25、能界面classMFrameextends JFrame /主功能界面public MFrame() this.setTitle(主要功能);this.setContentPane(new JPanel();this.setSize(350,200);this.setVisible(true); init(); privatevoid init() JButton button1=new JButton(員工信息管理); JButton button2=new JButton(員工出勤信息); JButton button3=new JButton(配置信息); JButton button4
26、=new JButton(退出登陸);Box box1=Box.createHorizontalBox();Box box2=Box.createHorizontalBox();Box box3=Box.createVerticalBox(); box1.add(button1); box1.add(Box.createHorizontalStrut(10); box1.add(button2); box1.add(Box.createHorizontalStrut(10); box1.add(button3); box2.add(button4); box3.add(box1); box3.
27、add(Box.createVerticalStrut(30); box3.add(box2);this.add(box3); button1.addActionListener(new ActionListener() / xOverridepublicvoid actionPerformed(ActionEvent e) / TODO 自動生成的方法存根 Worker_Frame frame=new Worker_Frame(); dispose(); ); button2.addActionListener(new ActionListener() / xOverridepublicvo
28、id actionPerformed(ActionEvent e) / TODO 自動生成的方法存根 AttendFrame frame=new AttendFrame(); dispose(); ); button3.addActionListener(new ActionListener() / xOverridepublicvoid actionPerformed(ActionEvent e) / TODO 自動生成的方法存根 Equ_Frame frame=new Equ_Frame(); dispose(); ); button4.addActionListener(new Acti
29、onListener() / xOverridepublicvoid actionPerformed(ActionEvent e) / TODO 自動生成的方法存根 Main_login frame=new Main_login(); dispose(); ); 四、員工信息管理classWorker_Frameextends JFrame /員工信息管理public Worker_Frame()this.setTitle(員工信息管理);this.setVisible(true);this.setSize(400,400);init();JButton button1,button2,but
30、ton3,button4,button5;privatevoid init()button1=new JButton(員工信息添加);button2=new JButton(員工信息修改);button3=new JButton(員工信息刪除);button4=new JButton(員工信息查詢);button5=new JButton(返回);Box box1=Box.createHorizontalBox();Box box2=Box.createHorizontalBox();Box box4=Box.createHorizontalBox();Box box3=Box.createV
31、erticalBox();box1.add(button1);box1.add(Box.createHorizontalStrut(20);box1.add(button2);box2.add(button3);box2.add(Box.createHorizontalStrut(20);box2.add(button4);box4.add(button5);box3.add(box1);box3.add(box2);box3.add(Box.createVerticalStrut(30);box3.add(box4);this.add(box3);button1.addActionListe
32、ner(new ActionListener() /添加員工信息 xOverridepublicvoid actionPerformed(ActionEvent e) / TODO 自動生成的方法存根 WoAddFrame frame=new WoAddFrame(); dispose(); );button2.addActionListener(new ActionListener() /修改員工信息 xOverridepublicvoid actionPerformed(ActionEvent e) / TODO 自動生成的方法存根 WoAltFrame frame=newWoAltFra
33、me(); dispose(); );button3.addActionListener(new ActionListener() /刪除員工信息 xOverridepublicvoid actionPerformed(ActionEvent e) / TODO 自動生成的方法存根 WoDelFrame frame=new WoDelFrame(); dispose(); );button4.addActionListener(new ActionListener() /查詢員工信息 xOverridepublicvoid actionPerformed(ActionEvent e) / TO
34、DO 自動生成的方法存根 WoSerFrame frame=new WoSerFrame(); dispose(); );button5.addActionListener(new ActionListener() /返回 xOverridepublicvoid actionPerformed(ActionEvent e) / TODO 自動生成的方法存根 MFrame frame=new MFrame(); dispose(); );五、添加員工classWoAddFrameextends JFrame/添加員工private ConnectionDB myCon=new Connectio
35、nDB();private JButton YesBtn,NoBtn;privatestatic JTextField woName,woNo,woAge,woYear,woPosition,woSex,woPassword;private JLabel woNameLabel,woNoLabel,woAgeLabel,woYearLabel,woPositionLabel,woSexLabel,woPasswordLabel;/提示區(qū)privatestatic Font font=new Font(楷體,Font.BOLD,14);public WoAddFrame()this.setTit
36、le(添加員工);this.setBounds(200, 200, 400, 300);this.setLayout(null);this.setResizable(false);this.setVisible(true);this.addCompnents();this.add(getwoName();this.add(getwoNo();this.add(getwoAge();this.add(getwoYear();this.add(getwoPosition();this.add(getwoSex();this.add(getwoPassword(); privatevoid addC
37、ompnents() woNameLabel=new JLabel(員工姓名:);woNameLabel.setFont(font);woNameLabel.setBounds(70, 10, 70, 20);this.add(woNameLabel);woNoLabel=new JLabel(員工編號:);woNoLabel.setFont(font);woNoLabel.setBounds(70, 30, 70, 20);this.add(woNoLabel);woAgeLabel=new JLabel(員工年齡:);woAgeLabel.setFont(font);woAgeLabel.
38、setBounds(70, 50, 70, 20);this.add(woAgeLabel);woYearLabel=new JLabel(入職時間:);woYearLabel.setFont(font);woYearLabel.setBounds(70, 70, 70, 20);this.add(woYearLabel);woPositionLabel=new JLabel(員工職位:);woPositionLabel.setFont(font);woPositionLabel.setBounds(70, 90, 70, 20);this.add(woPositionLabel);woSex
39、Label=new JLabel(員工性別:);woSexLabel.setFont(font);woSexLabel.setBounds(70,110,70, 20);this.add(woSexLabel);woPasswordLabel=new JLabel(員工密碼:);woPasswordLabel.setFont(font);woPasswordLabel.setBounds(70, 一三0, 70, 20);this.add(woPasswordLabel);YesBtn = new JButton(確定);YesBtn.setFont(font);YesBtn.setBound
40、s(100,一八0,70, 20);this.add(YesBtn);NoBtn = new JButton(取消);NoBtn.setFont(font);NoBtn.setBounds(一八0,一八0,70, 20);NoBtn.addActionListener(new ActionListener() xOverridepublicvoid actionPerformed(ActionEvent e) / TODO 自動生成的方法存根 Worker_Frame frame=new Worker_Frame(); dispose(); );this.add(NoBtn);YesBtn.a
41、ddActionListener(new ActionListener() /添加確認按鈕響應(yīng) xOverridepublicvoid actionPerformed(ActionEvent e) / TODO 自動生成的方法存根 String sql=insert into staff_info(Sno,Sname,Sage,enter_time,position,sex,password)values(+woNo.getText()+, +woName.getText()+,+woAge.getText()+,+woYear.getText()+,+woPosition.getText()
42、+,+woSex.getText()+,+woPassword.getText()+);try myCon.getStatement().executeUpdate(sql);myCon.breakDB(); catch (SQLException e1) e1.printStackTrace(); OperatSFrame frame=new OperatSFrame(); ); publicstatic JTextField getwoName() if(woName=null)woName=new JTextField();woName.setBounds(一五0,10,一五0,20);
43、woName.setFont(font);woName.setForeground(Color.blue); returnwoName; publicstatic JTextField getwoNo() if(woNo=null)woNo=new JTextField();woNo.setBounds(一五0,30,一五0,20);woNo.setFont(font);woNo.setForeground(Color.blue); returnwoNo; publicstatic JTextField getwoAge() if(woAge=null)woAge=new JTextField
44、();woAge.setBounds(一五0,50,一五0,20);woAge.setFont(font);woAge.setForeground(Color.blue); returnwoAge; publicstatic JTextField getwoYear() if(woYear=null)woYear=new JTextField();woYear.setBounds(一五0,70,一五0,20);woYear.setFont(font);woYear.setForeground(Color.blue); returnwoYear; publicstatic JTextField
45、getwoPosition() if(woPosition=null)woPosition=new JTextField();woPosition.setBounds(一五0,90,一五0,20);woPosition.setFont(font);woPosition.setForeground(Color.blue); returnwoPosition; publicstatic JTextField getwoSex() if(woSex=null)woSex=new JTextField();woSex.setBounds(一五0,110,一五0,20);woSex.setFont(fo
46、nt);woSex.setForeground(Color.blue); returnwoSex; publicstatic JTextField getwoPassword() if(woPassword=null)woPassword=new JTextField();woPassword.setBounds(一五0,一三0,一五0,20);woPassword.setFont(font);woPassword.setForeground(Color.blue); returnwoPassword; 六、刪除員工classWoDelFrameextends JFrameprivate Co
47、nnectionDB myCon=new ConnectionDB();private JButton YesBtn,NoBtn;private JLabel woNoLabel;privatestatic JTextField woNo;privatestatic Font font=new Font(楷體,Font.BOLD,14);public WoDelFrame() this.setTitle(刪除員工);this.setSize(400,400);this.setLayout(null);this.setResizable(false);this.setVisible(true);
48、this.addCompnents();this.add(getwoNo(); privatevoid addCompnents() woNoLabel=new JLabel(員工編號:);woNoLabel.setFont(font);woNoLabel.setBounds(100, 80, 70, 20);this.add(woNoLabel);YesBtn = new JButton(確定);YesBtn.setFont(font);YesBtn.setBounds(一三0,一五0,80, 30);this.add(YesBtn);NoBtn = new JButton(取消);NoBt
49、n.setFont(font);NoBtn.setBounds(220,一五0,80, 30);this.add(NoBtn);NoBtn.addActionListener(new ActionListener() xOverridepublicvoid actionPerformed(ActionEvent e) / TODO 自動生成的方法存根 Worker_Frame frame=new Worker_Frame(); dispose(); );YesBtn.addActionListener(new ActionListener() /添加確認按鈕響應(yīng) xOverridepublic
50、void actionPerformed(ActionEvent e) / TODO 自動生成的方法存根 String sql=delete from staff_info where Sno=+woNo.getText()+;try myCon.getStatement().executeUpdate(sql);myCon.breakDB(); catch (SQLException e1) e1.printStackTrace(); OperatSFrame frame=new OperatSFrame(); ); publicstatic JTextField getwoNo() if(
51、woNo=null)woNo=new JTextField();woNo.setBounds(一八0,80,一五0,20);woNo.setFont(font);woNo.setForeground(Color.blue); returnwoNo; 七、刪除員工classWoSerFrameextends JFrame/管理員查詢private ConnectionDB myCon=new ConnectionDB();private JButton YesBtn,NoBtn;privatestatic JTextField woName,woNo,woAge,woYear,woPositio
52、n,woSex,woPassword;private JLabel woNameLabel,woNoLabel,woAgeLabel,woYearLabel,woPositionLabel,woSexLabel,woPasswordLabel;/提示區(qū)privatestatic Font font=new Font(楷體,Font.BOLD,14);public WoSerFrame() this.setTitle(查詢員工);this.setSize(400,600);this.setLayout(null);this.setResizable(false);this.setVisible(
53、true);this.addCompnents();this.add(getwoNo();this.add(getwoName();this.add(getwoAge();this.add(getwoYear();this.add(getwoPosition();this.add(getwoSex();this.add(getwoPassword(); privatevoid addCompnents() woNameLabel=new JLabel(姓名:);woNameLabel.setFont(font);woNameLabel.setBounds(100, 120, 60, 20);t
54、his.add(woNameLabel);woNoLabel=new JLabel(編號:);woNoLabel.setFont(font);woNoLabel.setBounds(100, 10, 60, 20);this.add(woNoLabel);woAgeLabel=new JLabel(年齡:);woAgeLabel.setFont(font);woAgeLabel.setBounds(100, 160, 70, 20);this.add(woAgeLabel);woYearLabel=new JLabel(時間:);woYearLabel.setFont(font);woYear
55、Label.setBounds(100, 200, 70, 20);this.add(woYearLabel);woPositionLabel=new JLabel(職位:);woPositionLabel.setFont(font);woPositionLabel.setBounds(100, 240, 70, 20);this.add(woPositionLabel);woSexLabel=new JLabel(性別:);woSexLabel.setFont(font);woSexLabel.setBounds(100,280,70, 20);this.add(woSexLabel);wo
56、PasswordLabel=new JLabel(密碼:);woPasswordLabel.setFont(font);woPasswordLabel.setBounds(100, 320, 70, 20);this.add(woPasswordLabel);YesBtn = new JButton(確定);YesBtn.setFont(font);YesBtn.setBounds(一三0,50,80, 30);this.add(YesBtn);NoBtn = new JButton(取消);NoBtn.setFont(font);NoBtn.setBounds(220,50,80, 30);
57、this.add(NoBtn);NoBtn.addActionListener(new ActionListener() xOverridepublicvoid actionPerformed(ActionEvent e) / TODO 自動生成的方法存根 Worker_Frame frame=new Worker_Frame(); dispose(); );YesBtn.addActionListener(new ActionListener() /添加確認按鈕響應(yīng) xOverridepublicvoid actionPerformed(ActionEvent e) / TODO 自動生成的方法存根 Connection con=myCon.getConnection();try PreparedStatement ps=con.p
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 護理質(zhì)控整改措施風(fēng)險評估
- 語言文字工作領(lǐng)導(dǎo)小組職責(zé)法制保障研究
- 科研項目質(zhì)量保障2025年工作計劃
- 腫瘤醫(yī)院醫(yī)務(wù)科職責(zé)他
- 青藍工程徒弟骨干成長計劃
- 音樂學(xué)專業(yè)實習(xí)總結(jié)范文
- 2025年行政人事部崗位競聘計劃
- 以建構(gòu)主義重塑語文閱讀課堂:理論、實踐與創(chuàng)新發(fā)展
- 以實驗為翼:物理教學(xué)中實驗?zāi)芰ε囵B(yǎng)的探索與實踐
- 以實證探究篇章認知分析法在大學(xué)英語精讀教學(xué)中的應(yīng)用與成效
- 新人教版九年級物理全冊知識點總結(jié)(課堂筆記)
- DB13T 5519.7-2022 軌道交通AFC系統(tǒng)線網(wǎng)技術(shù)要求 第7部分:數(shù)據(jù)接口
- 駐戈壁某部隊糖尿病流行病學(xué)調(diào)查
- 《網(wǎng)店運營與管理》整本書電子教案全套教學(xué)教案
- GB 27954-2020 黏膜消毒劑通用要求
- 中考《紅星照耀中國》各篇章練習(xí)題及答案(1-12)
- (完整版)ECRS培訓(xùn)課件
- 外輪理貨工作英語
- 河流改道施工方案
- 技術(shù)規(guī)格書Word版
- 《醫(yī)療機構(gòu)使用統(tǒng)一的〈北京地區(qū)醫(yī)療機構(gòu)門急診病歷手冊〉有關(guān)規(guī)
評論
0/150
提交評論