




已阅读5页,还剩13页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
此文档收集于网络,如有侵权,请联系网站删除辽宁工程技术大学数据库课程设计教学单位 营销管理学院 专 业 信息管理与信息系统(电子商务) 班 级 电子商务09-1班 学生姓名 学 号 指导教师 营 销 管 理 学 院2011年7月辽宁工程技术大学数据库课程设计数据库课程设计街道管理信息系统一、 系统总体设计一个能够被街道办事人员采用的街道管理信息系统,是应该能够增加工作效率,使得工作系统化,规范化。当某个楼某单元某户进出入一个人时要通过街道管理信息系统及时输入或删除相应的记录,使工作简洁,一目了然。通过对用户应用的环境,以及要求的分析,系统的需求主要有以下几个方面:1、 数据需求:要求数据库中的数据完整、同步,全面反映人员信息、单元信息、整栋楼的信息乃至整个楼区的信息。2、 功能需求:一个单独的管理信息系统,可以实现对人员的详细信息进行添加、删除、修改等功能,并且还应具有对某户家庭的添加、删除、修改等功能,最重要的功能也就是该系统的最重要的功能就是通过输入某个信息能够用最短的时间搜索出相关的信息。二、 数据库设计 此管理信息系统包含4个表,分别为小区楼号表,楼的单元号表,个人基本信息表,小区楼号表:小区名称、create table 小区楼号(小区名称varchar(50)insert into 小区楼号values(美星花园)insert into 小区楼号values(蜀香家园)楼的单元号:楼号、单元号,门牌号create table 楼的单元号(小区名称varchar(50), 楼号varchar(10), 单元号varchar(10), 门牌号varchar(10) )个人基本信息表:小区名称、楼号、单元号、门牌号、姓名、性别、年龄、民族、政治面貌、工作单位三、 各个表的基本结构小区楼号表列名数据类型可否为空备注小区名称Varchar(10)Not null主键楼的单元号表列名数据类型可否为空备注楼号Varchar(2)Not null外键单元号Char(2)Not null外键门牌号Char(3)Not null外键个人基本信息表列名数据类型可否为空备注小区名称Varchar(10)Not null外键楼号Varchar(2)Not null外键单元号Char(2)Not null外键门牌号Char(3)Not null外键姓名IntNot null主键性别IntNot null民族Int年龄Varchar(10)Not null政治面貌Int工作单位Int四、ER图 楼号 单元号 门牌号 楼号 单元号 门牌号 小区楼号表 年龄 个人基本信息表 小区名称 姓名 性别 民族 工作单位 小区名称 小区名称表四、 代码登陆窗口:精品文档using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace 街道管理信息系统 public partial class Form4 : Form public Form4() InitializeComponent(); textBox1.Text = sa; textBox2.Text = 123456; private void button1_Click(object sender, EventArgs e) SqlConnection conn = new SqlConnection(Data source=.;initial catalog=楼道信息管理;user ID=sa;password=123456); conn.Open(); SqlCommand cmd = new SqlCommand(select * from users where 用户名= + textBox1.Text + and 密码= + textBox2.Text + , conn); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read() MessageBox.Show(恭喜登录验证通过!); this.Close(); this.DialogResult = DialogResult.OK; else/怎样关闭登录窗口,同时不打开主界面 MessageBox.Show(你的用户名或密码错误!); return; private void button2_Click(object sender, EventArgs e) this.Close(); this.DialogResult = DialogResult.Cancel; private void Form4_Load(object sender, EventArgs e) Form1:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Data.SqlClient; namespace 街道管理信息系统 public partial class Form1 : Form public Form1() InitializeComponent(); private void button1_Click(object sender, EventArgs e) SqlConnection conn = new SqlConnection(Data source=.;Initial Catalog=楼道信息管理;User ID=sa;password=123456); conn.Open(); SqlCommand cmd = new SqlCommand(Select 小区名称 from 小区楼号 where 小区名称= + comboBox1.Text + , conn); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read() MessageBox.Show(登陆成功); this.DialogResult = DialogResult.OK; else MessageBox.Show(密码错误,登录失败!); conn.Close(); Form2 f = new Form2(); f.Show(); private void button2_Click(object sender, EventArgs e) this.Close(); private void Form1_Load(object sender, EventArgs e) Form2:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace 街道管理信息系统 public partial class Form2 : Form SqlConnection conn; DataSet ds; public Form2() InitializeComponent(); private void showdata() string str = Data Source=.;Initial Catalog=楼道信息管理;User ID=sa;Password=123456; conn = new SqlConnection(str); SqlDataAdapter da = new SqlDataAdapter(select * from 个人基本信息, conn); ds = new DataSet(); da.Fill(ds, stu); dataGridView1.DataSource = ds.Tablesstu; dataGridView1.Columns2.Width = 50; dataGridView1.Columns3.Width = 50; private void Student_Load(object sender, EventArgs e) showdata(); private void button1_Click(object sender,EventArgs e) SqlConnection conn = new SqlConnection(Data source=.;initial catalog=楼道信息管理;user ID=sa;password=123456); conn.Open(); SqlCommand cmd = new SqlCommand(select 楼号 from 楼的单元号 where 楼号= + comboBox2 + , conn); string str = Select distinct(姓名),性别,民族,年龄,政治面貌,工作单位 from 个人基本信息 where ; if (checkBox1.Checked) str += 楼号= + comboBox2.Text + and ; if (checkBox2.Checked) str += 单元号= + comboBox3.Text + and ; if (checkBox3.Checked) str += 门牌号= + comboBox4.Text + ; else str = str.Substring(0, str.Length - 4); dataGridView1.DataSource = 0; SqlConnection conm = new SqlConnection(Data Source=.;Initial Catalog=楼道信息管理;User Id=sa; Password=123456); SqlDataAdapter myAdapter = new SqlDataAdapter(str, conn); DataSet myDataSet = new DataSet(); myAdapter.Fill(myDataSet, a); dataGridView1.DataSource = myDataSet.Tablesa; conn.Close(); private void botton1_Click(object sender,EventArgs e) SqlConnection conn = new SqlConnection(Data source=.;initial catalog=楼道信息管理;user ID=sa;password=123456); conn.Open(); SqlCommand cmd = new SqlCommand(select 单元号 from 楼的单元号 where 单元号= + comboBox3 + , conn); conn.Close(); private void botton1_click(object sender, EventArgs e) SqlConnection conn = new SqlConnection(Data source=.;initial catalog=楼道信息管理;user ID=sa;password=123456); conn.Open(); SqlCommand cmd = new SqlCommand(select 门牌号 from 楼的单元号 where 门牌号= + comboBox4 + , conn); conn.Close(); private void button2_Click_1(object sender, EventArgs e) SqlConnection conn = new SqlConnection(Data Source=.; Initial Catalog=楼道信息管理; User ID=sa; Password=123456); conn.Open(); string str = insert into 个人基本信息 values( + textBox1.Text + , + textBox10.Text + , + textBox9.Text + , + textBox8.Text + , + textBox3.Text + ,+textBox4.Text +,+textBox6.Text +,+textBox2.Text +,+textBox5.Text +,+textBox7.Text +); SqlCommand cmd = new SqlCommand(str, conn); cmd.ExecuteNonQuery(); conn.Close(); MessageBox.Show(添加成功!); private void dataGridView1_CellContentClick(object sender, EventArgs e) string str = dataGridView1.SelectedRows0.Cells0.Value.ToString(); textBox2.Text = dataGridView1.SelectedRows0.Cells1.Value.ToString(); textBox3.Text = dataGridView1.SelectedRows0.Cells2.Value.ToString(); textBox5.Text = dataGridView1.SelectedRows0.Cells3.Value.ToString(); textBox4.Text = dataGridView1.SelectedRows0.Cells4.Value.ToString(); textBox6.Text = dataGridView1.SelectedRows0.Cells5.Value.ToString(); private void button3_Click_1(object sender, EventArgs e) if (MessageBox.Show(确定要删除该学生吗?, 提示, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2) != DialogResult.Yes) return; string 姓名 = dataGridView1.SelectedRows0.Cells0.Value.ToString(); / MessageBox.Show(name); SqlConnection conn = new SqlConnection(Data source=.;Initial Catalog=楼道信息管理;User ID=sa;password=123456); conn.Open(); SqlCommand cmd = new SqlCommand(delete from 个人基本信息 where 姓名= + dataGridView1.SelectedRows0.Cells0.Tag + , conn); cmd.ExecuteNonQuery(); conn.Close(); MessageBox.Show(删除成功!); private void button4_Click_1(object sender, EventArgs e) string sql = select * from 个人基本信息; SqlDataAdapter
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 科普大篷车活动策划方案
- 慈溪户外拓展活动策划方案
- 渤海石油安全救生培训课件
- 揭阳绿化边坡施工方案
- 乡村振兴风貌管控动态监测方案
- 测绘法培训课件
- 数字化转型下的职业教育:2025年虚拟现实技术应用报告
- 测小灯泡电阻课件
- 波斯猫找快乐课件
- 高层建筑防雷方案设计
- 广西贺州市八步区公道冲钾长石矿采矿权出让收益率评估报告
- 中国人民抗日战争纪念馆面向社会公开招聘工作人员模拟检测试卷【共1000题含答案解析】
- 高考688个高频词汇 word版
- 农副产品购销合同完整版(2篇)
- GB/T 9115.4-2000环连接面对焊钢制管法兰
- 一年级数学上册左、右练习题及答案解析
- GB 9743-1997轿车轮胎
- 小学语文口语交际教学讲座PPT
- 上海建筑装饰集团发展战略报告(doc 30)
- 《基础统计》教学案例“郑州市大瓶装纯水市场调查”统计应用案例
- DB36_T 1157-2019 瓷土、瓷石矿产地质勘查规范(高清无水印-可复制)
评论
0/150
提交评论