软件系统设计大作业.docx

上传人:b****8 文档编号:11908584 上传时间:2023-06-03 格式:DOCX 页数:23 大小:98.47KB
下载 相关 举报
软件系统设计大作业.docx_第1页
第1页 / 共23页
软件系统设计大作业.docx_第2页
第2页 / 共23页
软件系统设计大作业.docx_第3页
第3页 / 共23页
软件系统设计大作业.docx_第4页
第4页 / 共23页
软件系统设计大作业.docx_第5页
第5页 / 共23页
软件系统设计大作业.docx_第6页
第6页 / 共23页
软件系统设计大作业.docx_第7页
第7页 / 共23页
软件系统设计大作业.docx_第8页
第8页 / 共23页
软件系统设计大作业.docx_第9页
第9页 / 共23页
软件系统设计大作业.docx_第10页
第10页 / 共23页
软件系统设计大作业.docx_第11页
第11页 / 共23页
软件系统设计大作业.docx_第12页
第12页 / 共23页
软件系统设计大作业.docx_第13页
第13页 / 共23页
软件系统设计大作业.docx_第14页
第14页 / 共23页
软件系统设计大作业.docx_第15页
第15页 / 共23页
软件系统设计大作业.docx_第16页
第16页 / 共23页
软件系统设计大作业.docx_第17页
第17页 / 共23页
软件系统设计大作业.docx_第18页
第18页 / 共23页
软件系统设计大作业.docx_第19页
第19页 / 共23页
软件系统设计大作业.docx_第20页
第20页 / 共23页
亲,该文档总共23页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

软件系统设计大作业.docx

《软件系统设计大作业.docx》由会员分享,可在线阅读,更多相关《软件系统设计大作业.docx(23页珍藏版)》请在冰点文库上搜索。

软件系统设计大作业.docx

软件系统设计大作业

武汉轻工大学

软件系统设计大作业

 

专业:

软件工程

班级:

软工1203班

学号:

1205110627

姓名:

司福江

指导老师:

蒋丽华

 

2015年 5月2日

 

1.实验目的

通过制作一个电子通信录系统来掌握使用ADO.NET访问与操纵数据库的方法,或者设计制作教材中所述的伪邮件系统,或者设计制作自己拟定的工资、学籍、图书管理系统之类的系统。

2.实验内容

1、电子通信录包括三部分信息:

用户登录注册信息

通信组信息

联系人信息

2、电子通信录系统应至少包括下列功能页面(页面布局自定):

用户首先要进行注册,注册成功后,还要允许用户进行密码修改。

通信组的创建AddGroup.aspx

通信组的显示与维护AltGroup.aspx(包括通信组信息的删除和修改)

通信组是根据联系人之间的关系建立不同性质的Group,以上页面主要访问数据库中的TableGroup数据表。

页面主要功能分别为:

组的创建和维护。

比如,可以建立亲友通信组、工作通信组、同学通信组以及其他类型通信组等。

联系人信息的添加AddPerson.aspx

联系人信息的显示与维护AltPerson.aspx(包括联系人信息的删除和修改)

根据联系人与通信组的关系,对联系人进行分类添加和维护,以上页面涉及到对TableUser数据表的操作,同时需要考虑与TableGroup数据表之间的关系。

查找通信录Find.aspx

设置查找条件,用户可以直接输入查询关键字,也可以先选择通信组,再输入查询关键字,系统返回查询结果,可以绑定DataGrid控件来显示查询结果。

3.需求分析

本系统除了用户的注册设计外,还可设置收发邮件的查看删除功能。

包括:

加强信息保管的安全性;提高信息准确度和全面性;提高信息获取的便捷性;确保信息管理的高效性。

以Windows为操作系统,运SQLsever数据库技术,开发以WindowsXP为用户的操作平台,界面友善、功能齐全的通讯录系统。

新系统的运行硬件环境PC机,当用户使用系统时,通过正确的口令进入系统,进行数据库的维护操作和运用。

操作上是对IE浏览器的引用,该浏览器的使用,主要凭借使用浏览操作技术即可完成数据录入,方便简单。

使用前只要对用户进行简单的说明或阅读帮助文件即可使用该系统。

4.系统框架

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();

SqlCommandcmd=newSqlCommand(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+"')";

SqlCommandmyCom=newSqlCommand(InsertStr,Conn);

if(RadioButtonAccept.Checked==true)

{

myCom.Connection.Open();

myCom.ExecuteNonQuery();

myCom.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();

SqlCommandcmd=newSqlCommand(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

  联系薄

1px;">

relative;top:

3px;"><%=Session["userName"].ToString()%>

  • 切换账号
  • 用户
  • 签到
  • 报名
  • 修改密码
  • 黄页
  • 1pxsolid#000000;height:

    900px;">

    4.查询模块

    代码:

    usingSystem;

    usingSystem.Collections;

    usingSystem.Configuration;

    usingSystem.Data;

    usingSystem.Linq;

    usingSystem.Web;

    usingSystem.Web.Security;

    usingSystem.Web.UI;

    usingSystem.Web.UI.HtmlControls;

    usingSystem.Web.UI.WebControls;

    usingSystem.Web.UI.WebControls.WebParts;

    usingSystem.Xml.Linq;

    usingutils;

    namespacewebpro5

    {

    publicpartialclassfindresult:

    System.Web.UI.Page

    {

    privateQueryRunnerqr=newQueryRunner();

    protectedvoidPage_Load(objectsender,EventArgse)

    {

    bind();

    }

    //查询语句的更改

    protectedvoidFindView_RowEditing(objectsender,GridViewEditEventArgse)

    {

    FindView.EditIndex=e.NewEditIndex;

    bind();

    }

    //删除

    protectedvoidFindView_RowDeleting(objectsender,GridViewDeleteEventArgse)

    {

    intindex=e.RowIndex;

    stringsql="deletefromtable_contactwherecid='"+FindView.DataKeys[e.RowIndex]["cid"].ToString()+"'";

    qr.ExecuteNonQuery(sql);

    bind();

    }

    //更新

    protectedvoidFindView_RowUpdating(objectsender,GridViewUpdateEventArgse)

    {

    stringsql="updatetable_contactsetcname='"+((TextBox)(FindView.Rows[e.RowIndex].Cells[2].Controls[0])).Text.ToString().Trim()

    +"',gender='"+((TextBox)(FindView.Rows[e.RowIndex].Cells[3].Controls[0])).Text.ToString().Trim()

    +"',address='"+((TextBox)(FindView.Rows[e.RowIndex].Cells[4].Controls[0])).Text.ToString().Trim()

    +"',postcode='"+((TextBox)(FindView.Rows[e.RowIndex].Cells[5].Controls[0])).Text.ToString().Trim()

    +"',telphone='"+((TextBox)(FindView.Rows[e.RowIndex].Cells[6].Controls[0])).Text.ToString().Trim()

    +"',email='"+((TextBox)(FindView.Rows[e.RowIndex].Cells[7].Controls[0])).Text.ToString().Trim()

    +"'wherecid='"+FindView.DataKeys[e.RowIndex].Value.ToString()+"'";

    qr.ExecuteNonQuery(sql);

    FindView.EditIndex=-1;

    bind();

    }

    //取消

    protectedvoidFindView_RowCancelingEdit(objectsender,GridViewCancelEditEventArgse)

    {

    FindView.EditIndex=-1;

    bind();

    }

    //绑定

    publicvoidbind()

    {

    Stringuid=Session["userId"].ToString();

    Stringname=Request.QueryString["cname"];

    Stringtel=Request.QueryString["tel"];

    Stringsql="select*fromgetContacts('"+uid+"')cwhere1=1";

    //name和tel有效,name有效tel无效,name无效tel有效

    if(((name!

    =null)&&(name.Trim()!

    =""))&&(tel!

    =null&&tel.Trim()!

    =""))

    {

    sql+="andamelike'%"+name+"%'orc.telphonelike'%"+tel+"%'";

    }

    elseif(((name!

    =

    展开阅读全文
    相关资源
    猜你喜欢
    相关搜索
    资源标签

    当前位置:首页 > 经管营销 > 经济市场

    copyright@ 2008-2023 冰点文库 网站版权所有

    经营许可证编号:鄂ICP备19020893号-2