数据库课程设计报告---银行个人储蓄管理系统.doc_第1页
数据库课程设计报告---银行个人储蓄管理系统.doc_第2页
数据库课程设计报告---银行个人储蓄管理系统.doc_第3页
数据库课程设计报告---银行个人储蓄管理系统.doc_第4页
数据库课程设计报告---银行个人储蓄管理系统.doc_第5页
免费预览已结束,剩余13页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

河河 北北 联联 合大合大 学学 数据库课程设计说明书 设计题目 设计题目 银行个人储蓄管理系统银行个人储蓄管理系统 姓姓 名 名 姚飞姚飞 学学 号 号 200913030207 专专 业 业 地理信息系统地理信息系统 班班 级 级 09 地信地信 2 班班 指导教师 指导教师 矿业工程学院矿业工程学院 2011 年年 1 月月 4 日日 河北联合大学课程设计说明书 交通与测绘学院1 目目 录录 1 概述概述 3 2 需求分析需求分析 3 3 结构设计结构设计 4 4 行为设计行为设计 4 5 系统开发流程系统开发流程 6 6 系统使用说明及主要代码系统使用说明及主要代码 7 6 1 登陆界面代码 7 6 2 主界面代码 8 6 3 存款界面代码 10 6 4 开户界面代码 11 6 5 信息备份界面代码 13 6 6 信息还原界面代码 15 6 7 模糊界面代码 17 7 课程设计体会及心得课程设计体会及心得 17 8 参考文献参考文献 18 河北联合大学课程设计说明书 交通与测绘学院2 1 概述概述 银行关系到家家户户的重要储蓄信息 银行管理系统必然会涉及大量的数字 处理 所以用数据库设计刚刚好 能够更好更方便的处理 2 需求分析需求分析 需求分析是收集和分析用户对系统的信息需求和处理要素 得到设计所需的 需求信息 这些信息是选择了对数据库设计直接有用的信息 一班包裹实体类 联系类 数据的使用要求和冲突表等方面的内容 下面则为从程序设计过程中分别对程序的需求分析和数据库的需求分析结合 进行的讨论 首先 系统包含了用户的各种信息 为了维护和避免用户的资料被意外泄漏 或删除 系统内部建立了管理员和用户两种权限 管理员有添加 删除用户的权 限 A 用户功能 1 存款 对卡号以及密码进行验证以后 进行存款操作 2 取款 对卡号以及密码进行验证以后 进行取款操作 3 转账 对卡号以及密码进行验证以后 判断转账号是否正确进行转账 操作 4 余额查询 对卡号以及密码进行验证以后 查询该卡号的金额 5 透支 对卡号以及密码进行验证以后 在透支额度内进行透支操作 B 管理员功能是在用户功能的基础上增加的几项功能 1 开户 让客户填写各类相关信息并存入一定金额后 在数据库里面 增加上用户的信息 2 销户 在征得用户同意后 对用户信息进行删除 河北联合大学课程设计说明书 交通与测绘学院3 3 模糊查询 对不完整的卡号信息进行查询 从而得到想要信息 4 备份 对当前的信息进行备份 以防丢失 5 还原 在数据遭到破坏后 用以前的备份进行还原 3 结构设计结构设计 数据库概念结构设计 E R 模型 银行卡 用户收入用户类型 密码 拥有 用户 操作 转账 操作 透支 卡号卡号 透支金额透支日期转向卡号转账金额 金额 卡号 卡类型 透支额度 4 行为设计行为设计 本系统的主要任务是对银行工作人员 用户资金进行相关的操作管理 本系 统需要完成的功能主要有 1 登陆界面 2 用户存取款 转账 透支 密码修改功能 3 管理员开户销户 客户信息查询 备份还原功能 河北联合大学课程设计说明书 交通与测绘学院4 绘制功能图如下 银行管理系统 退出系统 管理员功能 用户功能 登录 取款 余额查询 更改密码 转账 开户 销户 透支 存款 用户信息查询 信息备份 信息还原 河北联合大学课程设计说明书 交通与测绘学院5 5 系统开发流程系统开发流程 用户登陆界面 主窗体 用户功能管理员特有功能 存取款转账功能查询功能添加删除备份还原 用户成功进入 登录 界面后 进如 主窗体 界面 根据每一个功能选项 按照里面编辑的一步一步的编辑即可 河北联合大学课程设计说明书 交通与测绘学院6 6 系统使用说明及主要代码系统使用说明及主要代码 6 1 登陆界面代码 private void button1 Click object sender EventArgs e if textBox1 Text textBox2 Text comboBox1 Text MessageBox Show 输入信息不完整 请重新输入 信息提示 MessageBoxButtons OK MessageBoxIcon Information else string Constr data source demon pc database 银行管理系统 trusted connection true SqlConnection con new SqlConnection Constr string Sqlstr select 用户名 密码 用户类型 from 用户 where 用户名 textBox1 Text and 密码 textBox2 Text and 用户类型 comboBox1 Text Program strname textBox1 Text Program quanxian comboBox1 Text SqlDataAdapter ada new SqlDataAdapter Sqlstr con DataTable dt new DataTable ada Fill dt int i dt Rows Count if i 1 this Hide Form2 main new Form2 main ShowDialog else MessageBox Show 用户名或密码不正确或角色不匹配 请重新输入 信息提示 MessageBoxButtons OK MessageBoxIcon Information 河北联合大学课程设计说明书 交通与测绘学院7 private void button2 Click object sender EventArgs e this Close Application Exit 6 2 主界面代码 public partial class Form2 Form public Form2 InitializeComponent private void Form2 Load object sender EventArgs e if Program quanxian 用户 this 管理员功能ToolStripMenuItem Enabled false private void 退出系统ToolStripMenuItem Click object sender EventArgs e Application Exit private void 更改密码ToolStripMenuItem Click object sender EventArgs e mima myfo new mima myfo Show private void 开户ToolStripMenuItem Click object sender EventArgs e 河北联合大学课程设计说明书 交通与测绘学院8 kaihu myfo new kaihu myfo Show private void 余额查询ToolStripMenuItem Click object sender EventArgs e yuechaxun myfo new yuechaxun myfo Show private void 转账业务ToolStripMenuItem Click object sender EventArgs e zhuanzhang myfo new zhuanzhang myfo Show private void 销户ToolStripMenuItem Click object sender EventArgs e zhuxiao myfo new zhuxiao myfo Show private void 存款ToolStripMenuItem Click object sender EventArgs e cunkuan myfo new cunkuan myfo Show private void 取款ToolStripMenuItem Click object sender EventArgs e qukuan myfo new qukuan myfo Show private void 客户信息查询ToolStripMenuItem Click object sender EventArgs e yonghuxinxichaxun myfo new yonghuxinxichaxun myfo Show private void 数据备份ToolStripMenuItem Click object sender EventArgs e yinhangxinxibenfen myfo new yinhangxinxibenfen myfo Show private void 数据还原ToolStripMenuItem Click object sender EventArgs e yinhangxinxihuanyuan myfo new yinhangxinxihuanyuan myfo Show private void 透支金额ToolStripMenuItem Click object sender EventArgs e touzhi myfo new touzhi myfo Show 河北联合大学课程设计说明书 交通与测绘学院9 6 3 存款界面代码 private void button1 Click object sender EventArgs e if textBox1 Text MessageBox Show 未输入卡号 请输入 信息提示 MessageBoxButtons OK MessageBoxIcon Information return if textBox2 Text MessageBox Show 未输入存款金额 请输入 信息提示 MessageBoxButtons OK MessageBoxIcon Information return if MessageBox Show 是否确认存款 信息提示 MessageBoxButtons YesNo DialogResult Yes string Constr data source demon database 银行管理系统 trusted connection true SqlConnection con new SqlConnection Constr string sql update 银行卡 set 金额 金额 this textBox2 Text where 卡号 this textBox1 Text SqlCommand mycomm new SqlCommand sql con con Open mycomm ExecuteNonQuery con Close MessageBox Show 存款成功 信息提示 MessageBoxButtons OK MessageBoxIcon Information 河北联合大学课程设计说明书 交通与测绘学院10 6 4 开户界面代码 private void button1 Click object sender EventArgs e if textBox2 Text textBox3 Text textBox4 Text comboBox1 Text MessageBox Show 请将信息输入完整 信息提示 MessageBoxButtons OK MessageBoxIcon Information return if textBox3 Text textBox4 Text MessageBox Show 两次输入的密码不一致 请重新输入 信息提示 MessageBoxButtons OK MessageBoxIcon Information else 河北联合大学课程设计说明书 交通与测绘学院11 try string Constr data source demon pc database 银行管理系统 trusted connection true SqlConnection con new SqlConnection Constr string sql insert into 用户 用户名 密码 用户收入 用户类型 values this textBox2 Text Trim this textBox3 Text Trim this textBox5 Text Trim boBox1 Text Trim SqlCommand mycomm new SqlCommand sql con con Open mycomm ExecuteNonQuery con Close MessageBox Show 用户已经正确添加 信息提示 kaihu2 myfo new kaihu2 myfo Show catch Exception MessageBox Show 用户已存在 警告 private void button3 Click object sender EventArgs e this Close private void button2 Click object sender EventArgs e textBox2 Text textBox3 Text textBox4 Text textBox5 Text comboBox1 Text 进一步完善条件代码 private void kaihu2 Load object sender EventArgs e private void button1 Click object sender EventArgs e if textBox1 Text textBox2 Text textBox3 Text textBox4 Text textBox5 Text textBox6 Text MessageBox Show 请将信息输入完整 信息提示 MessageBoxButtons OK MessageBoxIcon Information return try string Constr data source demon pc database 银行管理系统 trusted connection true SqlConnection con new SqlConnection Constr 河北联合大学课程设计说明书 交通与测绘学院12 string sql insert into 银行卡 用户名 卡号 卡类型 金额 透支额度 贷款额度 values this textBox1 Text Trim this textBox2 Text Trim this textBox3 Text Trim this textBox4 Text Trim this textBox5 Text Trim this textBox6 Text Trim SqlCommand mycomm new SqlCommand sql con con Open mycomm ExecuteNonQuery con Close MessageBox Show 用户已经正确添加 信息提示 catch Exception MessageBox Show 用户已存在 警告 6 5 信息备份界面代码 private void button2 Click object sender EventArgs e this Close private void button1 Click object sender EventArgs e try if textBox1 Text Trim textBox2 Text Trim comboBox1 Text Trim MessageBox Show 请输入完整的备份信息 警告 MessageBoxButtons OK MessageBoxIcon Exclamation 河北联合大学课程设计说明书 交通与测绘学院13 else string myFilePath textBox2 Text Trim textBox1 Text Trim bak if File Exists myFilePath string Constr data source demon pc database 银行管理系统 trusted connection true SqlConnection con new SqlConnection Constr con Open SqlCommand com new SqlCommand com CommandText BACKUP DATABASE comboBox1 Text Trim TO DISK myFilePath com Connection con com ExecuteNonQuery con Close MessageBox Show 数据库备份成功 提示信息 MessageBoxButtons OK MessageBoxIcon Exclamation this Close else MessageBox Show 数据文件已存在 请重命名 提示信息 MessageBoxButtons OK MessageBoxIcon Exclamation catch Exception ex MessageBox Show 数据库备份失败 ex ToString 警告 MessageBoxButtons OK MessageBoxIcon Exclamation private void button3 Click object sender EventArgs e if folderBrowserDialog2 ShowDialog DialogResult OK textBox2 Text folderBrowserDialog2 SelectedPath private void yinhangxinxibenfen Load object sender EventArgs e string Constr data source demon pc database 银行管理系统 trusted connection true SqlConnection con new SqlConnection Constr con Open if con State ConnectionState Open SqlCommand com new SqlCommand sp helpdb con SqlDataReader myread com ExecuteReader while myread Read comboBox1 Items Add myread 0 ToString comboBox1 SelectedIndex 0 myread Close com Dispose 河北联合大学课程设计说明书 交通与测绘学院14 else con Close 6 6 信息还原界面代码 private void yinhangxinxihuanyuan Load object sender EventArgs e string Constr data source demon pc database 银行管理系统 trusted connection true SqlConnection con new SqlConnection Constr con Open if con State ConnectionState Open SqlCommand com new SqlCommand sp helpdb con SqlDataReader myread com ExecuteReader while myread Read comboBox1 Items Add myread 0 ToString comboBox1 SelectedIndex 0 myread Close com Dispose else con Close con Close private void button3 Click object sender EventArgs e this Close private void button1 Click object sender EventArgs e if openFileDialog2 ShowDialog DialogResult OK textBox1 Text openFileDialog2 FileName 河北联合大学课程设计说明书 交通与测绘学院15 private void button2 Click object sender EventArgs e if comboBox1 Text Trim textBox1 Text Trim MessageBox Show 请输入完整的还原信息 警告 MessageBoxButtons OK MessageBoxIcon Exclamation else string path textBox1 Text Trim string dbname comboBox1 Text Trim string Constr data source demon pc database 银行管理系统 trusted connection true string Constr2 use master restore database dbname from disk path string single alter database dbname set single user with rollback immediate Constr2 using SqlConnection con new SqlConnection Constr con Open try SqlCommand cmd new SqlCommand single con cmd Connection con cmd ExecuteNonQuery MessageBox Show 还原数据成功 catch Exception ex MessageBox Show 数据库还原失败 ex ToString 警告 MessageBoxButtons OK MessageBoxIcon Exclamation finally con Close 河北联合大学课程设计说明书 交通与测绘学院16 6 7 模糊界面代码 private void button1 Click object sender EventArgs e if textBox1 Text MessageBox Show 请将信息输入完整 信息提示 MessageBoxButtons OK MessageBoxIcon Information return string Constr data source demon pc database 银行管理系统 trusted connection true SqlConnection con new SqlConnection Constr string Sqlstr select from 银行卡 where 卡号 like textBox1 Text SqlCommand mycon new SqlCommand Sqlstr con con Open SqlDataReader myreader mycon ExecuteReader DataTable dt new DataTable dt Columns Add new DataColumn 用户名 typeof string dt Columns Add new DataColumn 卡号 typeof string dt Columns Add new DataColumn 卡类型 typeof string dt Columns Add new DataColumn 金额 typeof string dt Columns Add new DataColumn 透支额度 typeof string dt Columns Add new DataColumn 贷款额度 typeof string while myreader Read DataRow dr dt New

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论