办公自动化系统设计文档12226.docx
Web开发与应用技术设计文档项目名称:办公自动化系统 完成日期:2012-01-05 目 录································3·································3····························3··············································8第五章 系统模块划分···········································8 一、系统设计背景办公自动化(Office Automation System,OAS)系统,是利用先进的计算机信息技术和现代办公设备构成的人机信息处理系统,辅助管理人员进行各种办公活动。办公自动化系统由办公机构、办公人员、办公设备、网络环境、办公信息等几个基本要素构成。本系统开发的目的是紧密结合目前政府机关和企事业单位的办公业务流程和管理特点,开发一套先进的、综合的、完整的、并且能有效的在局域网和广域网运行的办公自动化系统。通过该系统的使用,可有效地提高政府机关和企事业单位的工作效率,提升应用单位信息化管理的水平,减少工作人员的工作量,降低政府机关和企事业单位的成本。二、系统需求分析1. 数据层上,实现对员工部门信息的修改、删除、更新等操作,同时记录考勤状况。2.业务层上,实现各种与数据层的交互工作。3.视觉上,尽可能的做到人机交互,简明、易懂。4.主界面上显示当前日期,展示经理风采。三、系统功能介绍 登录功能【系统管理员】 查看公告 考勤管理(设置上下班时间,管理员工的签到、签退等) 系统设置(设置个人密码,为系统设置新的管理员等) 部门管理(编辑新增加的部门以及部门信息的维护工作)【普通用户】 个人操作(包括查看系统公告,修改个人登录密码) 考勤签到(完成个人考勤,即签到和签退功能的实现) 查看系统公告 上下班签到时间设置 上下班签到功能 密码重置功能 添加新管理员设置 新建部门功能 更新部门信息四、系统流程图 登录 系统管理员 普通职员修改个人信息修改密码信息修改部门信息修改考勤信息修改个人密码查看公告考勤签到签退五、系统模块划分【模块划分】登录模块员工管理模块管理员和普通员工模块数据维护模块上班签到的查询部门增删信息更新模块六、数据库设计数据库中存在8个表单分别如下:七、详细设计及实现1. 连接数据库:Web.configue:<appSettings><add key="conStr" value="Server=LJJ-PCLJJ;database=company;Uid=sa;Pwd=941212"/></appSettings>BaseClass这个实现连接的类:using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Data.SqlClient;using System.Collections;/ <summary>/ BaseClass 的摘要说明/ </summary>public class BaseClass : System.Web.UI.Page public BaseClass() / / TODO: 在此处添加构造函数逻辑 / #region 显?示?客í户§端?对?话°框ò / <summary> / WebMessageBox用?来?在ú客í户§端?弹獭?出?对?话°框ò。 / </summary> / <param name="TxtMessage">对?话°框ò显?示?内ú容</param> / <returns></returns> public string MessageBox(string TxtMessage) string str; str = "<script language=javascript>alert('" + TxtMessage + "')</script>" return str; #endregion #region 执行DSQL语?句? / <summary> / 用?来?执行DSQL语?句? / </summary> / <param name="sQueryString">sQueryString SQL字?符?串?</param> / <returns>操ù作痢?是?否?成é功|(TrueFalse)</returns> public Boolean ExecSQL(string sQueryString) SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings"conStr"); con.Open(); SqlCommand dbCommand = new SqlCommand(sQueryString, con); if (dbCommand.ExecuteNonQuery() > 0) con.Close(); return true; else con.Close(); return false; / <summary> / 公?告?信?息添?加ó / </summary> / <param name="title">标括?题琣</param> / <param name="content">公?告?内ú容</param> / <param name="person">发?布?公?告?人?</param> / <returns></returns> public Boolean ExecProcNotice(string title, string content, string person)/执行D公?告?程ì序ò SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings"conStr"); con.Open(); SqlCommand cmd = new SqlCommand("insert_tb_notice", con); cmd.CommandType = CommandType.StoredProcedure; /公?告?标括?题琣 SqlParameter pTitle = new SqlParameter("noticeTitle", SqlDbType.VarChar, 80);/设?置?数簓据Y库a参?数簓 pTitle.Value = title; cmd.Parameters.Add(pTitle); /公?告?详ê细?内ú容 SqlParameter pContent = new SqlParameter("noticeContent", SqlDbType.Text, 0); /0为aText默?认?存?储洹?的?最?大洙?值 pContent.Value = content; cmd.Parameters.Add(pContent); /公?告?发?布?人? SqlParameter pPerson = new SqlParameter("noticePerson", SqlDbType.VarChar, 20); pPerson.Value=person; cmd.Parameters.Add(pPerson); /判D断?运?行D结á果? if (cmd.ExecuteNonQuery() > 0) con.Close(); return true; else con.Close(); return false; #endregion #region 查é询SQL语?句? / <summary> /?执行D查é询戗?戗?语?句? / </summary> / <param name="sQueryString">sQueryString SQL字?符?串?</param> / <param name="TableName">TableName 数簓据Y表括?名?称?</param> / <returns></returns> public System.Data.DataSet GetDataSet(string sQueryString, string TableName) SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings"conStr"); /string s1 = ConfigurationManager.ConnectionStrings"conStr".ConnectionString; / SqlConnection con = new SqlConnection(s1); SqlDataAdapter dbAdapter = new SqlDataAdapter(sQueryString, con); DataSet dataset = new DataSet(); dbAdapter.Fill(dataset, TableName); return dataset; #endregion以部门信息修改为例写出各项数据绑定操作using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;public partial class BaseInfo_BaseDepartmentAdd : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) if (Session"loginName" = null) Response.Write("<script>this.parent.location.href='./Default.aspx'</script>"); protected void imgBtnSave_Click(object sender, ImageClickEventArgs e) BaseClass bc = new BaseClass(); Boolean bl; bl = bc.ExecSQL("insert into department values('" + txtName.Text + "','" + txtContent.Text+ "','" +txtid.Text +"')"); if (bl) Response.Write(bc.MessageBox("新建部门成功!"); else Response.Write(bc.MessageBox("新建部门失败!"); protected void imgBtnClear_Click(object sender, ImageClickEventArgs e) txtName.Text = "" txtContent.Text = "" using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;public partial class BaseInfo_BaseDepartmentManager : System.Web.UI.Page BaseClass bc = new BaseClass(); protected void Page_Load(object sender, EventArgs e) if (Session"loginName" = null) Response.Write("<script>this.parent.location.href='./Default.aspx'</script>"); return; GridView1.DataSource = bc.GetDataSet("select * from department", "department"); GridView1.DataKeyNames = new String "deptid" ; GridView1.DataBind(); protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) GridView1.PageIndex = e.NewPageIndex; GridView1.DataBind(); protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) try bc.ExecSQL("delete from department where deptid='" + this.GridView1.DataKeyse.RowIndex.Value.ToString() + "'"); GridView1.DataSource = bc.GetDataSet("select * from department", "department"); GridView1.DataBind(); catch (Exception ex) Response.Write(bc.MessageBox(ex.Message); using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;public partial class BaseInfo_BaseDepartmentUpdate : System.Web.UI.Page BaseClass bc = new BaseClass(); protected void Page_Load(object sender, EventArgs e) if (Session"loginName" = null) Response.Write("<script>this.parent.location.href='./Default.aspx'</script>"); return; if (!IsPostBack) DataSet ds = bc.GetDataSet("select * from department where deptid='" + Request.QueryString"id".ToString() + "'", "department"); txtName.Text = ds.Tables0.Rows01.ToString(); txtContent.Text = ds.Tables0.Rows02.ToString(); protected void imgBtnSave_Click(object sender, ImageClickEventArgs e) Boolean bl = bc.ExecSQL("update department set deptname='" + txtName.Text + "',deptmaid='" + txtContent.Text + "' where deptid='" + Request.QueryString"id" + "'"); if (bl) Response.Write(bc.MessageBox("部?门?基¨´本À?信?息¡é修T改?成¨¦功|!"); Response.Write("<script language='javascript'>this.parent.MainFrame.location.href='BaseDepartmentManager.aspx'</script>"); else Response.Write(bc.MessageBox("部?门?基¨´本À?信?息¡é修T改?失º¡ì败㨹!"); protected void imgBtnReturn_Click(object sender, ImageClickEventArgs e) Response.Write("<script language='javascript'>this.parent.MainFrame.location.href='BaseDepartmentManager.aspx'</script>"); 其他的数据实现类参见BaseInfo文件夹关于界面设计,以Default为例<% Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><% Register Src="UserControl/GoodEmployee.ascx" TagName="GoodEmployee" TagPrefix="uc1" %><% Register Src="UserControl/Notice.ascx" TagName="Notice" TagPrefix="uc2" %><% Register Src="UserControl/Logon.ascx" TagName="Logon" TagPrefix="uc3" %><head runat="server"> <title>办㨬公?自Á?动¡¥化¡¥管¨¹理¤¨ª系¦Ì统ª3</title> <link href="CSS/CSS.css" rel="stylesheet" type="text/css" /> <style type="text/css"> .style1 height: 166px; .style2 height: 166px; text-align: center; width: 268435344px; .style4 text-align: center; </style></head> <body> <form id="form1" runat="server"> <div> <table cellpadding="10" cellspacing="0" style="width: 1000; height: 342px"> <tr><td colspan="10" style="align:center"> <img src='images/001.gif' style="text-align: center; margin-left: 2px; width: 1276px; float: left;" /></td></tr> <tr> <td style="vertical-align: top; width: 224px; height: 173px" class="style4"> <table cellpadding="0" cellspacing="0" style="width: 189px"> <tr> <td style="height: 44px; vertical-align: top;"> <table id="TABLE1" style="width: 224px" bgcolor="#f0f0f1" cellpadding="0" cellspacing="0"> <tr> <td class="style4"> <img height="30" src="images/002.jpg" width="224" style="float: left;" /></td> </tr> <tr> <td style="height: 15px"> </tr> <tr> <td><asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="#3366CC" Font-Names="Verdana" Font-Size="8pt" ForeColor="#003399" Height="200px" Width="224px" CellPadding="1" DayNameFormat="Shortest" BorderWidth="1px" > <SelectedDayStyle BackColor="#009999" ForeColor="#CCFF99" Font-Bold="True" /> <TodayDayStyle BackColor="#99CCCC" ForeColor="White" /> <OtherMonthDayStyle ForeColor="#999999" /> <NextPrevStyle Font-Size="8pt" ForeColor="#CCCCFF" /> <DayHeaderStyle BackColor="#99CCCC" ForeColor="#336666" Height="1px" /> <SelectorStyle BackColor="#99CCCC" ForeColor="#336666" /> <TitleStyle BackColor="#003399" BorderColor="#3366CC" Font-Bold="True" BorderWidth="1px" Font-Size="10pt" ForeColor="#CCCCFF" Height="25px" /> <WeekendDayStyle BackColor="#CCCCFF" /> </asp:Calendar> </td> </tr> <tr> <td> </td> </tr> </table> </td> </tr> <tr> <td style="height: 15px"> </tr> <tr> <td style="height: 15px" class="style4"> <img height="30" src="images/003.jpg" width="224" /></td> </tr> <tr> <td style="height: 53px"> <uc3:Logon ID="Logon1" runat="server" /> </td> </tr> <tr> <td style="height: 15px"> </tr> <tr> <td style="height: 15px" class="style4"> </tr> <tr> <td style="height: 15px" class="style4"> <img height="30" src="images/004.jpg" width="224" /></td> </tr> <tr> <td style="height: 15px" class="style4"></td> </tr> <tr> <td style="height: 60px">