1、 课 程 设 计 报 告 课程设计名称 人事管理系统 专 业 计算机科学与技术 班 级 3 学 号 姓 名 指导教师 于桂玲 成 绩 年 月 日 第一章 概述 1 第二章 需求分析 1 2.1 需求的文字表述 1 2.2 系统分析 1 2.21 系
2、统功能描述 1 2.2.2 功能模块划分 1 2.3 系统功能模块 1 第三章 概念模型设计 2 3.1 局部E-R模型 2 3.1.1 员工信息E-R图:重要涉及的属性有员工编号,姓名,性别,专业,外语情况,学历,婚姻状况 2 3.1.2 部门信息E-R图:重要涉及的属性有部门的编号,部门的名称,以及部门的描述 3 3.1.3 外语情况信息E-R图:重要涉及的属性有岗位名称,岗位说明,所属部门 3 3.1.4 管理员E-R图:重要涉及的属性有管理员编号,管理员姓名,性别,年龄 3 3.1.5 配偶信息E-R图:重要涉及的属性有员工编号,员工配偶姓名,配偶性别,工作单位 4
3、 3.2 集成E-R图 4 第四章 逻辑结构设计 5 4.1 E-R图向关系模型的转换 6 4.2 关系表的建立 6 4.2.1 员工信息表的建立 6 4.2.2 部门信息表的建立 7 4.2.3 员工婚姻状况表的建立 7 4.2.4 员工学历信息表的建立 7 4.3 有关建表代码与截图 7 4.3.1员工信息表的建立 7 4.3.2 部门信息表的建立 8 4.3.3 员工婚姻表的建立 9 4.3.4 员工学历表的建立员工编号,员工学历,专业、毕业时间、学校、外语情况 10 4.3.5以下为前台制作截图: 11 第一章 概述 公司之间
4、的竞争重要体现在三个方面:产品市场的竞争、资金市场的竞争和人才市场的竞争。在网络经济的环境下,人才是公司生存发展的基础,公司必须建立有效的人力资源管理系统,才干在竞争中取得优势。完善的人力资源管理的两大目的是:第一,有效地减少管理层、员工和人力资源部员工用于人力资源管理上的时间消耗;第二,要促使人力资源部和管理层更加关注“增长活动”,从而吸引、发展和留住优秀人才。人事管理系统可以实现功能涉及“人事信息维护”、“数据查询”、“系统维护”。该系统应当提供人事信息的录入(修改)、删除、记录:人事常用的数据查询(涉及各种复杂查询),各类人事记录报表的设计、生成、表式的导入和导出、打印。 第二章
5、需求分析 2.1 需求的文字表述 本系统是通过具体调查户为满足一些中小型公司公司的管理规定而制作的。目前,运用计算机管理公司信息已经越来越普遍,可以说计算机已成为一个公司不可或缺的“管理者”,它的方便性、安全性和可靠性也越来越受到人们的青睐。随着科技的进步,运用网络连接各个部门和各个公司单位也都成为现实。 为了方便公司各个部门的业务联系和相关查询,本系统通常要进行必要的网络连接,之后便可以方便地使用,系统的特点如下: 1、可替代许多复杂的人工劳动,如记录、核算等工作,节省许多资源。 2、便于领导对员工的工资、调度等信息进行查询。 3、利于高级用户进行洗头膏信息管理和维护,也允许
6、普通用户进行部分信息浏览、查看,以实现管理机制透明化。 4、提供了大量的操作提醒,以其较强的容错能力,大大方便了管理者和用户的使用,保证了数据的安全性、对的性、完整性和一致性。 5、能在很大限度上优化公司管理,提高公司的工作效率。 2.2 系统分析 2.21 系统功能描述 本系统是在实际调查的基础上,结合广大中小型公司的共同点,严格遵循实事求是的原则创建而成的。目的是通过该系统实现人事管理,信息查询分析以及项目部门之间的调配工作等工作,最终实现科学决策。 2.2.2 功能模块划分 本系统从功能上分为个5模块,分别是用户管理、部门管理、人员管理、信息查询及系统设立。 1、用
7、户管理:分为管理员和普通用户,重要用户对公司员工信息的修整和查看 2、部门管理:用于部门的创建、删除及部门信息的修改和查询等 3、人员管理:用于对员工的添加、删除、信息的修改等进行管理操作 4、信息查询:用于对员工的具体信息、各部门查询操作 5、系统设立:用于对系统的一些基本参数的设立 2.3 系统功能模块 第三章 概念模型设计 3.1 局部E-R模型 3.1.1 员工信息E-R图:重要涉及的属性有员工编号,姓名,性别,专业,外语情况,学历,婚姻状况 员工编号 员工性别 上岗日期 员工 外语情况 学历 婚姻状况 姓名 图3-1员工信息E-R图
8、 3.1.2 部门信息E-R图:重要涉及的属性有部门的编号,部门的名称,以及部门的描述 部门编号 部门名称 部门描述 部门 图3-2 部门信息E-R图 3.1.3 外语情况信息E-R图:重要涉及的属性有岗位名称,岗位说明,所属部门 岗位名称 岗位说明 所属部门 外语情况 图3-3岗位信息E-R图 3.1.4 管理员E-R图:重要涉及的属性有管理员编号,管理员姓名,性别,年龄 管理员编号 管理员姓名 性别 年龄 管理员 图3-4 管理员E-R图 3.1.5 配偶信息E-R图:重要涉及的属性有员工编号,员工配偶姓名,配偶性别,工作单位
9、 员工配偶姓名 配偶性别 工作单位 配偶 员工编号 图3-5 员工配偶信息E-R图 3.2 集成E-R图 重要涉及的实体有管理员,员工,部门,配偶,外语情况 管理员与员工之间的关系是1:n 配偶与员工之间的关系是1:1 部门与员工之间的关系是1:n 外语情况与员工之间的关系是1:n 工作 管理 员工 管理员 部门 婚姻 包含 配偶 1 n 1 1 n n 1 1 外语情况 图3-6集成E-R图 第四章 逻辑结构设计 4.1 E-R图向关系模型的转换 根据E-R图向关系模型转换的原则,将两
10、个实体转换为关系模式如下,其中码用下划线表达,并且不能为空。 员工(员工编号,姓名,性别,专业,外语情况,学历,婚姻状况) 部门(部门编号,部门名称,部门描述) 外语情况(岗位名称,岗位说明,所属部门) 管理员(管理员编号,姓名,性别,年龄) 配偶(员工编号,员工配偶姓名,性别,工作单位) 4.2 关系表的建立 4.2.1 员工信息表的建立 员工表中重要涉及的属性是员工编号,姓名,性别,专业,外语情况,学历,婚姻状况 列名 数据类型 长度 允许空 员工号 CHAR 10 NOT NULL 姓名 CHAR 10 NOT
11、 NULL 性别 CHAR 10 YES 专业 CHAR 10 YES 外语情况 CHAR 10 YES 学历 CHAR 10 YES 婚姻状况 CHAR 10 YES 年龄 CHAR 10 YES 毕业时间 CHAR 10 YES 毕业学校 CHAR 10 YES 表4-1 员工信息表 4.2.2 部门信息表的建立 部门信息表中涉及的重要的属性有部门的编号,部门的名称,以及部门的描述 列名 数据类型 长度 允许空 部门编号 CHAR 10 NOT NULL 部门名称
12、CHAR 10 NOT NULL 部门描述 CHAR 10 YES 表4-2 部门信息表 4.2.3 员工婚姻状况表的建立 员工婚姻状况表中涉及的重要属性有员工编号,员工配偶姓名,性别,配偶工作单位 列名 数据类型 长度 允许空 员工编号 CHAR 10 NOT NULL 员工配偶姓名 CHAR 10 YES 性别 CHAR 10 YES 配偶工作单位 CHAR 10 YES 表4-4 员工婚姻状况表 4.2.4 员工学历信息表的建立 员工学历信息表中涉及的重要属性有员工编号,员工学历,专
13、业、毕业时间、学校、外语情况 列名 数据类型 长度 允许空 员工编号 CHAR 10 NOT NULL 员工学历 CHAR 10 YES 专业 CHAR 10 YES 毕业时间 CHAR 10 YES 毕业学校 CHAR 10 YES 外语情况 CHAR 10 YES 表4-5 员工学历信息表 4.3 有关建表代码与截图 4.3.1员工信息表的建立 Create table 员工信息 ( 员工编号 char(10) primary key, 姓名 char(10), 性别 char(10), 专
14、业 char(10), 外语情况 char(10), 学历 char(10), 婚姻状况 char(10) ); 4.3.2 部门信息表的建立 Create table 部门信息 ( 部门编号 char(10) primary key, 部门名称 char(10), 部门描述 char(10) ); 4.3.3 员工婚姻表的建立 Create table 员工婚姻表 ( 员工编号 char(10) primary key, 员工配偶姓名 char(10), 员工性别 char(10), 工作单位 char(10)
15、 ); 4.3.4 员工学历表的建立员工编号,员工学历,专业、毕业时间、学校、外语情况 Create table 员工学历表 ( 员工编号 char(10) primary key, 员工学历 char(10), 专业 char(10), 毕业时间 char(10), 毕业学校 char(10), 外语情况 char(10) ); 4.3.5以下为前台制作截图: 主页代码
16、
17、>公司管理系统
登陆页代码 <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <% Dim Recordset1 Dim Recordset1_numRows
18、 Set Recordset1 = Server.CreateObject("ADODB.Recordset") Recordset1.ActiveConnection = MM_san_STRING Recordset1.Source = "SELECT * FROM 员工基本信息表" Recordset1.CursorType = 0 Recordset1.CursorLocation = 2 Recordset1.LockType = 1 Recordset1.Open() Recordset1_numRows = 0 %> <% ' *** Validate
19、 request to log in to this site. MM_LoginAction = Request.ServerVariables("URL") If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString) MM_valUsername=CStr(Request.Form("textfield")) If MM_valUsername <> "" Then MM_fldUserAuthorization="
20、" MM_redirectLoginSuccess="dlcg.asp" MM_redirectLoginFailed="dlsb.asp" MM_flag="ADODB.Recordset" set MM_rsUser = Server.CreateObject(MM_flag) MM_rsUser.ActiveConnection = MM_san_STRING MM_rsUser.Source = "SELECT 姓名, 员工号" If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = M
21、M_rsUser.Source & "," & MM_fldUserAuthorization MM_rsUser.Source = MM_rsUser.Source & " FROM 员工基本信息表 WHERE 姓名='" & Replace(MM_valUsername,"'","''") &"' AND 员工号='" & Replace(Request.Form("textfield2"),"'","''") & "'" MM_rsUser.CursorType = 0 MM_rsUser.CursorLocation = 2 MM_rsUser.LockType
22、 = 3 MM_rsUser.Open If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then ' username and password match - this is a valid user Session("MM_Username") = MM_valUsername If (MM_fldUserAuthorization <> "") Then Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUser
23、Authorization).Value) Else Session("MM_UserAuthorization") = "" End If if CStr(Request.QueryString("accessdenied")) <> "" And false Then MM_redirectLoginSuccess = Request.QueryString("accessdenied") End If MM_rsUser.Close Response.Redirect(MM_redirectLogin
24、Success) End If MM_rsUser.Close Response.Redirect(MM_redirectLoginFailed) End If %>
25、
<% Recordset1.Close() Set Recordset1 = Nothing %> <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <% Dim Recordset1 Dim Recordset1_numRows Set Recordset1 = Server.CreateObject("ADODB.Recordset") Recordset1.ActiveConnection = MM_san_STRING Recordset1.Source = "SELECT * FROM 员工基本信息表" Recordset1.CursorType = 0 Recordset1.CursorLocation = 2 Recordset1.LockTy28、pe = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 10
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
29、ad>
30、
31、alue)%> 32、)%>
<
<% While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF)) %>
姓名
年龄
性别
学历
专业
毕业时间
毕业学校
外语情况
配偶
员工号
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
<%=(Recordset1.Fields.Item("姓名").Value)%>
<%=(Recordset1.Fields.Item("年龄").Value)%>
<%=(Recordset1.Fields.Item("性别").V
<%=(Recordset1.Fields.Item("学历").Value)%>
<%=(Recordset1.Fields.Item("专业").Value)%>
<%=(Recordset1.Fields.Item("毕业时间").Value)%>
<%=(Recordset1.Fields.Item("毕业学校").Value)%>
<%=(Recordset1.Fields.Item("外语情况").Value
<%=(Recordset1.Fields.Item("配偶").Value)%>
<%=(Recordset1.Fields.Item("员工号").Value)%>
33、/body> <% Recordset1.Close() Set Recordset1 = Nothing %>
| 公司部门情况查询 | 员工基本情况查询 |
| 工作岗位情况查询 | 员工婚姻情况查询 |
| 员工学历情况查询 | 返回 |
35、ion Dim MM_abortEdit Dim MM_editQuery Dim MM_editCmd Dim MM_editConnection Dim MM_editTable Dim MM_editRedirectUrl Dim MM_editColumn Dim MM_recordId Dim MM_fieldsStr Dim MM_columnsStr Dim MM_fields Dim MM_columns Dim MM_typeArray Dim MM_formVal Dim MM_delim Dim MM_altVal Dim MM_
36、emptyVal Dim MM_i MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME")) If (Request.QueryString <> "") Then MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString) End If ' boolean to abort record edit MM_abortEdit = false ' query string to execute MM_edi
37、tQuery = "" %> <% ' *** Delete Record: declare variables if (CStr(Request("MM_delete")) = "form1" And CStr(Request("MM_recordId")) <> "") Then MM_editConnection = MM_san_STRING MM_editTable = "员工基本信息表" MM_editColumn = "姓名" MM_recordId = "'" + Request.Form("MM_recordId") + "'"
38、MM_editRedirectUrl = "shanccg.html" ' append the query string to the redirect URL If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then MM_editRedirectUrl = MM_editRedirectUrl
39、 "?" & Request.QueryString Else MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString End If End If End If %> <% ' *** Delete Record: construct a sql delete statement and execute it If (CStr(Request("MM_delete")) <> "" And CStr(Request("MM_recordId")) <>
40、 "") Then ' create the sql delete statement MM_editQuery = "delete from " & MM_editTable & " where " & MM_editColumn & " = " & MM_recordId If (Not MM_abortEdit) Then ' execute the delete Set MM_editCmd = Server.CreateObject("ADODB.Command") MM_editCmd.ActiveConnection = M
41、M_editConnection MM_editCmd.CommandText = MM_editQuery MM_editCmd.Execute MM_editCmd.ActiveConnection.Close If (MM_editRedirectUrl <> "") Then Response.Redirect(MM_editRedirectUrl) End If End If End If %> <% Dim Recordset1__MMColParam Recordset1__MMColPara
42、m = "1" If (Session("MM_Username") <> "") Then Recordset1__MMColParam = Session("MM_Username") End If %> <% Dim Recordset1 Dim Recordset1_numRows Set Recordset1 = Server.CreateObject("ADODB.Recordset") Recordset1.ActiveConnection = MM_san_STRING Recordset1.Source = "SELECT * FROM 员工基本
43、信息表 WHERE 姓名 = '" + Replace(Recordset1__MMColParam, "'", "''") + "'" Recordset1.CursorType = 0 Recordset1.CursorLocation = 2 Recordset1.LockType = 1 Recordset1.Open() Recordset1_numRows = 0 %> <% Dim Repeat1__numRows Dim Repeat1__index Repeat1__numRows = -1 Repeat1__index = 0 Records
44、et1_numRows = Recordset1_numRows + Repeat1__numRows %> <% ' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables Dim Recordset1_total Dim Recordset1_first Dim Recordset1_last ' set the record count Recordset1_total = Recordset1.RecordCount ' set the number o
45、f rows displayed on this page If (Recordset1_numRows < 0) Then Recordset1_numRows = Recordset1_total Elseif (Recordset1_numRows = 0) Then Recordset1_numRows = 1 End If ' set the first and last displayed record Recordset1_first = 1 Recordset1_last = Recordset1_first + Recordset1_numRow
46、s - 1 ' if we have the correct record count, check the other stats If (Recordset1_total <> -1) Then If (Recordset1_first > Recordset1_total) Then Recordset1_first = Recordset1_total End If If (Recordset1_last > Recordset1_total) Then Recordset1_last = Recordset1_total End I
47、f If (Recordset1_numRows > Recordset1_total) Then Recordset1_numRows = Recordset1_total End If End If %> <% ' *** Recordset Stats: if we don't know the record count, manually count them If (Recordset1_total = -1) Then ' count the total records by iterating through the recordse
48、t Recordset1_total=0 While (Not Recordset1.EOF) Recordset1_total = Recordset1_total + 1 Recordset1.MoveNext Wend ' reset the cursor to the beginning If (Recordset1.CursorType > 0) Then Recordset1.MoveFirst Else Recordset1.Requery End If ' set the numbe
49、r of rows displayed on this page If (Recordset1_numRows < 0 Or Recordset1_numRows > Recordset1_total) Then Recordset1_numRows = Recordset1_total End If ' set the first and last displayed record Recordset1_first = 1 Recordset1_last = Recordset1_first + Recordset1_numRows - 1
50、 If (Recordset1_first > Recordset1_total) Then Recordset1_first = Recordset1_total End If If (Recordset1_last > Recordset1_total) Then Recordset1_last = Recordset1_total End If End If %> <% Dim MM_paramName %> <% ' *** Move To Record and Go To Record: declare variable






