OAS设计文档新1文档格式.docx
《OAS设计文档新1文档格式.docx》由会员分享,可在线阅读,更多相关《OAS设计文档新1文档格式.docx(23页珍藏版)》请在冰豆网上搜索。
•查看公告
•考勤管理(设置上下班时间,管理员工的签到、签退等)
•系统设置(设置个人密码,为系统设置新的管理员等)
•部门管理(编辑新增加的部门以及部门信息的维护工作)
【普通用户】
•个人操作(包括查看系统公告,修改个人登录密码)
•考勤签到(完成个人考勤,即签到和签退功能的实现)
•查看系统公告
•上下班签到时间设置
•上下班签到功能
•密码重置功能
•添加新管理员设置
•新建部门功能
•更新部门信息
四、系统流程图
五、系统模块划分
【模块划分】
登录模块
员工管理模块
管理员和普通员工模块
数据维护模块
上班签到的查询
部门增删信息更新模块
六、数据库设计
数据库中存在8个表单分别如下:
七、详细设计及实现
1.连接数据库:
Web.configue:
<
appSettings>
addkey="
conStr"
value="
Server=LJJ-PC\LJJ;
database=company;
Uid=sa;
Pwd=941212"
/>
/appSettings>
BaseClass这个实现连接的类:
usingSystem;
usingSystem.Data;
usingSystem.Configuration;
usingSystem.Web;
usingSystem.Web.Security;
usingSystem.Web.UI;
usingSystem.Web.UI.WebControls;
usingSystem.Web.UI.WebControls.WebParts;
usingSystem.Web.UI.HtmlControls;
usingSystem.Data.SqlClient;
usingSystem.Collections;
///<
summary>
///BaseClass的摘要说明
/summary>
publicclassBaseClass:
System.Web.UI.Page
{
publicBaseClass()
{
//
//TODO:
在此处添加构造函数逻辑
}
#region显?
示?
客í
户§
端?
对?
话°
框ò
///<
///WebMessageBox用?
来ぁ?
在ú
弹獭?
出?
。
£
paramname="
TxtMessage"
>
显?
内ú
容╕<
/param>
returns>
/returns>
publicstringMessageBox(stringTxtMessage)
stringstr;
str="
scriptlanguage=javascript>
alert('
"
+TxtMessage+"
'
)<
/script>
;
returnstr;
#endregion
#region执′行DSQL语?
句?
///用?
执′行DSQL语?
sQueryString"
sQueryStringSQL字?
符?
串?
操ù
作痢?
是?
否?
成é
功|(True\False)<
publicBooleanExecSQL(stringsQueryString)
SqlConnectioncon=newSqlConnection(ConfigurationManager.AppSettings["
]);
con.Open();
SqlCommanddbCommand=newSqlCommand(sQueryString,con);
if(dbCommand.ExecuteNonQuery()>
0)
con.Close();
returntrue;
else
returnfalse;
///公?
告?
信?
息¢添?
加ó
title"
标括?
题琣<
content"
公?
person"
发ぁ?
布?
人?
publicBooleanExecProcNotice(stringtitle,stringcontent,stringperson)//执′行D公?
程ì
序ò
SqlCommandcmd=newSqlCommand("
insert_tb_notice"
con);
cmd.CommandType=CommandType.StoredProcedure;
//公?
题琣
SqlParameterpTitle=newSqlParameter("
@noticeTitle"
SqlDbType.VarChar,80);
//设Θ?
置?
数簓据Y库a参?
数簓
pTitle.Value=title;
cmd.Parameters.Add(pTitle);
详ê
细?
容╕
SqlParameterpContent=newSqlParameter("
@noticeContent"
SqlDbType.Text,0);
//0为aText默?
认?
存?
储洹?
的?
最?
大洙?
值μ
pContent.Value=content;
cmd.Parameters.Add(pContent);
SqlParameterpPerson=newSqlParameter("
@noticePerson"
SqlDbType.VarChar,20);
pPerson.Value=person;
cmd.Parameters.Add(pPerson);
//判D断?
运?
行D结á
果?
if(cmd.ExecuteNonQuery()>
#region查é
询ˉSQL语?
/// ?
执′行D查é
询ˉS戗?
Q?
L戗?
语?
TableName"
TableName数簓据Y表括?
名?
称?
publicSystem.Data.DataSetGetDataSet(stringsQueryString,stringTableName)
//strings1=ConfigurationManager.ConnectionStrings["
].ConnectionString;
//SqlConnectioncon=newSqlConnection(s1);
SqlDataAdapterdbAdapter=newSqlDataAdapter(sQueryString,con);
DataSetdataset=newDataSet();
dbAdapter.Fill(dataset,TableName);
returndataset;
}
以部门信息修改为例写出各项数据绑定操作
publicpartialclassBaseInfo_BaseDepartmentAdd:
protectedvoidPage_Load(objectsender,EventArgse)
if(Session["
loginName"
]==null)
Response.Write("
script>
this.parent.location.href='
../Default.aspx'
);
protectedvoidimgBtnSave_Click(objectsender,ImageClickEventArgse)
BaseClassbc=newBaseClass();
Booleanbl;
bl=bc.ExecSQL("
insertintodepartmentvalues('
+txtName.Text+"
'
+txtContent.Text+"
+txtid.Text+"
)"
if(bl)
Response.Write(bc.MessageBox("
新建部门成功!
));
新建部门失败!
protectedvoidimgBtnClear_Click(objectsender,ImageClickEventArgse)
txtName.Text="
txtContent.Text="
publicpartialclassBaseInfo_BaseDepartmentManager:
return;
GridView1.DataSource=bc.GetDataSet("
select*fromdepartment"
"
department"
GridView1.DataKeyNames=newString[]{"
deptid"
};
GridView1.DataBind();
protectedvoidGridView1_PageIndexChanging(objectsender,GridViewPageEventArgse)
GridView1.PageIndex=e.NewPageIndex;
protectedvoidGridView1_RowDeleting(objectsender,GridViewDeleteEventArgse)
try
bc.ExecSQL("
deletefromdepartmentwheredeptid='
+this.GridView1.DataKeys[e.RowIndex].Value.ToString()+"
catch(Exceptionex)
Response.Write(bc.MessageBox(ex.Message));
publicpartialclassBaseInfo_BaseDepartmentUpdate:
if(!
IsPostBack)
DataSetds=bc.GetDataSet("
select*fromdepartmentwheredeptid='
+Request.QueryString["
id"
].ToString()+"
txtName.Text=ds.Tables[0].Rows[0][1].ToString();
txtContent.Text=ds.Tables[0].Rows[0][2].ToString();
Booleanbl=bc.ExecSQL("
updatedepartmentsetdeptname='
deptmaid='
+txtContent.Text+"
wheredeptid='
]+"
部?
门?
基¨
´
本À
?
息¡
é
修T改?
成¨
¦
功|!
scriptlanguage='
javascript'
this.parent.MainFrame.location.href='
BaseDepartmentManager.aspx'
失º
¡
ì
败ã
¨
¹
!
protectedvoidimgBtnReturn_Click(objectsender,ImageClickEventArgse)
其他的数据实现类参见BaseInfo文件夹
关于界面设计,以Default为例
%@PageLanguage="
C#"
AutoEventWireup="
true"
CodeFile="
Default.aspx.cs"
Inherits="
_Default"
%>
%@RegisterSrc="
UserControl/GoodEmployee.ascx"
TagName="
GoodEmployee"
TagPrefix="
uc1"
UserControl/Notice.ascx"
Notice"
uc2"
UserControl/Logon.ascx"
Logon"
uc3"
DOCTYPEhtmlPUBLIC"
-//W3C//DTDXHTML1.0Transitional//EN"
"
http:
//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
htmlxmlns="
//www.w3.org/1999/xhtml"
>
headrunat="
server"
<
title>
办ã
¬
自Á
动¡
¥
化¡
管¨
理¤
ª
系¦
Ì
统ª
3<
/title>
linkhref="
CSS/CSS.css"
rel="
stylesheet"
type="
text/css"
/>
styletype="
.style1
height:
166px;
.style2
text-align:
center;
width:
268435344px;
.style4
/style>
/head>
body>
formid="
form1"
runat="
div>
tablecellpadding="
10"
cellspacing="
0"
style="
width:
1000;
342px"
tr>
tdcolspan="
align:
center"
imgsrc='
images/001.gif'
text-align:
margin-left:
2px;
1276px;
float:
left;
/td>
/tr>
tdstyle="
vertical-align:
top;
224px;
173px"
c