课程设计考勤管理系统源代码Word格式.docx
《课程设计考勤管理系统源代码Word格式.docx》由会员分享,可在线阅读,更多相关《课程设计考勤管理系统源代码Word格式.docx(81页珍藏版)》请在冰点文库上搜索。
返回”);
box1=Box。
createHorizontalBox();
box2=Box.createHorizontalBox();
box=Box。
createVerticalBox();
box1。
add(b1);
box1.add(Box。
createHorizontalStrut(20));
box1.add(b2);
box2.add(b3);
box。
add(box1);
add(Box。
createVerticalStrut(30));
add(box2);
add(box);
b1.addActionListener(newActionListener()//
@Override
publicvoidactionPerformed(ActionEvente)
//TODO自动生成的方法存根
UBoundFrameframe=newUBoundFrame();
dispose();
});
b2。
addActionListener(newActionListener()//
@Override
BoundFrameframe=newBoundFrame();
dispose();
}
});
b3。
MFrameframe=newMFrame();
}
swing.*;
awt.*;
awt.event.*;
Connection;
importjava.sql.DriverManager;
importjava.sql.ResultSet;
sql.Statement;
*;
classBoundFrameextendsJFrame
publicBoundFrame()
this.setTitle("
this.setVisible(true);
this.setContentPane(newJPanel());
this.setSize(400,400);
JLabelk1,k2,k3,k4,k5,k6;
JTextFieldf1,f2,f3,f4,f5,f6;
Boxbox1,box2,box3,box4,box5,box;
JButtonb1;
k1=newJLabel(”工号:
"
k2=newJLabel("
姓名:
”);
k3=newJLabel("
当月工时:
);
k4=newJLabel(”:
k5=newJLabel(”当月工作天数”);
k6=newJLabel("
当月富余:
f1=newJTextField(5);
f2=newJTextField(5);
f3=newJTextField(5);
f4=newJTextField(5);
f5=newJTextField(5);
f6=newJTextField(5);
box2=Box.createHorizontalBox();
box3=Box.createHorizontalBox();
box4=Box。
createHorizontalBox();
box5=Box。
createVerticalBox();
box1.add(k1);
box1.add(f1);
add(Box.createHorizontalStrut(20));
box1.add(k2);
add(f2);
box2。
add(k3);
box2.add(f3);
add(k4);
add(f4);
box3.add(k5);
box3。
add(f5);
box4.add(k6);
box4.add(f6);
box5。
box.add(box1);
box.add(Box。
createVerticalStrut(20));
box.add(box2);
box.add(Box.createVerticalStrut(20));
box.add(box3);
add(Box.createVerticalStrut(20));
add(box4);
createVerticalStrut(20));
add(box5);
b1。
addActionListener(newActionListener()//确定
AttendFrameframe=newAttendFrame();
});
sql.DriverManager;
importjava.sql.SQLException;
publicclassConnectionDB{
privateStringJDriver=”sun.jdbc。
odbc。
JdbcOdbcDriver"
;
privateStringsqlURL=”jdbc:
odbc:
bobo”;
//privateStringJDriver="
com。
microsoft.sqlserver.jdbc。
SQLServerDriver”;
//privateStringsqlURL=”jdbc:
sqlserver:
//localhost:
1433;
DatabaseName=MyTest;
integratedSecurity=TRUE;
privateConnectionconnection;
privateStatementstatement;
privatestaticConnectionconn=null;
privateString[]tableSQL=newString[4];
publicConnectionDB(){
try{
Class.forName(JDriver);
connection=DriverManager.getConnection(sqlURL);
statement=connection。
createStatement();
}catch(ClassNotFoundExceptione){
e。
printStackTrace();
}catch(SQLExceptione){
e.printStackTrace();
}
publicConnectiongetConnection(){
returnconnection;
publicStatementgetStatement(){
returnstatement;
publicvoidbreakDB(){
try{
statement.close();
connection。
close();
}catch(SQLExceptione){
publicvoidcreateTable(){
tableSQL[0]=”createtablestaff_info(”+
"
Snochar(9)primarykey,”+
"
Snamechar(10)notnull,”+
Sagesmallint,”+
”enter_timechar(10)notnull,"
+
”positionchar(10)notnull,”+
”sexchar
(1),”+
passwordchar(6));
”;
tableSQL[1]="
createtablepz_info("
arrive_hourchar
(2),”+
”arrive_minutechar
(2),"
”leave_hourchar
(2),"
leave_minutechar
(2),"
”everyday_timechar
(2));
”;
tableSQL[2]=”createtableeverymonth_statistics(”+
”Snochar(9)notnull,”+
”Snamechar(10)notnull,”+
”remain_timechar(4),”+
late_timessmallint,"
”early_leavesmallint,"
”work_daysmallint,"
”primarykey(Sno),”+
”foreignkey(Sno)”+
”referencesstaff_info(Sno)ondeletecascade);
tableSQL[3]=”createtableeveryday_statistics("
Snochar(9)notnull,”+
”Snamechar(10)notnull,"
hourchar
(2),”+
”minutechar
(2),”+
actionchar(6),”+
”timechar(4),”+
primarykey(Sno),”+
”foreignkey(Sno)"
;
try{
for(inti=0;
i〈4;
i++)
statement。
executeUpdate(tableSQL[i]);
}catch(SQLExceptione){
e。
}
privatestaticResultSetexecuteQuery(Stringsql){
try{
if(conn==null)
newConnectionDB();
returnconn。
createStatement(ResultSet。
TYPE_SCROLL_SENSITIVE,ResultSet。
CONCUR_UPDATABLE).executeQuery(sql);
}catch(SQLExceptione){
e。
printStackTrace();
returnnull;
}finally{
}
packagekaoqin;
swing.*;
awt。
*;
event。
sql.Connection;
ResultSet;
sql.SQLException;
classEqu_FrameextendsJFrame//配置信息
{
publicEqu_Frame()
setTitle("
配置信息”);
setSize(400,400);
setVisible(true);
this.create();
JLabelk1,k2,k3,k4,k5,k6,k7,k8,k9,k10;
JLabelf1,f2,f3,f4,f5,f6,f7,f8,f9,f10;
Boxbox1,box2,box3,box4,box5,box6,box7,box;
JButtonb1,b2;
k1=newJLabel(”上班时间:
k2=newJLabel(”:
下班时间:
k4=newJLabel("
:
k5=newJLabel(”每月工作总时间:
每月工作天数:
k7=newJLabel(”每月工作日期:
k8=newJLabel("
~"
k9=newJLabel("
每月放假日期:
k10=newJLabel("
b1=newJButton(”修改"
b2=newJButton(”返回”);
f1=newJLabel("
08"
f2=newJLabel("
30”);
f3=newJLabel(”17"
f4=newJLabel(”30”);
f5=newJLabel("
200"
f6=newJLabel(”22"
f7=newJLabel(”星期一"
f8=newJLabel(”星期五”);
f9=newJLabel("
星期六”);
f10=newJLabel("
星期日”);
box2=Box。
box5=Box.createHorizontalBox();
box6=Box。
box7=Box.createHorizontalBox();
box=Box.createVerticalBox();
add(k1);
box1.add(f1);
add(k2);
box1.add(f2);
box2.add(k3);
add(f3);
box2.add(k4);
add(k5);
box4.add(k6);
box4。
add(f6);
box5.add(k7);
box5.add(f7);
box5.add(k8);
box5.add(f8);
box6。
add(k9);
box6.add(f9);
add(k10);
add(f10);
box7.add(b1);
box7.add(Box。
createHorizontalStrut(20));
box7.add(b2);
add(box4);
add(box6);
box.add(Box.createVerticalStrut(20));
box.add(box7);
this.add(box);
EquAltFrameframe=newEquAltFrame();
b2.addActionListener(newActionListener()//确定
});
importjava.awt.*;
importjava.awt.event.*;
importjava.sql.DriverManager;
ResultSet;
sql.SQLException;
sql.Statement;
classEquAltFrameextendsJFrame//修改配置信息
publicEquAltFrame()
修改配置信息”);
setSize(400,400);
setContentPane(newJPanel());
create();
JLabelk1,k2,k3,k4,k5,k6,k7,k8,k9,k10;
JTextFieldf1,f2,f3,f4,f5,f6,f7,f8,f9,f10;
Boxbox1,box2,box3,box4,box5,box6,box7,box;
JButtonb1,b2;
k1=newJLabel("
上班时间:
”);
k3=newJLabel(”下班时间:
k4=newJLabel(”:
k5=newJLabel("
每月工作总时间:
k7=newJLabel(”每月工作日期:
k8=newJLabel(”~"
k9=newJLabel(”每月放假日期:
~”);
b1=newJButton(”保存”);
取消”);
f5=newJTextField(5);
f7=newJTextField(5);
f8=newJTextField(5);
f9=newJTextField(5);
f10=newJTextField(5);
box1=Box.createHorizontalBox();
box2=Box.create