課程設(shè)計考勤管理系統(tǒng)源代碼(共51頁)_第1頁
課程設(shè)計考勤管理系統(tǒng)源代碼(共51頁)_第2頁
課程設(shè)計考勤管理系統(tǒng)源代碼(共51頁)_第3頁
課程設(shè)計考勤管理系統(tǒng)源代碼(共51頁)_第4頁
課程設(shè)計考勤管理系統(tǒng)源代碼(共51頁)_第5頁
已閱讀5頁,還剩46頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

1、精選優(yōu)質(zhì)文檔-傾情為你奉上package kaoqin;import javax.swing.*;import java.awt.*;import java.awt.event.*;import java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet;import java.sql.SQLException;import java.sql.Statement;import java.sql.*;class AttendFrame extends JFrame/工作制類型public AttendFr

2、ame()this.setTitle("工作制類型");this.setVisible(true);this.setContentPane(new JPanel();this.setSize(300,200);create();private void create()JButton b1,b2,b3;Box box1,box2,box;b1=new JButton("非彈性工作制");b2=new JButton("彈性工作制");b3=new JButton("返回");box1=Box.createHoriz

3、ontalBox();box2=Box.createHorizontalBox();box=Box.createVerticalBox();box1.add(b1);box1.add(Box.createHorizontalStrut(20);box1.add(b2);box2.add(b3);box.add(box1);box.add(Box.createVerticalStrut(30);box.add(box2);this.add(box); b1.addActionListener(new ActionListener() / Override public void actionPe

4、rformed(ActionEvent e) / TODO 自動生成的方法存根 UBoundFrame frame=new UBoundFrame(); dispose(); ); b2.addActionListener(new ActionListener() / Override public void actionPerformed(ActionEvent e) / TODO 自動生成的方法存根 BoundFrame frame=new BoundFrame(); dispose(); ); b3.addActionListener(new ActionListener() / Ove

5、rride public void actionPerformed(ActionEvent e) / TODO 自動生成的方法存根 MFrame frame=new MFrame(); dispose(); );package kaoqin;import javax.swing.*;import java.awt.*;import java.awt.event.*;import java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet;import java.sql.SQLException;impo

6、rt java.sql.Statement;import java.sql.*;class BoundFrame extends JFramepublic BoundFrame()this.setTitle("彈性工作制");this.setVisible(true);this.setContentPane(new JPanel();this.setSize(400,400);create();JLabel k1,k2,k3,k4,k5,k6;JTextField f1,f2,f3,f4,f5,f6;Box box1,box2,box3,box4,box5,box;JBut

7、ton b1;private void create()k1=new JLabel("工號:");k2=new JLabel("姓名:");k3=new JLabel("當(dāng)月工時:");k4=new JLabel(":");k5=new JLabel("當(dāng)月工作天數(shù)");k6=new JLabel("當(dāng)月富余:");b1=new JButton("返回");f1=new JTextField(5);f2=new JTextField(5);f3=new J

8、TextField(5);f4=new JTextField(5);f5=new JTextField(5);f6=new JTextField(5);box1=Box.createHorizontalBox();box2=Box.createHorizontalBox();box3=Box.createHorizontalBox();box4=Box.createHorizontalBox();box5=Box.createHorizontalBox();box=Box.createVerticalBox();box1.add(k1);box1.add(f1);box1.add(Box.cr

9、eateHorizontalStrut(20);box1.add(k2);box1.add(f2);box2.add(k3);box2.add(f3);box2.add(k4);box2.add(f4);box3.add(k5);box3.add(f5);box4.add(k6);box4.add(f6);box5.add(b1);box.add(box1);box.add(Box.createVerticalStrut(20);box.add(box2);box.add(Box.createVerticalStrut(20);box.add(box3);box.add(Box.createV

10、erticalStrut(20);box.add(box4);box.add(Box.createVerticalStrut(20);box.add(box5);this.add(box);b1.addActionListener(new ActionListener() /確定 Override public void actionPerformed(ActionEvent e) / TODO 自動生成的方法存根 AttendFrame frame=new AttendFrame(); dispose(); );package kaoqin;import java.sql.Connectio

11、n;import java.sql.DriverManager;import java.sql.ResultSet;import java.sql.SQLException;import java.sql.Statement;public class ConnectionDB private String JDriver="sun.jdbc.odbc.JdbcOdbcDriver"private String sqlURL="jdbc:odbc:bobo"/private String JDriver="com.microsoft.sqlser

12、ver.jdbc.SQLServerDriver"/private String sqlURL="jdbc:sqlserver:/localhost:1433;DatabaseName=MyTest;integratedSecurity=TRUE;"private Connection connection;private Statement statement;private static Connection conn = null;private String tableSQL=new String4;public ConnectionDB()try Cla

13、ss.forName(JDriver);connection=DriverManager.getConnection(sqlURL);statement=connection.createStatement(); catch (ClassNotFoundException e) e.printStackTrace();catch (SQLException e) e.printStackTrace();public Connection getConnection()return connection;public Statement getStatement()return statemen

14、t;public void breakDB()try statement.close();connection.close(); catch (SQLException e) e.printStackTrace();public void createTable()tableSQL0="create table staff_info("+ "Sno char(9) primary key,"+ "Sname char(10) not null,"+ "Sage smallint,"+ "enter_tim

15、e char(10) not null,"+ "position char(10) not null,"+ "sex char(1),"+ "password char(6);"tableSQL1="create table pz_info("+ "arrive_hour char(2),"+ "arrive_minute char(2),"+ "leave_hour char(2),"+ "leave_minute char(2),&

16、quot;+ "everyday_time char(2);"tableSQL2="create table everymonth_statistics("+ "Sno char(9) not null,"+ "Sname char(10) not null,"+ "remain_time char(4),"+ "late_times smallint,"+ "early_leave smallint,"+ "work_day smallint,

17、"+ "primary key(Sno),"+ "foreign key(Sno)"+ "references staff_info(Sno) on delete cascade);"tableSQL3="create table everyday_statistics("+ "Sno char(9) not null,"+ "Sname char(10) not null,"+ "hour char(2),"+ "minute cha

18、r(2),"+ "action char(6),"+ "time char(4),"+ "primary key(Sno),"+ "foreign key(Sno)"+ "references staff_info(Sno) on delete cascade);" try for(int i=0;i<4;i+)statement.executeUpdate(tableSQLi); catch (SQLException e) e.printStackTrace();privat

19、e static ResultSet executeQuery(String sql) try if(conn=null)new ConnectionDB();return conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE).executeQuery(sql); catch (SQLException e) e.printStackTrace();return null; finally package kaoqin;import javax.swing.*;import java.a

20、wt.*;import java.awt.event.*;import java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet;import java.sql.SQLException;import java.sql.Statement;import java.sql.*;class Equ_Frame extends JFrame /配置信息public Equ_Frame()this.setTitle("配置信息");this.setSize(400,400);this.se

21、tContentPane(new JPanel();this.setVisible(true);this.create();JLabel k1,k2,k3,k4,k5,k6,k7,k8,k9,k10;JLabel f1,f2,f3,f4,f5,f6,f7,f8,f9,f10;Box box1,box2,box3,box4,box5,box6,box7,box;JButton b1,b2;private void create()k1=new JLabel("上班時間:");k2=new JLabel(":");k3=new JLabel("下班

22、時間:");k4=new JLabel(":");k5=new JLabel("每月工作總時間:");k6=new JLabel("每月工作天數(shù):");k7=new JLabel("每月工作日期:");k8=new JLabel("");k9=new JLabel("每月放假日期:");k10=new JLabel("");b1=new JButton("修改");b2=new JButton("返回");

23、f1=new JLabel("08");f2=new JLabel("30");f3=new JLabel("17");f4=new JLabel("30");f5=new JLabel("200");f6=new JLabel("22");f7=new JLabel("星期一");f8=new JLabel("星期五");f9=new JLabel("星期六");f10=new JLabel("星期日&q

24、uot;);box1=Box.createHorizontalBox();box2=Box.createHorizontalBox();box3=Box.createHorizontalBox();box4=Box.createHorizontalBox();box5=Box.createHorizontalBox();box6=Box.createHorizontalBox();box7=Box.createHorizontalBox();box=Box.createVerticalBox();box1.add(k1);box1.add(f1);box1.add(k2);box1.add(f

25、2);box2.add(k3);box2.add(f3);box2.add(k4);box2.add(f4);box3.add(k5);box3.add(f5);box4.add(k6);box4.add(f6);box5.add(k7);box5.add(f7);box5.add(k8);box5.add(f8);box6.add(k9);box6.add(f9);box6.add(k10);box6.add(f10);box7.add(b1);box7.add(Box.createHorizontalStrut(20);box7.add(b2);box.add(box1);box.add(

26、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);box.add(Box.createVerticalStrut(20);box.add(box6);box.add(Box.createVerticalStrut(20);box.add(box7);this.add

27、(box); b1.addActionListener(new ActionListener() /確定 Override public void actionPerformed(ActionEvent e) / TODO 自動生成的方法存根 EquAltFrame frame=new EquAltFrame(); dispose(); ); b2.addActionListener(new ActionListener() /確定 Override public void actionPerformed(ActionEvent e) / TODO 自動生成的方法存根 MFrame frame

28、=new MFrame(); dispose(); );package kaoqin;import javax.swing.*;import java.awt.*;import java.awt.event.*;import java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet;import java.sql.SQLException;import java.sql.Statement;import java.sql.*;class EquAltFrame extends JFrame /修改配置

29、信息public EquAltFrame()this.setTitle("修改配置信息");this.setSize(400,400);this.setContentPane(new JPanel();this.setVisible(true);this.create();JLabel k1,k2,k3,k4,k5,k6,k7,k8,k9,k10;JTextField f1,f2,f3,f4,f5,f6,f7,f8,f9,f10;Box box1,box2,box3,box4,box5,box6,box7,box;JButton b1,b2;private void cre

30、ate()k1=new JLabel("上班時間:");k2=new JLabel(":");k3=new JLabel("下班時間:");k4=new JLabel(":");k5=new JLabel("每月工作總時間:");k6=new JLabel("每月工作天數(shù):");k7=new JLabel("每月工作日期:");k8=new JLabel("");k9=new JLabel("每月放假日期:");k1

31、0=new JLabel("");b1=new JButton("保存");b2=new JButton("取消");f1=new JTextField(5);f2=new JTextField(5);f3=new JTextField(5);f4=new JTextField(5);f5=new JTextField(5);f6=new JTextField(5);f7=new JTextField(5);f8=new JTextField(5);f9=new JTextField(5);f10=new JTextField(5);

32、box1=Box.createHorizontalBox();box2=Box.createHorizontalBox();box3=Box.createHorizontalBox();box4=Box.createHorizontalBox();box5=Box.createHorizontalBox();box6=Box.createHorizontalBox();box7=Box.createHorizontalBox();box=Box.createVerticalBox();box1.add(k1);box1.add(f1);box1.add(k2);box1.add(f2);box

33、2.add(k3);box2.add(f3);box2.add(k4);box2.add(f4);box3.add(k5);box3.add(f5);box4.add(k6);box4.add(f6);box5.add(k7);box5.add(f7);box5.add(k8);box5.add(f8);box6.add(k9);box6.add(f9);box6.add(k10);box6.add(f10);box7.add(b1);box7.add(Box.createHorizontalStrut(20);box7.add(b2);box.add(box1);box.add(Box.cr

34、eateVerticalStrut(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);box.add(Box.createVerticalStrut(20);box.add(box6);box.add(Box.createVerticalStrut(20);box.add(box7);this.add(box);

35、 b1.addActionListener(new ActionListener() /確定 Override public void actionPerformed(ActionEvent e) / TODO 自動生成的方法存根 Equ_Frame in=new Equ_Frame(); EquAltFrame on=new EquAltFrame(); in.f1.setText(on.f1.getText(); in.f2.setText(on.f2.getText(); in.f3.setText(on.f3.getText(); in.f4.setText(on.f4.getText

36、(); in.f5.setText(on.f5.getText(); in.f6.setText(on.f6.getText(); in.f7.setText(on.f7.getText(); in.f8.setText(on.f8.getText(); in.f9.setText(on.f9.getText(); in.f10.setText(on.f10.getText(); ); b2.addActionListener(new ActionListener() /確定 Override public void actionPerformed(ActionEvent e) / TODO

37、自動生成的方法存根 Equ_Frame frame=new Equ_Frame(); dispose(); );package kaoqin;import javax.swing.*;import java.awt.*;import java.awt.event.*;import java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet;import java.sql.SQLException;import java.sql.Statement;import java.sql.*;class logi

38、n extends JFrame /管理員登陸界面 public login() this.setTitle("管理員登陸界面"); this.setSize(300,300); this.setContentPane(new JPanel(); this.setVisible(true); init(); JTextField jTextField1; JPasswordField jPasswordField1; private void init() JLabel jLabel1=new JLabel("管理員登陸"); JLabel jLabel

39、2=new JLabel("用戶名"); JLabel jLabel3=new JLabel("密碼"); jTextField1=new JTextField(10); jPasswordField1=new JPasswordField(10); JButton button1=new JButton("確定"); JButton button2=new JButton("取消"); JButton button3=new JButton("修改密碼"); Box box,box1,box2

40、,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.createHorizontalBox(); box3.add(jLabel3); box3.add(Box.createHorizont

41、alStrut(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(box1); box.add(Box.createVerticalStrut(20); box.add(box2); box

42、.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() Override public void actionPerformed(ActionEvent e) / TODO 自動生成的方法存根 / login im=new l

43、ogin(); Stringname=jTextField1.getText(),password=jPasswordField1.getText(); if(name.equals("admin")&&password.equals("") MFrame mi=new MFrame(); dispose(); else JOptionPane.showMessageDialog(new JFrame("WARNING"), "用戶名或密碼錯誤"); ); button2.addActionList

44、ener(new ActionListener() Override public void actionPerformed(ActionEvent e) / TODO 自動生成的方法存根 Main_login frame=new Main_login(); dispose(); ); button3.addActionListener(new ActionListener() Override public void actionPerformed(ActionEvent e) / TODO 自動生成的方法存根 MPwd f1=new MPwd(); dispose(); ); packag

45、e kaoqin;import javax.swing.*;import java.awt.*;import java.awt.event.*;import java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet;import java.sql.SQLException;import java.sql.Statement;import java.sql.*;class login1 extends JFrame /普通用戶登陸界面public login1()this.setTitle("

46、普通用戶登陸界面");this.setSize(300,300); this.setContentPane(new JPanel();this.setVisible(true); init(); JTextField jTextField1; JPasswordField jPasswordField1; private void init() JLabel jLabel1=new JLabel("員工登陸"); JLabel jLabel2=new JLabel("用戶名"); JLabel jLabel3=new JLabel("

47、密碼"); jTextField1=new JTextField(10); jPasswordField1=new JPasswordField(10); JButton button1=new JButton("確定"); JButton button2=new JButton("取消"); 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.createHoriz

溫馨提示

  • 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)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論