软件系统设计大作业.docx
《软件系统设计大作业.docx》由会员分享,可在线阅读,更多相关《软件系统设计大作业.docx(23页珍藏版)》请在冰豆网上搜索。
软件系统设计大作业
某某轻工大学
软件系统设计大作业
专业:
软件工程
班级:
软工1203班
学号:
1205110627
姓名:
司福江
指导教师:
蒋丽华
2015年 5月2日
一.实验目的
通过制作一个电子通信录系统来掌握使用ADO.NET访问与操纵数据库的方法,或者设计制作教材中所述的伪系统,或者设计制作自己拟定的工资、学籍、图书管理系统之类的系统。
二.实验内容
1、电子通信录包括三局部信息:
用户登录注册信息
通信组信息
联系人信息
2、电子通信录系统应至少包括如下功能页面〔页面布局自定〕:
用户首先要进展注册,注册成功后,还要允许用户进展密码修改。
通信组的显示与维护AltGroup.aspx〔包括通信组信息的删除和修改〕
通信组是根据联系人之间的关系建立不同性质的Group,以上页面主要访问数据库中的TableGroup数据表。
页面主要功能分别为:
组的创建和维护。
比如,可以建立亲友通信组、工作通信组、同学通信组以与其他类型通信组等。
联系人信息的显示与维护AltPerson.aspx〔包括联系人信息的删除和修改〕
根据联系人与通信组的关系,对联系人进展分类添加和维护,以上页面涉与到对TableUser数据表的操作,同时需要考虑与TableGroup数据表之间的关系。
设置查找条件,用户可以直接输入查询关键字,也可以先选择通信组,再输入查询关键字,系统返回查询结果,可以绑定DataGrid控件来显示查询结果。
三.需求分析
本系统除了用户的注册设计外,还可设置收发的查看删除功能。
包括:
加强信息保管的安全性;提高信息准确度和全面性;提高信息获取的便捷性;确保信息管理的高效性。
以Windows为操作系统,运SQLsever数据库技术,开发以WindowsXP为用户的操作平台,界面友善、功能齐全的通讯录系统。
新系统的运行硬件环境PC机,当用户使用系统时,通过正确的口令进入系统,进展数据库的维护操作和运用。
操作上是对IE浏览器的引用,该浏览器的使用,主要凭借使用浏览操作技术即可完成数据录入,方便简单。
使用前只要对用户进展简单的说明或阅读帮助文件即可使用该系统。
四.系统框架
1、登陆页面模块:
登陆,注册用户模块。
2、用户注册页面模块。
3、主界面模块。
4、添加分组模块。
5、查询联系人模块。
五.主要模块代码、截图。
1、登录模块
代码:
//登录按钮响应事件
protectedvoidButtondenglu_Click(objectsender,EventArgse)
{
stringConnString="server=localhost;InitialCatalog=liumail;IntegratedSecurity=SSPI";
SqlConnectionConn=newSqlConnection(ConnString);
stringQueryStr="selectcount(*)fromTAB_UserInfowhereUserID='"+TextBoxUsername.Text+"'andPassword='"+TextBoxPassword.Text+"'";
Conn.Open();
Sqlmandcmd=newSqlmand(QueryStr,Conn);
intcount=Convert.ToInt32(cmd.ExecuteScalar());
try
{
if(count>0)
{
Session["UserID"]=TextBoxUsername.Text;
Session["Password"]=TextBoxPassword.Text;
Response.BufferOutput=true;
Response.Redirect("Global.aspx");
}
else
{
Response.Write("alert('用户名或者密码不正确!
请重新输入')");
}
}
catch(Exceptionex)
{
Console.WriteLine("Exceptioninmain:
"+ex.Message);
}
Conn.Close();
}
注册按钮事件代码:
protectedvoidButtonzhuce_Click(objectsender,EventArgse)
{
Response.Redirect("Register.aspx");
}
}
2、注册模块
代码:
//注册按钮事件
protectedvoidButtonOK_Click(objectsender,EventArgse)
{
stringConnString="server=localhost;InitialCatalog=liumail;IntegratedSecurity=SSPI";
SqlConnectionConn=newSqlConnection(ConnString);
try
{
stringInsertStr="insertintoTAB_UserInfo(UserID,UserName,Password,Address,QQ,ConfEmail)"+
"values('"+TextBoxLoginName.Text+"','"+TextBoxUserName.Text+"','"+TextBoxPassword.Text+"','"+TextBoxAddress.Text+"','"+TextBoxQQ.Text+"','"+TextBoxEmail.Text+"')";
Sqlmandmy=newSqlmand(InsertStr,Conn);
if(RadioButtonAccept.Checked==true)
{
my.Connection.Open();
my.ExecuteNonQuery();
my.Connection.Close();
Response.Write("");
}
else
{
Response.Write("");
}
}
catch(Exceptionex)
{
Response.Write("");
TextBoxLoginName.Text="";
TextBoxUserName.Text="";
TextBoxPassword.Text="";
TextBoxAddress.Text="";
TextBoxQQ.Text="";
TextBoxEmail.Text="";
LabelMessage.Text="";
}
}
验证用户名是否存在:
protectedvoidButtonCheck_Click(objectsender,EventArgse)
{
stringConnString="server=localhost;InitialCatalog=liumail;IntegratedSecurity=SSPI";
SqlConnectionConn=newSqlConnection(ConnString);
stringQueryStr="selectcount(*)fromTAB_UserInfowhereUserID='"+TextBoxLoginName.Text+"'";
Conn.Open();
Sqlmandcmd=newSqlmand(QueryStr,Conn);
intcount=Convert.ToInt32(cmd.ExecuteScalar());
if(count>0)
{
LabelMessage.Text="此用户名已被使用";
TextBoxLoginName.Text="";
}
else
{
LabelMessage.Text="恭喜你!
此用户名可使用";
}
Conn.Close();
}
}
3.主界面模块
代码:
#line-chart{
height:
300px;
width:
800px;
margin:
0pxauto;
margin-top:
1em;
}
.navbar-default.navbar-brand,.navbar-default.navbar-brand:
hover{
color:
#fff;
}
.dropdown-menu{
text-align:
center;font-weight:
bold;
}
$(function(){
varuls=$('.sidebar-nav>ul>*').clone();
uls.addClass('visible-xs');
$('#main-menu').append(uls.clone());
});
#00ffdc;">
Togglenavigation
联系薄