课程设计三家庭理财管理系统.docx
《课程设计三家庭理财管理系统.docx》由会员分享,可在线阅读,更多相关《课程设计三家庭理财管理系统.docx(28页珍藏版)》请在冰豆网上搜索。
![课程设计三家庭理财管理系统.docx](https://file1.bdocx.com/fileroot1/2022-11/23/7f4641c6-5dae-4be9-873a-b73ef0b34279/7f4641c6-5dae-4be9-873a-b73ef0b342791.gif)
课程设计三家庭理财管理系统
序号:
20
学号:
11434126
课程设计报告
课程名称:
课程设计(三)
设计题目:
家庭理财管理系统
学生姓名:
张景
学院(系):
数理学院专业班级:
信息111
校内指导教师:
张燕新专业技术职务:
讲师
设计时间:
2014年9月8日2014年9月30日
目录
一.摘要……………………………………………………………………………3
二.引言……………………………………………………………………………3
三.系统设计………………………………………………………………………3
四.系统目标………………………………………………………………………5
五.系统详细设计…………………………………………………………………5
(1)管理员模块…………………………………………………………………5
(2)家庭成员模块………………………………………………………………16
(3)登录模块……………………………………………………………………22
六.数据库设计……………………………………………………………………24
七.总结……………………………………………………………………………25
八.参考文献………………………………………………………………………25
1.摘要
随着改革开放的深入特别是中国已经加人WTO,中国经济将融入世界经济大潮,而这种大潮必将把中国抛入更激烈的竞争。
理财系统是一个家庭收支或者家庭不可缺少的部分,家庭收支很早就实施了理财的集中管理,而家庭使用的小型理财系统却只是凤毛麟角,理财是很小的一个部分,但从到家庭收支,到家庭投资都有十分重要的意义。
本论文介绍了家庭理财系统开发的整个过程。
利用ASP.NET,采用面向对象的编程方法,其开发主要包括后台数据库的建立、维护以及前端应用程序开发,实现了家庭理财的自动化和信息化。
主要包括以下几个模块:
用户密码登陆,家庭成员管理,收支信息管理、统计及备份修改密码等。
本家庭理财管理系统的系统设计是基于C#语言,使用Visual Studio 2005作为开发平台,实现家庭理财管理系统的构建。
本篇论文介绍了该系统的开发环境和运行平台、.Net脚本,而后台的数据库则是用mysql。
关键词:
理财、收支管理、查询、备份、导出
二.引言
当今社会进入了计算机时代,信息就是财富,科学技术成为第一生产力。
在计算机技术的不断发展中,人们越来越认识到计算机在当今社会中的巨大作用。
电子计算机在信息处理方面表现出来的巨大优势,使得计算机被应用到现代社会的方方面面,使得计算机成为现代社会不可缺少的一部分。
理财管理对每一个家庭,个人都是一件十分重要的工作,理财管理的好,可以准确地反映家庭的收支情况和盈余信息。
本论文所设计的“家庭理财管理系统”是为方便家庭收支对家庭理财的管理而开发的,包括收支管理,债务管理,系统管理,投资管理,计算器,网络检索等功能。
也就是这个原因,为了对理财的理财进行更加有效、方便的管理,所以便有了这个家庭理财管理系统的出现。
本系统力求概念清晰、通俗易懂、操作容易、功能强大、实用性强。
使得本系统在对家庭理财进行管理的过程中,尽可能的发挥它的作用。
当然,为了在管理家庭理财时,不使理财账目发生严重错误,本系统力求最好的稳定性,最强的安全性,尽可能少的程序Bug。
3.系统设计
根据需求分析,结合系统的功能特点,本系统采用单机版就可以满足需求,该模式同时具有开发时间短,成本较低,架构容易、操作方便等优点,十分方便。
1.建模图
需求模型
用例图
数据概念模型
活动图
四.系统目标
本系统前端开发工具采用目前较流行ASP.NET,后台数据库系统采用大型数据库系统MYSQL,系统的运行平台为Windows。
本系统主要实现了管理员与家庭成员之间的相互切换的操作,各个人员对数据的增删查改。
系统管理员具有数据库的备份还原和表格中数据的导出等功能。
本系统基本具有网站的轮廓,各项操作的稳定可靠。
5.系统详细设计
1.管理员模块
添加家庭成员界面
图1
相关代码:
protectedvoidbtn_submit_Click(objectsender,EventArgse)
{
if(Page.IsValid)
{
MySqlConnectioncn=newMySqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["dsn"].ConnectionString);
if(cn.State==ConnectionState.Closed)
cn.Open();
MySqlCommandcmd=newMySqlCommand();
cmd.Connection=cn;
cmd.CommandText="insertintominfo(m_name,m_pho,m_sex,m_date,m_add,m_type)values('"+Convert.ToString(TextBox1.Text)
+"','"+Convert.ToString(TextBox2.Text)
+"','"+Convert.ToString(TextBox3.Text)
+"','"+Convert.ToString(TextBox5.Text)
+"','"+Convert.ToString(TextBox4.Text)+"','"+Convert.ToString(DropDownList1.Text)+"')";//"','"+convert.toint32(textbox4.text)+
cmd.ExecuteNonQuery();
cn.Close();
Thread.Sleep(1000);
this.lbl_message.Text="登Ì?
记?
成¨¦功|";
Thread.Sleep(1000);
System.Threading.Thread.Sleep(3000);//挂¨°起e3秒?
Response.Redirect("admin.aspx");
}
}
收支信息管理界面
图2
相关代码:
publicvoidbind()
{
stringsqlstr="select*fromshouzhi";
MySqlDataAdaptermyda=newMySqlDataAdapter(sqlstr,sqlcon);
DataSetmyds=newDataSet();
sqlcon.Open();
myda.Fill(myds,"shouzhi");//
//GridView1.DataSource=myds.t;
DataViewview=myds.Tables["shouzhi"].DefaultView;
stringsort=(string)ViewState["SortOrder"]+""+(string)ViewState["OrderDire"];
view.Sort=sort;
GridView1.DataSource=view;
GridView1.DataKeyNames=newstring[]{"A_id"};//主¡Â键¨¹
GridView1.DataBind();//调Ì¡Â用®?
绑㨮定¡§数ºy据Y函¡¥数ºy
//
//GridView1.DataBind();
sqlcon.Close();
}
protectedvoidGridView1_RowEditing(objectsender,GridViewEditEventArgse)
{
GridView1.EditIndex=e.NewEditIndex;
bind();
}
protectedvoidGridView1_RowDeleting(objectsender,GridViewDeleteEventArgse)
{
stringsqlstr="deletefromshouzhiwhereA_id='"+GridView1.DataKeys[e.RowIndex].Value.ToString()+"'";
sqlcom=newMySqlCommand(sqlstr,sqlcon);
sqlcon.Open();
sqlcom.ExecuteNonQuery();
sqlcon.Close();
bind();//调Ì¡Â用®?
绑㨮定¡§函¡¥数ºy
}
protectedvoidGridView1_RowDataBound(objectsender,GridViewRowEventArgse)
{
//如¨?
果?
是º?
绑㨮定¡§数ºy据Y行D
if(e.Row.RowType==DataControlRowType.DataRow)
{
if(e.Row.RowState==DataControlRowState.Normal||e.Row.RowState==DataControlRowState.Alternate)
{
((LinkButton)e.Row.FindControl("LinkButton1")).Attributes.Add("onclick","javascript:
returnconfirm('你?
确¨¡¤认¨?
要°a删¦?
除y:
êo\""+e.Row.Cells[1].Text+"\"吗e?
')");
}
}
}
//更¨¹新?
protectedvoidGridView1_RowUpdating(objectsender,GridViewUpdateEventArgse)
{
if(e.RowIndex!
=-1)
{
stringsqlstr="updateshouzhisetA_date='"
+((TextBox)(GridView1.Rows[e.RowIndex].Cells[1].Controls[0])).Text.ToString().Trim()+"',A_type='"
+((TextBox)(GridView1.Rows[e.RowIndex].Cells[2].Controls[0])).Text.ToString().Trim()+"',A_name='"
+((TextBox)(GridView1.Rows[e.RowIndex].Cells[3].Controls[0])).Text.ToString().Trim()+"',A_number='"
+((TextBox)(GridView1.Rows[e.RowIndex].Cells[4].Controls[0])).Text.ToString().Trim()+"',A_account='"
+((TextBox)(GridView1.Rows[e.RowIndex].Cells[5].Controls[0])).Text.ToString().Trim()+"'whereA_id='"
+GridView1.DataKeys[e.RowIndex].Value.ToString()+"'";
//,major='"+((TextBox)(GridView1.Rows[e.RowIndex].Cells[4].Controls[0])).Text.ToString().Trim()+"'
sqlcom=newMySqlCommand(sqlstr,sqlcon);
sqlcon.Open();
sqlcom.ExecuteNonQuery();
sqlcon.Close();
GridView1.EditIndex=-1;
bind();
}
}
家庭成员信息管理界面
图3
相关代码:
publicvoidbind()
{
stringsqlstr="select*fromminfo";
MySqlDataAdaptermyda=newMySqlDataAdapter(sqlstr,sqlcon);
DataSetmyds=newDataSet();
sqlcon.Open();
myda.Fill(myds,"minfo");//
//GridView1.DataSource=myds.t;
DataViewview=myds.Tables["minfo"].DefaultView;
stringsort=(string)ViewState["SortOrder"]+""+(string)ViewState["OrderDire"];
view.Sort=sort;
GridView1.DataSource=view;
GridView1.DataKeyNames=newstring[]{"m_id"};//主¡Â键¨¹
GridView1.DataBind();//调Ì¡Â用®?
绑㨮定¡§数ºy据Y函¡¥数ºy
//
//GridView1.DataBind();
sqlcon.Close();
}
protectedvoidButton2_Click(objectsender,EventArgse)
{
Response.Redirect("add.aspx");
}
添加收支界面
图4
相关代码:
protectedvoidbtn_submit_Click(objectsender,EventArgse)
{
if(Page.IsValid)
{
MySqlConnectioncn=newMySqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["dsn"].ConnectionString);
if(cn.State==ConnectionState.Closed)
cn.Open();
MySqlCommandcmd=newMySqlCommand();
cmd.Connection=cn;
cmd.CommandText="insertintoshouzhi(A_date,A_type,A_name,A_number,A_account)values('"+Convert.ToString(Label1.Text)
+"','"+Convert.ToString(DropDownList1.Text)
+"','"+Convert.ToString(TextBox1.Text)
+"','"+Convert.ToString(TextBox2.Text)
+"','"+Convert.ToString(TextBox3.Text)+"')";//"','"+convert.toint32(textbox4.text)+
cmd.ExecuteNonQuery();
cn.Close();
Thread.Sleep(1000);
this.lbl_message.Text="登Ì?
记?
成¨¦功|";
Thread.Sleep(1000);
//System.Threading.Thread.Sleep(3000);//挂¨°起e3秒?
Response.Redirect("shouzhi.aspx");
}
统计界面
图5
相关代码:
protectedvoidbtn_submit_Click(objectsender,EventArgse)
{
stringselect="";
stringstr1="",str2="";
if(DropDownList1.Text.ToString()=="收º?
入¨?
")
{
select="收º?
入¨?
";
str1=TextBox3.Text;
str2=TextBox4.Text;
Sum1(select,str1,str2);
}
if(DropDownList1.Text.ToString()=="支¡ì出?
")
{
select="支¡ì出?
";
Sum2(select,str1,str2);
}
}
protectedvoidSum1(stringselect,stringselect1,stringselect2)
{
MySqlConnectioncn=newMySqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["dsn"].ConnectionString);
if(cn.State==ConnectionState.Closed)
cn.Open();
stringmysql="selectsum(A_number)fromshouzhiwhereA_type='"+select+"'andA_date>'"+select1+"'andA_date<'"+select2+"'";
MySqlCommandcm=newMySqlCommand(mysql,cn);
cm.CommandText=mysql;//"selectcount(A_number)fromshouzhiwhereA_type="+select+"'";
TextBox1.Text=cm.ExecuteScalar().ToString();
stringmysql1="selectcount(A_number)fromshouzhiwhereA_type='"+select+"'andA_date>'"+select1+"'andA_date<'"+select2+"'";
MySqlCommandcm1=newMySqlCommand(mysql1,cn);
cm1.CommandText=mysql1;
TextBox2.Text=cm1.ExecuteScalar().ToString();
}
protectedvoidSum2(stringselect,stringselect1,stringselect2)
{
TextBox1.Text="0";
MySqlConnectioncn=newMySqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["dsn"].ConnectionString);
if(cn.State==ConnectionState.Closed)
cn.Open();
stringmysql="selectsum(A_number)fromshouzhiwhereA_type='"+select+"'andA_date>'"+select1+"'andA_date<'"+select2+"'";
MySqlCommandcm=newMySqlCommand(mysql,cn);
cm.CommandText=mysql;//"selectcount(A_number)fromshouzhiwhereA_type="+select+"'";
TextBox1.Text=cm.ExecuteScalar().ToString();
stringmysql1="selectcount(A_number)fromshouzhiwhereA_type='"+select+"'andA_date>'"+select1+"'andA_date<'"+select2+"'";
MySqlCommandcm1=newMySqlCommand(mysql1,cn);
cm1.CommandText=mysql1;
TextBox2.Text=cm1.ExecuteScalar().ToString();;
}
密码修改界面
图6
相关代码:
protectedvoidButton1_Click(objectsender,EventArgse)
{
MySqlConnectioncn=newMySqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["dsn"].ConnectionString);
if(cn.State==ConnectionState.Closed)
cn.Open();
stringmysql="updateussersetupassword='"+t_password2.Text+"'whereuname='"+t_name.Text+"'";
MySqlCommandcm=newMySqlCommand(mysql,cn);
//////////////打䨰开a数ºy据Y流¢¡Â
MySqlDataReaderdr=null;
dr=cm.ExecuteReader();
lbl_message.Text="恭¡ì喜2您¨²,ê?
修T改?
成¨¦功|!
ê?
";
cn.Close();
}
备份界面
图7
相关代码:
privatevoidTEST1()
{
stringstrt="";
try
{
FolderBrowserDialogfolderBrowserDialog1=newFolderBrowserDialog();
folderBrowserDialog1.RootFolder=Environment.SpecialFolder.Desktop;
//设¦¨¨置?
当Ì¡À前¡ã选?
择?
的Ì?
路¡¤径?
folderBrowserDialo