软件工程课程设计-宾馆信息管理系统-参考模板
软件工程课程设计-宾馆客房管理系统

软件工程课程设计-宾馆客房管理系统《软件工程》课程设计报告宾馆客房管理系统指导教师: 班级: 0701 学生姓名:学号: 2007100104完成日期:2010-11—11运城学院计算机科学与技术系宾馆客房管理系统目录1。
业务需求。
.。
....。
.。
..。
..。
.。
....。
..。
..。
.。
.....。
..。
.。
..。
...。
.。
..。
..。
..。
..。
.。
.。
..。
.。
....。
...。
.. 11.1客户任务描述 .。
.。
.。
..。
.。
..。
..。
.。
....。
..。
..。
.。
.。
.。
.。
..。
.。
.。
.。
.。
.。
..。
..。
.。
..。
.。
..。
.。
...。
11.2参与者列表。
.。
.。
..。
.....。
...。
.。
.。
.。
.。
.。
.....。
.。
.。
.........。
.。
......。
.。
......。
..。
..。
.。
...21。
3业务用例列表 ..。
....。
.。
...。
.。
.。
....。
....。
.....。
..。
...。
.。
..。
.....。
.。
.。
...。
.。
.。
.。
...。
21.4业务用例活动图 ..。
.。
..。
..。
.。
.。
..。
.。
.。
..。
..。
.。
......。
..。
..。
..。
.。
.。
......。
.。
..。
21.5 业务用例描述。
.。
..。
.。
..。
.。
..。
.。
.......。
.。
.。
.。
.。
.....。
..。
.。
.。
.。
..。
...。
.。
..。
.。
..。
....。
.。
.. 3 2(系统需求.。
..。
....。
......。
.。
.。
.。
..。
........。
.。
.。
.。
.。
.。
.......。
.。
.。
.。
.。
...。
.。
.。
..。
.。
.。
.。
.。
....。
42.1 用户界面草图 .。
...。
..。
.。
..。
.。
.....。
.。
.。
..。
...。
...。
..。
.... .。
.。
.。
....。
....。
..。
..。
.。
..。
42.2 参与者列表 .。
.。
..。
软件工程课程设计-宾馆客房管理系统

软件工程课程设计-宾馆客房管理系统《软件工程》课程设计报告宾馆客房管理系统指导教师: 班级: 0701 学生姓名:学号: 2007100104完成日期:2010-11-11运城学院计算机科学与技术系宾馆客房管理系统目录1. 业务需求 ..................................................................... (1)1.1客户任务描述 ..................................................................... (1)1.2参与者列表 ..................................................................... . (2)1.3业务用例列表 ..................................................................... (2)1.4业务用例活动图 ..................................................................... . (2)1.5 业务用例描述 ..................................................................... ....................... 3 2(系统需求...................................................................... (4)2.1 用户界面草图 ..................................................................... .. (4)2.2 参与者列表 ..................................................................... (4)2.3 用例列表 ..................................................................... . (4)2.4 用例图 ..................................................................... .. (5)2.5 用例概述 ..................................................................... ............................... 6 3(系统分析...................................................................... (6)3.1 分析类图 ..................................................................... . (7)3.2 活动图/状态转移图 ..................................................................... .. (7)3.3 分析模型 ..................................................................... . (9)4(详细设计...................................................................... . (15)5.实现及测试 ..................................................................... . (21)5.1 实现平台的搭建 ..................................................................... .. (21)5.2 功能测试 ..................................................................... .. (21)6.小结 ..................................................................... ................................................ 23 7.参考文献 ..................................................................... . (24)1. 业务需求1.1客户任务描述该系统由接待人员和经理使用,各自职责如下:接待人员 :1.按多种属性查询客房或客人情况2.为客人预订房间3.登记客人入住情况4.为客人办理离店手续并生成结账报表5.为客人办理续费手续经理:1.按多种属性查询客房或客人情况2.汇总客房和客人情况3.调整房价4.增减房间1宾馆客房管理系统 1.2参与者列表接待人员:对顾客入住进行管理,系统的使用者经理:宾馆的总体管理者,也是系统的使用者客人:住店的人1.3业务用例列表UC-1 经理登录:经理选择用户类型,填入用户名和密码登录 UC-2 按客人查询:经理根据客人ID或客人入住的时间来查询客人信息UC-3 按客房查询:经理查询当前客房的有关信息 UC-4 汇总:经理查看汇总的客房信息UC-5 修改密码:经理通过修改密码页面来修改密码 UC-6 修改权限:经理可以修改用户权限UC-7 接待员登录:经理选择用户类型,填入用户名和密码登录 UC-8 按客人查询:接待员根据客人ID或客人入住的时间来查询客人信息UC-9 按客房查询:接待员查询当前客房的有关信息 UC-10修改密码:接待员通过修改密码页面来修改密码 1.4业务用例活动图1、查询过程act 用例活动图按条件输入开始按客人查询按客房查询在数据库中查询信息[成功]图1.4.1 查询用例的活动图显示查询结果2、登录结束2宾馆客房管理系统act 用例活动图输入登录信息验证输入开始[合法][非法]主界面提示错误界面结束图1.4.2 登录用例活动图1.5 业务用例描述登录事件流:(1)用户选择进入管理界面、用例开始。
管理信息系统课程设计--旅店信息管理系统

辽宁工业大学管理信息系统设计课程设计报告(论文)题目:旅店信息管理系统的分析与设计院(系):软件学院专业班级:软件工程113班学号: 78学生姓名:安凯辰指导教师:王彦华教师职称:讲师起止时间:2012.5.28-2012.6.8课程设计(论文)任务及评语目录第1章系统分析 (1)1.1需求分析 (1)1.2可行性分析 (1)1.3系统业务流程图 (2)1.4系统数据流程图 (3)1.5数据字典 (4)第2章系统设计 (6)2.1数据库设计 (6)2.1.1概念设计 (6)2.1.2逻辑设计 (7)2.1.3物理设计 (8)2.2模块设计 (9)第3章系统实施 (11)3.1 系统后台数据库的实施 (11)3.1.1创建数据库 (11)3.1.2创建数据库表 (11)3.1.3创建存储过程 (12)3.2系统前台的实施 (12)第4章课设总结 (15)参考文献 (16)第1章系统分析1.1需求分析需求分析是从客户的需求中提取出软件系统能够帮助用户解决的业务问题,通过对用户业务问题的分析,规划出系统的功能模块,即定义用例。
经过开发者同客户的需求分析后,确定旅店客房管理系统的功能模块(用例)包括:用户信息维护、客房类型维护、客房信息维护、客房经营维护、客户信息维护、经营状况统计。
为了确保客户和旅店的信息具有更好的安全性,前台管理和后台管理是分离的。
前台的各管理模块需要经过权限授权才可以使用,前台服务员的主要职能是负责订房和退房,以及查询入住的客户信息。
所有该角色只可以使用部分功能,包括客房经营管理、客户信息查询、个人密码修改以及注销功能旅店的数据库包含8个表,即客户信息表Customer、客房类型表Room Type、客房信息表Room、客房预定信息表Order Room、预定客房登记表Order List、入住登记信息表Registration、实结房款信息表PayforRoom和用户信息表Users。
软件工程课程设计-宾馆信息管理系统

分类号编号华北水利水电大学North China University of Water Resources and Electric Power实验报告课程:软件工程实验项目2:软件编码与测试题目:宾馆管理信息系统院系信息工程学院专业计算机科学与技术班级学号201415717姓名李卫朋指导教师庄晋林2017年5 月29 日华北水利水电大学软件工程实验报告2016~2017学年第二学期2014 级计算机科学与技术专业一、实验内容:宾馆管理信息系统任务:入住或预订客房时,用户要对客户管理模块或预订管理模块进行核对审查,并进行登记;客户换房时,要对换房信息进行查询和更新;客户退房时,要进行结算,并对更新客房信息。
主要功能模块:(1)登录模块:对用户身份进行验证,只有合法用户才能进入系统;(2)系统管理模块:对系统用户进行管理,更改用户名、密码、权限等;(3)客房管理模块:对客房信息的添加、修改和删除等;(4)入住管理模块:对客户入住信息的登记、查询等功能(5)订房管理模块:对客户订房信息的登记、查询等。
(6)换房管理模块:对客户换房信息的登记、查询等(7)宾馆结算模块:对已入住宾馆的顾客进行结算及对订房客户已交的押金进行结算、查询。
二、程序源:Win7 64位电脑,vs2012编辑环境,sql2005数据库。
程序源码:1、登录设计:namespace宾馆管理信息系统{public partial class login1 : Form{public login1(){InitializeComponent();}private connection c = new connection();private void button1_Click(object sender, EventArgs e){if(textBox1.Text.Trim().ToString()!= String.Empty && textBox2.Text.Trim().ToString() != String.Empty) {string id = null, pw = null, gd = null;var result = from info in c.linq.loginwhere info.id == textBox1.Text.ToString().Trim()select new{ID = info.id,pw = info.password,gd = info.grade,};if (result.Count() == 0){MessageBox.Show("用户名不存在!");}else if (result.Count() == 1){foreach (var p in result){id = p.ID;pw = p.pw;gd = p.gd;}if (pw.Trim() == textBox2.Text.ToString().Trim()){this.Hide();manger lf = new manger(gd,textBox1.Text.Trim().ToString()); lf.Show();}else{MessageBox.Show("密码错误!");}}}else{MessageBox.Show("不能为空!");}}private void button2_Click(object sender, EventArgs e){this.Close();}private void login1_FormClosed(object sender, FormClosedEventArgs e){System.Environment.Exit(0);}}}2、添加住户设计namespace宾馆管理信息系统{public partial class addpeople : Form{private connection c = new connection();private string s;public addpeople(Form f,string s){this.Owner = f;InitializeComponent();this.s = s;//房间号comboBox1.DropDownStyle = boBoxStyle.DropDownList;}private void button1_Click(object sender, EventArgs e){if (textBox1.Text.Trim().ToString() != String.Empty && comboBox1.Text.Trim().ToString() != String.Empty && textBox3.Text.Trim().ToString() != String.Empty && textBox4.Text.Trim().ToString() != String.Empty){var result = from info in c.linq.roomwhere info.房间号码 == s.Trim().ToString()select new{房间号 = info.房间号码,房间类型 = info.房间种类,房间单价 = info.房间单价,房间是否使用 = info.房间是否正在使用,};foreach (var item in result){if (item.房间单价 <= int.Parse(textBox4.Text.Trim().ToString())){try{guest r = new guest();{r.住店人身份证号码 = textBox1.Text.Trim().ToString();r.姓名 = textBox2.Text.Trim().ToString();r.性别 = comboBox1.Text.Trim().ToString();r.所交押金 = int.Parse(textBox4.Text.Trim().ToString());r.人数 = textBox3.Text.Trim().ToString();r.房间号码 = s;r.入住天数 = 1;r.入住时间 = System.DateTime.Now.Day.ToString();}var edit = c.linq.room.SingleOrDefault<room>(s1 => s1.房间号码 == s.Trim().ToString());if (edit == null){return;}edit.房间是否正在使用 = "是";c.linq.guest.InsertOnSubmit(r);c.linq.SubmitChanges();//修改student的属性;MessageBox.Show(textBox2.Text.Trim().ToString() + " 入住成功");this.Close();}catch{MessageBox.Show("用户已存在!");}}else{MessageBox.Show("所交押金不足!");}}}else{MessageBox.Show("不能为空!");}}private void addpeople_FormClosed(object sender, FormClosedEventArgs e){this.Owner.Owner.Show();}}}3、添加房间设计:namespace宾馆管理信息系统{public partial class addroom : Form{public addroom(Form f){InitializeComponent();this.Owner = f;comboBox1.DropDownStyle = boBoxStyle.DropDownList;}private connection c = new connection();private void button1_Click(object sender, EventArgs e){if (textBox1.Text.Trim().ToString() != String.Empty && comboBox1.Text.Trim().ToString() != String.Empty && textBox3.Text.Trim().ToString() != String.Empty){try{room r = new room();{r.房间号码 = textBox1.Text.Trim().ToString();r.房间种类 = comboBox1.Text.Trim().ToString();r.房间单价 = double.Parse( textBox3.Text.Trim().ToString());r.房间是否正在使用 = "否";}c.linq.room.InsertOnSubmit(r);c.linq.SubmitChanges();MessageBox.Show(textBox1.Text.Trim().ToString()+" 号房间添加成功");this.textBox1.Text = null;this.textBox3.Text = null;boBox1.Text = null;this.textBox1.Focus();}catch{MessageBox.Show("房间号已存在!");}}else{MessageBox.Show("不能为空!");}}private void addroom_FormClosed(object sender, FormClosedEventArgs e){this.Owner.Show();}private void button2_Click(object sender, EventArgs e){this.Close();}}}4、查看所有房间信息设计:namespace宾馆管理信息系统{public partial class allroom : Form{private connection c=new connection ();public allroom(Form f){InitializeComponent();this.Owner = f;this.listView1.Clear();this.listView1.View = rgeIcon;rgeImageList = this.imageList1;Random rd = new Random();this.listView1.BeginUpdate();var result = from info in c.linq.roomselect new{房间号 = info.房间号码,房间类型 = info.房间种类,房间单价 = info.房间单价,房间是否使用 = info.房间是否正在使用, };foreach (var item in result){ListViewItem lvi = new ListViewItem();if(item.房间是否使用.Trim()=="否"){lvi.ImageIndex =0;}else if (item.房间是否使用.Trim() == "是"){lvi.ImageIndex = 1;}lvi.Text = item.房间号.Trim().ToString();this.listView1.Items.Add(lvi);}this.listView1.EndUpdate();}private void listView1_ItemActivate(object sender, EventArgs e){var result = from info in c.linq.roomwhere info.房间号码 == listView1.FocusedItem.Text.Trim().ToString()select new{房间号 = info.房间号码,房间类型 = info.房间种类,房间单价 = info.房间单价,房间是否使用 = info.房间是否正在使用,};foreach (var item in result){DialogResult dr = MessageBox.Show("房间号:" + listView1.FocusedItem.Text.ToString() + "\r\n房间类型:" + item.房间类型 + "\r\n房间单价:" + item.房间单价);}}private void allroom_FormClosed(object sender, FormClosedEventArgs e){this.Owner.Show();}}}5、预订房间设计:namespace宾馆管理信息系统{public partial class bookroom : Form{private connection c = new connection();public bookroom(Form f){InitializeComponent();this.Owner = f;this.listView1.Clear();this.listView1.View = rgeIcon;rgeImageList = this.imageList1;Random rd = new Random();this.listView1.BeginUpdate();var result = from info in c.linq.roomwhere info.房间是否正在使用=="否"select new{房间号 = info.房间号码,房间类型 = info.房间种类,房间单价 = info.房间单价,房间是否使用 = info.房间是否正在使用,};foreach (var item in result){ListViewItem lvi = new ListViewItem();lvi.ImageIndex =0;lvi.Text = item.房间号.Trim().ToString();this.listView1.Items.Add(lvi);}this.listView1.EndUpdate();private void bookroom_FormClosed(object sender, FormClosedEventArgs e){this.Owner.Show();}private void listView1_ItemActivate(object sender, EventArgs e){var result = from info in c.linq.roomwhere info.房间号码 == listView1.FocusedItem.Text.Trim().ToString()select new{房间号 = info.房间号码,房间类型 = info.房间种类,房间单价 = info.房间单价,房间是否使用 = info.房间是否正在使用,};foreach (var item in result){DialogResult dr = MessageBox.Show("房间号:" + listView1.FocusedItem.Text.ToString() + "\r\n房间类型:"+item.房间类型+"\r\n房间单价:"+item.房间单价+"\r\n确认使用么?", "提示", MessageBoxButtons.OKCancel);if (dr == DialogResult.OK){//用户选择确认的操作addpeople a = new addpeople(this, listView1.FocusedItem.Text.Trim().ToString());this.Hide();a.Show();}}}}}6、查看所有用户设计:namespace宾馆管理信息系统{public partial class chakanyonghu : Form{private connection c = new connection();public chakanyonghu(Form f){this.Owner = f;InitializeComponent();var result = from info in c.linq.loginselect new{用户名 = info.id,用户类型 = info.grade,};dataGridView1.DataSource = result;}}}7、修改房间的信息设计:namespace宾馆管理信息系统{public partial class changeroom : Form{private connection c = new connection();public changeroom(Form f){InitializeComponent();this.Owner = f;var result = from info in c.linq.roomselect new{房间号 = info.房间号码,房间类型 = info.房间种类,房间单价 = info.房间单价,房间是否使用 = info.房间是否正在使用,};dataGridView1.DataSource = result;}private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) {string s = Convert.ToString(dataGridView1[0, e.RowIndex].Value).Trim();changeroom2 d = new changeroom2(this, s);d.Show();this.Hide();}private void button1_Click(object sender, EventArgs e){var result = from info in c.linq.roomselect new{房间号 = info.房间号码,房间类型 = info.房间种类,房间单价 = info.房间单价,房间是否使用 = info.房间是否正在使用,};dataGridView1.DataSource = result;}}}namespace宾馆管理信息系统{public partial class changeroom2 : Form{private connection c = new connection();private string s = null;public changeroom2(Form f,string s){InitializeComponent();comboBox1.DropDownStyle = boBoxStyle.DropDownList; comboBox2.DropDownStyle = boBoxStyle.DropDownList;this.Owner = f;this.s = s;var result = from info in c.linq.roomwhere info.房间号码==sselect new{房间号 = info.房间号码,房间类型 = info.房间种类,房间单价 = info.房间单价,房间是否使用 = info.房间是否正在使用,};foreach (var item in result){this.textBox2.Text = item.房间号;this.textBox1.Text = item.房间单价.ToString();boBox1.Text = item.房间类型;boBox2.Text = item.房间是否使用;}}private void button1_Click(object sender, EventArgs e){if(textBox1.Text.Trim().ToString() != String.Empty && textBox2.Text.Trim().ToString() != String.Empty && comboBox1.Text.Trim().ToString() != String.Empty && comboBox2.Text.Trim().ToString() != String.Empty){var edit = c.linq.room.SingleOrDefault<room>(s1=>s1.房间号码==s);if (edit == null){return;}//修改student的属性edit.房间单价= double .Parse( textBox1.Text.Trim().ToString());edit.房间种类 = comboBox1.Text.Trim().ToString();edit.房间是否正在使用 = comboBox2.Text.Trim().ToString();//执行更新操作c.linq.SubmitChanges();MessageBox.Show("房间信息修改成功");this.Close();}}}}8、删除用户信息设计:namespace宾馆管理信息系统{public partial class delete : Form{private string s;private connection c = new connection();public delete(Form f){InitializeComponent();this.Owner = f;var result = from info in c.linq.loginwhere info.grade=="普通用户"select new{用户名 = info.id,用户类型 = info.grade,};dataGridView1.DataSource = result;}private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) {s = Convert.ToString(dataGridView1[0, e.RowIndex].Value).Trim();delete2 d = new delete2(s,this );d.Show();this.Hide();}private void button2_Click(object sender, EventArgs e){var result = from info in c.linq.loginwhere info.grade == "普通用户"select new{用户名 = info.id,用户类型 = info.grade,};dataGridView1.DataSource = result;}}}namespace宾馆管理信息系统{public partial class delete2 : Form{private string h;private connection c = new connection();public delete2(string s,Form f){InitializeComponent();h = s;this.Owner = f;var result = from info in c.linq.loginwhere info.id == sselect new{用户名 = info.id,用户类型 = info.grade,};dataGridView1.DataSource = result;}private void button1_Click(object sender, EventArgs e) {var result = from m in c.linq.loginwhere m.id == hselect m;c.linq.login.DeleteAllOnSubmit(result);c.linq.SubmitChanges();MessageBox.Show("删除成功");this.Close();}}}9、删除房间信息设计:namespace宾馆管理信息系统{public partial class deleteroom : Form{private connection c = new connection();public deleteroom(Form f){InitializeComponent();this.Owner = f;var result = from info in c.linq.roomselect new{房间号 = info.房间号码,房间类型 = info.房间种类,房间单价=info.房间单价,房间是否使用=info.房间是否正在使用,};dataGridView1.DataSource = result;}private void button2_Click(object sender, EventArgs e) {var result = from info in c.linq.roomselect new{房间号 = info.房间号码,房间类型 = info.房间种类,房间单价 = info.房间单价,房间是否使用 = info.房间是否正在使用,};dataGridView1.DataSource = result;}private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) {string s = Convert.ToString(dataGridView1[0, e.RowIndex].Value).Trim();deleteroom2 d = new deleteroom2(this,s);d.Show();this.Hide();}}}namespace宾馆管理信息系统{public partial class deleteroom2 : Form{private connection c = new connection();private string h;public deleteroom2(Form f,string h){InitializeComponent();this.Owner = f;this.h = h;var result = from info in c.linq.roomwhere info.房间号码 == hselect new{房间号 = info.房间号码,房间类型 = info.房间种类,房间单价 = info.房间单价,房间是否使用 = info.房间是否正在使用,};dataGridView1.DataSource = result;}private void button1_Click(object sender, EventArgs e){var result = from m in c.linq.roomwhere m.房间号码 == hselect m;foreach (var item in result){if (item.房间是否正在使用.Trim().ToString() == "否"){c.linq.room.DeleteAllOnSubmit(result);c.linq.SubmitChanges();MessageBox.Show("删除成功");this.Close();}else{MessageBox.Show("该房间正在使用,请先退房!");}}}}}10、查看住户信息:namespace宾馆管理信息系统{public partial class guestmessage : Form{private connection c = new connection();public guestmessage(Form f){this.Owner = f;InitializeComponent();comboBox1.DropDownStyle = boBoxStyle.DropDownList;}private void button1_Click(object sender, EventArgs e){if (comboBox1.Text.Trim().ToString() != string.Empty && textBox1.Text.Trim().ToString() !=string.Empty){switch (comboBox1.Text.Trim().ToString()){case"房间号":var edit = c.linq.guest.SingleOrDefault<guest>(s1 => s1.房间号码.Trim() ==textBox1.Text.Trim().ToString());if (edit != null){MessageBox.Show("房间号:" + edit.房间号码 + "\t\n" + "人数:" + edit.人数 + "\t\n" + "入住天数:" + edit.入住天数 + "\t\n" + "押金:" + edit.所交押金 + "\t\n" + "姓名:" + edit.姓名 + "\t\n" + "身份证号码:" + edit.住店人身份证号码);}else{MessageBox.Show("房间为空!");}break;case"用户姓名":var edit1 = c.linq.guest.SingleOrDefault<guest>(s1 => s1.姓名.Trim() ==textBox1.Text.Trim().ToString());if (edit1 != null){MessageBox.Show("房间号:"+ edit1.房间号码 + "\t\n"+ "人数:" + edit1.人数 + "\t\n" + "入住天数:" + edit1.入住天数 + "\t\n" + "押金:" + edit1.所交押金 + "\t\n" + "姓名:" + edit1.姓名 + "\t\n" + "身份证号码:" + edit1.住店人身份证号码);}else{MessageBox.Show(textBox1.Text.Trim().ToString() + "不存在");}break;case"身份证号":var edit2 = c.linq.guest.SingleOrDefault<guest>(s1 => s1.住店人身份证号码.Trim() == textBox1.Text.Trim().ToString());if (edit2 != null){MessageBox.Show("房间号:"+ edit2.房间号码 + "\t\n"+ "人数:" + edit2.人数 + "\t\n" + "入住天数:" + edit2.入住天数 + "\t\n" + "押金:" + edit2.所交押金 + "\t\n" + "姓名:" + edit2.姓名 + "\t\n" + "身份证号码:" + edit2.住店人身份证号码);}else{MessageBox.Show(textBox1.Text.Trim().ToString() + "不存在");}break;}}else{MessageBox.Show("不能为空!");}}}}11、新用户注册namespace宾馆管理信息系统{public partial class login2 : Form{private connection c = new connection();public login2(){InitializeComponent();comboBox1.DropDownStyle = boBoxStyle.DropDownList;}public login2(Form f){InitializeComponent();this.Owner = f;comboBox1.DropDownStyle = boBoxStyle.DropDownList;}private void button1_Click(object sender, EventArgs e){if(textBox1.Text.Trim().ToString() != String.Empty && textBox2.Text.Trim().ToString() != String.Empty && textBox3.Text.Trim().ToString() != String.Empty && comboBox1.Text.Trim().ToString() != String.Empty){if (comboBox1.Text.Trim().ToString() == "管理员" || comboBox1.Text.Trim().ToString() == "普通用户"){if (this.textBox2.Text.Trim().ToString() == textBox3.Text.Trim().ToString()){try{login l = new login();{l.id = textBox1.Text.Trim().ToString();l.password = textBox2.Text.Trim().ToString();l.grade = comboBox1.Text.Trim().ToString();}c.linq.login.InsertOnSubmit(l);c.linq.SubmitChanges();MessageBox.Show("注册成功");}catch{MessageBox.Show("用户名已存在!");}}else{MessageBox.Show("请再次输入确定密码!");}}else{MessageBox.Show("请选择正确的用户类型!");boBox1.Focus();}}else{MessageBox.Show("不能为空!");}}}}12、主界面设计:namespace宾馆管理信息系统{public partial class manger : Form{private string i,j;//public manger(){InitializeComponent();}public manger(string i,string j){InitializeComponent();this.i = i;this.j = j;}private void button1_Click(object sender, EventArgs e) {this.Hide();login2 l = new login2(this);l.Show();}private void manger_Load(object sender, EventArgs e) {if (i.Trim().Equals("管理员")){this.panel1.Visible = true;this.panel2.Visible = true ;}else if (i.Trim().Equals("普通用户")){this.panel2.Visible = true;this.panel1.Visible = false;}}private void button3_Click(object sender, EventArgs e){this.Hide();delete l = new delete(this);l.Show();}private void manger_FormClosed(object sender, FormClosedEventArgs e) {System.Environment.Exit(0);}private void button4_Click(object sender, EventArgs e){this.Hide();chakanyonghu l = new chakanyonghu(this);l.Show();}private void button5_Click(object sender, EventArgs e){this.Hide();xiugaimima l = new xiugaimima(this, j);l.Show();}private void button6_Click(object sender, EventArgs e){this.Hide();addroom l = new addroom(this);l.Show();}private void button7_Click(object sender, EventArgs e){this.Hide();deleteroom l = new deleteroom(this);l.Show();}private void button8_Click(object sender, EventArgs e){this.Hide();changeroom l = new changeroom(this);l.Show();}private void button2_Click(object sender, EventArgs e){this.Hide();bookroom l = new bookroom(this);l.Show();}private void button9_Click(object sender, EventArgs e){this.Hide();unsubscribe l = new unsubscribe(this);l.Show();}private void button10_Click(object sender, EventArgs e){this.Hide();allroom l = new allroom(this);l.Show();}private connection c = new connection();private ArrayList arl = new ArrayList();private void button11_Click(object sender, EventArgs e){var result = from m in c.linq.guestselect m;foreach (var item in result){if (item.入住时间.Trim() != System.DateTime.Now.Day.ToString()){var edit = c.linq.room.SingleOrDefault<room>(s => s.房间号码 == item.房间号码);if (item.所交押金 >= (item.入住天数 + 1) * edit.房间单价){item.入住天数++;item.入住时间 = System.DateTime.Now.Day.ToString();c.linq.SubmitChanges();}else{try{exitroom r = new exitroom();{r.押金不足的房间号 = item.房间号码;}c.linq.exitroom.InsertOnSubmit(r);c.linq.SubmitChanges();}catch{}MessageBox.Show("请提醒"+item.房间号码+"号房的"+item.姓名+"退房或者续交房费"); }}}var result1 = from m in c.linq.exitroomselect m;dataGridView1.DataSource = result1;}private void button12_Click(object sender, EventArgs e){var result1 = from m in c.linq.exitroomselect m;dataGridView1.DataSource = result1;}private void button13_Click(object sender, EventArgs e){rejiaofei r = new rejiaofei(this);this.Hide();r.Show();}private void button14_Click(object sender, EventArgs e){guestmessage m = new guestmessage(this);this.Hide();m.Show();}private void button15_Click(object sender, EventArgs e){this.Close();}private void button16_Click(object sender, EventArgs e){this.Hide();login1 l = new login1();l.Show();}}}13、用户再次缴费:namespace宾馆管理信息系统{public partial class rejiaofei : Form{private connection c = new connection();public rejiaofei(Form f){InitializeComponent();this.Owner = f;}private void button1_Click(object sender, EventArgs e){try{var edit = c.linq.guest.SingleOrDefault<guest>(s1 => s1.房间号码.Trim() == this.textBox1.Text.Trim().ToString());edit.所交押金 = edit.所交押金 + int.Parse(textBox2.Text.Trim().ToString()); edit.入住天数++;edit.入住时间 = System.DateTime.Now.Day.ToString();var result3 = from m in c.linq.exitroomwhere m.押金不足的房间号 == textBox1.Text.Trim().ToString()select m;c.linq.exitroom.DeleteAllOnSubmit(result3);c.linq.SubmitChanges();MessageBox.Show("缴纳成功!");}catch{MessageBox.Show("缴纳失败,请核对房间号!");}}private void rejiaofei_FormClosed(object sender, FormClosedEventArgs e){this.Owner.Show();}}}15、退房设计:namespace宾馆管理信息系统{public partial class unsubscribe : Form{private connection c = new connection();public unsubscribe(Form f){this.Owner = f;InitializeComponent();}private void button1_Click(object sender, EventArgs e){if (textBox1.Text.Trim().ToString() != string.Empty){var result = from info in c.linq.roomwhere info.房间号码==textBox1.Text.Trim().ToString()select new{房间号 = info.房间号码,房间类型 = info.房间种类,房间单价 = info.房间单价,房间是否使用 = info.房间是否正在使用,};if (result.Count() == 0){MessageBox.Show("请输入正确的房间号!");this.textBox1.Focus();}else if (result.Count() == 1){foreach (var item in result){if (item.房间是否使用.Trim() == "是"){DialogResult dr = MessageBox.Show("房间号:" + textBox1.Text.ToString() + "\r\n确认退房么?", "提示", MessageBoxButtons.OKCancel);if (dr == DialogResult.OK){var result1 = from info in c.linq.guestwhere info.房间号码 == textBox1.Text.Trim().ToString()select new{房间号 = info.房间号码,入住天数 = info.入住天数,所交押金 = info.所交押金,姓名 = info.姓名,};foreach (var item1 in result1){double i = item1.入住天数 * item.房间单价;double j = item1.所交押金 - i;MessageBox.Show("入住天数:" + item1.入住天数 + "\t\n总押金:" + item1.所交押金 + "\t\n消费金额:" + i + "应找回:" + j);var edit = c.linq.room.SingleOrDefault<room>(s1 => s1.房间号码 ==textBox1.Text.Trim().ToString());if (edit == null){return;}edit.房间是否正在使用 = "否";//执行更新操作var result2 = from m in c.linq.guestwhere m.房间号码 == textBox1.Text.Trim().ToString()select m;var result3 = from m in c.linq.exitroomwhere m.押金不足的房间号 == textBox1.Text.Trim().ToString()select m;c.linq.exitroom.DeleteAllOnSubmit(result3);c.linq.guest.DeleteAllOnSubmit(result2);c.linq.SubmitChanges();MessageBox.Show("房号为"+item1.房间号+"的"+item1 .姓名+"退房成功!");this.Close();}}}else{MessageBox.Show("该房间并未订购!无法退订!");}}}}else{MessageBox.Show("请输入房间号!");this.textBox1.Focus();}}}}16、修改用户密码:namespace宾馆管理信息系统{public partial class xiugaimima : Form{private connection c=new connection ();private string i;public xiugaimima(Form f,string i){this.Owner = f;this.i = i;InitializeComponent();}private void button1_Click(object sender, EventArgs e){if(textBox1.Text.Trim().ToString() != String.Empty && textBox2.Text.Trim().ToString() != String.Empty && textBox3.Text.Trim().ToString() != String.Empty){string id = null, pw = null, gd = null;var result = from info in c.linq.loginwhere info.id == this.iselect new{ID = info.id,pw = info.password,gd = info.grade,};foreach (var p in result){id = p.ID;pw = p.pw;gd = p.gd;}if (pw.Trim() == textBox1.Text.ToString().Trim()){if (textBox2.Text.Trim().ToString().Equals(textBox3.Text.Trim().ToString())){var edit = c.linq.login.SingleOrDefault<login>(s=>s.id==i);if (edit == null){return;}edit.password = textBox3.Text.Trim().ToString();//执行更新操作c.linq.SubmitChanges();MessageBox.Show("密码修改成功");this.Dispose();login1 l = new login1();l.Show();}}else{MessageBox.Show("密码错误!");}}else{MessageBox.Show("不能为空!");}}}}三、测试方案设计:1、测试数据房间信息:账户信息:住户信息:2、测试结果:测试次数结果登录响应时间(秒)1 登录成功0.52 登录成功0.43 登录成功0.6平均时间:0.5修改密码通过密保找回成功0.5重设密码验证密保并成功设置0.5平均时间:0.5四、测试结果分析:经过测试,数据在储存和使用过程中不会丢失,但是数据的安全性不是很高。
《软件工程基础》宾馆管理系统设计

《软件工程基础》宾馆管理系统设计一丶问题定义1.宾馆,是为客人提供住宿、餐饮、娱乐和其它服务的综合性服务企业,它所接待的客来自世界各地,而且这些客人的生活习惯、消费水平、宗教信仰等各不相同。
随着我国旅游业的飞速发展,以及社会生活水平的普遍提高,人们对于宾馆消费不断地提出更高、更多样性的要求。
2.如何以宾馆企业所拥有的有限的人力、物力、财力和信息资源服务于住店客人,满足客人的各种消费需求,在当今竞争日趋激烈的宾馆行业中,是经营好宾馆企业的重要问题。
3.近年来,我国的现代宾馆业得到了蓬勃的发展,无论是行业规模,设施质量还是经营理念或者管理水平,都取得了长足的进步,已经进入了现代化水平阶段。
宾馆信息管理系统是一个宾馆不可缺少的部分,它对于管理者和消费者来说都非常重要,所以一个良好的宾馆管理系统应该能够为用户提供足够的信息处理能和信息查询手段。
宾馆信息管理系统对于加强宾馆信息管理有着极其重要的作用。
当今社会经济发达,交通便利,人们活动的范围越来越广泛,因此,宾馆的旅客量也在日渐剧增,对于如何管理如此庞大的旅客信息显得更为复杂,传统的管理方法,不仅工作量大,而且特容易出现问题,如效率低,保密性差,另外时间一长,将产生大量的文件和数据,这对于查找,更新和维护都带来了不少的困难。
已不能适应时代的发展4.宾馆经营管理人员不但要掌握科学的管理思想和管理方法来综合的运用宾馆资源,还应该采用先进的计算机管理手段处理日益复杂的信息资源,正确、及时地对客源市场信息作出反应和正确的指定经营决策,这样才有可能保证宾馆企业在如今激烈的竞争中求得生存和发展。
作为宾馆的经营管理人员只有充分的掌握宾馆的各职能岗位的信息流程和计算机处理的要求,并善于结合两者的要求和长处,才能使想进的计算信息处理技术有效的服务与宾馆的经营管理。
5.宾馆客房管理系统是根据宾馆对客房管理的实际情况进行编写的,主要目的是为了方便宾馆对客房的实际情况进行集中的查询与管理工作,以提高整个宾馆的工作效率。
软件工程-宾馆管理系统

软件工程课程设计报告设计题目:宾馆管理系统专业班级:姓名:学号:指导老师:摘要:“宾馆管理管理系统”是较为典型的管理信息系统,将先进的计算机技术与现代宾馆服务管理结合起来,以实现宾馆管理的自动化、信息化、网络化。
本系统基于PHP+MYSQL开发,系统采用了B/S结构,主要实现宾馆后台管理系统,主要包括客房信息、订房信息、结算信息等功能模块。
本报告主要阐述了该系统的需求分析、功能模块划分、数据库设计及主要功能的具体设计与实现,并就系统中用到的技术进行介绍关键词:宾馆管理,PHP,MYSQL一、系统的简要说明书系统名称:宾馆管理系统开发及运行环境:PHP+Appche+MySql、B/S要求有关客房标准的制定、标准信息的输入,包括标准编号、标准名称、房间面积、床位数量、住房单价、是否有空调、电视机、电话以及单独卫生间等。
客房标准信息的修改、查询等。
客房基本信息的输入,包括客房编号、客房类型、客房位置、客房单价、备注等。
客房基本信息的查询、修改,包括客房编号、客房类型、客房位置、客房单价、备注等。
剩余客房信息的查询等。
订房信息的输入,包括客房编号、客房种类、客房位置、客房单价、顾客姓名、顾客身份证号码、入住日期、折扣、备注信息等。
订房信息的修改和查询,包括客房编号、客房种类、客房位置、客房单价、顾客姓名、顾客身份证号码、入住日期、折扣、备注信息等。
结算信息的输入,包括客房编号、客房种类、位置、客房单价、顾客姓名、顾客身份证号码、入住日期、折扣、结算日期、备注信息等。
结算信息的修改和查询,包括客房编号、客房种类、客房位置、客房单价、顾客姓名、顾客身份证号码、入住日期、折扣、结日期、备注信息等系统功能性:系统操作员:客房信息制定、查询、修改、删除等;订房信息的输入、修改、查询等;结算信息的输入、修改、查询等系统完成情况:详细设计(N-S)、数据结构设计、测试文档、USE CASE 模型、宾馆管理系统流程图、各种动态图,完整的代码测试等二、系统分析2.1.系统需求分析根据宾馆的具体情况,系统主要功能包括:⏹客房信息管理⏹订房管理⏹退房管理⏹会员管理⏹财务管理2.2可行性分析随着信息技术的发展和人们对宾馆酒店的要求越来越高,许多宾馆已明显觉得手工管理已不能适应当前宾馆告诉发展的需要,宾馆已意识到使用使用计算机网络和计算机管理的重要性,决定首先在客房部采用宾馆管理系统。
酒店管理系统软件工程课程设计

软件学院课程设计报告书课程名称软件工程课程设计设计题目酒店管理系统设计与分析专业班级软件10-04班学号1020010432姓名张小龙指导教师赵雪2013年1月目录1设计时间 (3)2设计目的 (3)3设计任务 (3)4设计内容 (3)4.1问题定义与可行性研究 (3)4.1.1问题定义 (3)4.1.2可行性研究 (4)4.2需求分析 (4)4.2.1总体目标 (4)4.2.2具体目标 (5)4.2.3系统数据建模(ER图) (6)4.2.4系统功能建模(数据流程图) (10)4.2.5数据字典 (11)4.3总体设计(系统结构图) (13)4.4详细设计 (14)4.4.1客房管理模块详细设计 (14)4.4.2餐饮管理模块详细设计 (19)4.4.3系统详细设计任务 (20)4.4.4系统输出设计 (20)4.4.5系统输入设计 (20)4.4.6数据输入设备的选择 (20)4.4.7输入检验设计 (20)4.5 系统设计指标 (21)4.6系统测试及维护 (21)5.总结与展望 (23)参考文献 (24)成绩评定 (24)1设计时间2013年1月14日——2013年1月18日2设计目的目的是使学生掌握软件工程的基本原理和基本方法,充分理解和掌握软件工程学的概念、原理、方法和技术。
本课程设计要求学生运用软件工程的思想,严格按照软件生命周期各阶段的目的和任务,完成对系统的分析和设计。
主要完成对酒店管理系统的设计与分析,酒店管理系统将会把先进的计算机技术与现代酒店服务管理完美地结合起来,实现住宿、餐饮、娱乐全新概念的服务和管理方式。
3设计任务本文档主要完成对酒店管理系统的设计与分析,为酒店设计出一款现代化的管理系统,可以完成酒店的主要日常工作,包括餐饮、材料采购、仓库管理、娱乐、客房预定、账务结算等业务。
酒店管理系统将先进的计算机技术与现代酒店服务管理完美地结合起来,实现了住宿、餐饮、娱乐全新概念的服务和管理方式。
宾馆管理系统的课程设计

宾馆管理系统的课程设计一、课程目标知识目标:1. 学生能理解宾馆管理系统的基本概念、功能模块和工作流程。
2. 学生掌握数据库设计原则,能够运用数据库技术进行宾馆信息的存储、查询和管理。
3. 学生了解面向对象编程思想,能够运用所学编程语言实现宾馆管理系统的功能。
技能目标:1. 学生具备分析宾馆管理需求的能力,能够设计出合理的系统功能模块。
2. 学生能够运用数据库软件进行宾馆数据表的创建、查询和操作。
3. 学生掌握系统设计方法,能够编写出宾馆管理系统的部分功能代码。
情感态度价值观目标:1. 学生培养对信息技术的兴趣,提高解决实际问题的热情和积极性。
2. 学生树立正确的价值观,认识到信息技术在宾馆行业中的重要作用。
3. 学生通过团队协作,培养沟通、交流和合作的能力。
课程性质:本课程为信息技术学科,旨在让学生将所学知识应用于实际场景,提高解决实际问题的能力。
学生特点:学生具备一定的计算机基础和编程能力,对数据库和编程有一定了解。
教学要求:教师需结合宾馆管理实际,引导学生运用所学知识,通过实践操作和案例分析,培养学生的实际操作能力和创新思维。
同时,注重团队合作,提高学生的沟通与协作能力。
通过本课程的学习,使学生能够将所学知识应用于宾馆管理系统的设计与实现,达到预期的学习成果。
二、教学内容1. 宾馆管理系统概述- 了解宾馆管理系统的基本概念、发展历程和应用场景。
- 分析宾馆管理系统的功能需求,学习系统设计的基本原则。
2. 数据库设计- 学习数据库设计的基本原则和方法。
- 掌握数据库表的设计,包括数据表创建、字段定义和数据类型选择。
- 学习SQL语句,进行数据查询、插入、删除和更新操作。
3. 系统功能模块设计- 分析宾馆管理系统的功能模块,如客户管理、房间管理、预订管理等。
- 学习面向对象编程思想,运用编程语言进行模块设计和编码。
4. 系统实现与测试- 学习系统实现的基本步骤,包括界面设计、功能实现和系统集成。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
分类号编号华北水利水电大学North China University of Water Resources and Electric Power实验报告课程:软件工程实验项目2:软件编码与测试题目:宾馆管理信息系统院系信息工程学院专业计算机科学与技术班级学号201415717姓名李卫朋指导教师庄晋林2017年5 月29 日华北水利水电大学软件工程实验报告2016~2017学年第二学期2014 级计算机科学与技术专业一、实验内容:宾馆管理信息系统任务:入住或预订客房时,用户要对客户管理模块或预订管理模块进行核对审查,并进行登记;客户换房时,要对换房信息进行查询和更新;客户退房时,要进行结算,并对更新客房信息。
主要功能模块:(1)登录模块:对用户身份进行验证,只有合法用户才能进入系统;(2)系统管理模块:对系统用户进行管理,更改用户名、密码、权限等;(3)客房管理模块:对客房信息的添加、修改和删除等;(4)入住管理模块:对客户入住信息的登记、查询等功能(5)订房管理模块:对客户订房信息的登记、查询等。
(6)换房管理模块:对客户换房信息的登记、查询等(7)宾馆结算模块:对已入住宾馆的顾客进行结算及对订房客户已交的押金进行结算、查询。
二、程序源:Win7 64位电脑,vs2012编辑环境,sql2005数据库。
程序源码:1、登录设计:namespace宾馆管理信息系统{public partial class login1 : Form{public login1(){InitializeComponent();}private connection c = new connection();private void button1_Click(object sender, EventArgs e){if(textBox1.Text.Trim().ToString()!= String.Empty && textBox2.Text.Trim().ToString() != String.Empty) {string id = null, pw = null, gd = null;var result = from info in c.linq.loginwhere info.id == textBox1.Text.ToString().Trim()select new{ID = info.id,pw = info.password,gd = info.grade,};if (result.Count() == 0){MessageBox.Show("用户名不存在!");}else if (result.Count() == 1){foreach (var p in result){id = p.ID;pw = p.pw;gd = p.gd;}if (pw.Trim() == textBox2.Text.ToString().Trim()){this.Hide();manger lf = new manger(gd,textBox1.Text.Trim().ToString()); lf.Show();}else{MessageBox.Show("密码错误!");}}}else{MessageBox.Show("不能为空!");}}private void button2_Click(object sender, EventArgs e){this.Close();}private void login1_FormClosed(object sender, FormClosedEventArgs e){System.Environment.Exit(0);}}}2、添加住户设计namespace宾馆管理信息系统{public partial class addpeople : Form{private connection c = new connection();private string s;public addpeople(Form f,string s){this.Owner = f;InitializeComponent();this.s = s;//房间号comboBox1.DropDownStyle = boBoxStyle.DropDownList;}private void button1_Click(object sender, EventArgs e){if (textBox1.Text.Trim().ToString() != String.Empty && comboBox1.Text.Trim().ToString() != String.Empty && textBox3.Text.Trim().ToString() != String.Empty && textBox4.Text.Trim().ToString() != String.Empty){var result = from info in c.linq.roomwhere info.房间号码 == s.Trim().ToString()select new{房间号 = info.房间号码,房间类型 = info.房间种类,房间单价 = info.房间单价,房间是否使用 = info.房间是否正在使用,};foreach (var item in result){if (item.房间单价 <= int.Parse(textBox4.Text.Trim().ToString())){try{guest r = new guest();{r.住店人身份证号码 = textBox1.Text.Trim().ToString();r.姓名 = textBox2.Text.Trim().ToString();r.性别 = comboBox1.Text.Trim().ToString();r.所交押金 = int.Parse(textBox4.Text.Trim().ToString());r.人数 = textBox3.Text.Trim().ToString();r.房间号码 = s;r.入住天数 = 1;r.入住时间 = System.DateTime.Now.Day.ToString();}var edit = c.linq.room.SingleOrDefault<room>(s1 => s1.房间号码 == s.Trim().ToString());if (edit == null){return;}edit.房间是否正在使用 = "是";c.linq.guest.InsertOnSubmit(r);c.linq.SubmitChanges();//修改student的属性;MessageBox.Show(textBox2.Text.Trim().ToString() + " 入住成功");this.Close();}catch{MessageBox.Show("用户已存在!");}}else{MessageBox.Show("所交押金不足!");}}}else{MessageBox.Show("不能为空!");}}private void addpeople_FormClosed(object sender, FormClosedEventArgs e){this.Owner.Owner.Show();}}}3、添加房间设计:namespace宾馆管理信息系统{public partial class addroom : Form{public addroom(Form f){InitializeComponent();this.Owner = f;comboBox1.DropDownStyle = boBoxStyle.DropDownList;}private connection c = new connection();private void button1_Click(object sender, EventArgs e){if (textBox1.Text.Trim().ToString() != String.Empty && comboBox1.Text.Trim().ToString() != String.Empty && textBox3.Text.Trim().ToString() != String.Empty){try{room r = new room();{r.房间号码 = textBox1.Text.Trim().ToString();r.房间种类 = comboBox1.Text.Trim().ToString();r.房间单价 = double.Parse( textBox3.Text.Trim().ToString());r.房间是否正在使用 = "否";}c.linq.room.InsertOnSubmit(r);c.linq.SubmitChanges();MessageBox.Show(textBox1.Text.Trim().ToString()+" 号房间添加成功");this.textBox1.Text = null;this.textBox3.Text = null;boBox1.Text = null;this.textBox1.Focus();}catch{MessageBox.Show("房间号已存在!");}}else{MessageBox.Show("不能为空!");}}private void addroom_FormClosed(object sender, FormClosedEventArgs e){this.Owner.Show();}private void button2_Click(object sender, EventArgs e) {this.Close();}}}4、查看所有房间信息设计:namespace宾馆管理信息系统{public partial class allroom : Form{private connection c=new connection ();public allroom(Form f){InitializeComponent();this.Owner = f;this.listView1.Clear();this.listView1.View = rgeIcon;rgeImageList = this.imageList1;Random rd = new Random();this.listView1.BeginUpdate();var result = from info in c.linq.roomselect new{房间号 = info.房间号码,房间类型 = info.房间种类,房间单价 = info.房间单价,房间是否使用 = info.房间是否正在使用, };foreach (var item in result){ListViewItem lvi = new ListViewItem();if(item.房间是否使用.Trim()=="否"){lvi.ImageIndex =0;}else if (item.房间是否使用.Trim() == "是"){lvi.ImageIndex = 1;}lvi.Text = item.房间号.Trim().ToString();this.listView1.Items.Add(lvi);}this.listView1.EndUpdate();}private void listView1_ItemActivate(object sender, EventArgs e){var result = from info in c.linq.roomwhere info.房间号码 == listView1.FocusedItem.Text.Trim().ToString()select new{房间号 = info.房间号码,房间类型 = info.房间种类,房间单价 = info.房间单价,房间是否使用 = info.房间是否正在使用,};foreach (var item in result){DialogResult dr = MessageBox.Show("房间号:" + listView1.FocusedItem.Text.ToString() + "\r\n房间类型:" + item.房间类型 + "\r\n房间单价:" + item.房间单价);}}private void allroom_FormClosed(object sender, FormClosedEventArgs e){this.Owner.Show();}}}5、预订房间设计:namespace宾馆管理信息系统{public partial class bookroom : Form{private connection c = new connection();public bookroom(Form f){InitializeComponent();this.Owner = f;this.listView1.Clear();this.listView1.View = rgeIcon;rgeImageList = this.imageList1;Random rd = new Random();this.listView1.BeginUpdate();var result = from info in c.linq.roomwhere info.房间是否正在使用=="否"select new{房间号 = info.房间号码,房间类型 = info.房间种类,房间单价 = info.房间单价,房间是否使用 = info.房间是否正在使用,};foreach (var item in result){ListViewItem lvi = new ListViewItem();lvi.ImageIndex =0;lvi.Text = item.房间号.Trim().ToString();this.listView1.Items.Add(lvi);}this.listView1.EndUpdate();private void bookroom_FormClosed(object sender, FormClosedEventArgs e){this.Owner.Show();}private void listView1_ItemActivate(object sender, EventArgs e){var result = from info in c.linq.roomwhere info.房间号码 == listView1.FocusedItem.Text.Trim().ToString()select new{房间号 = info.房间号码,房间类型 = info.房间种类,房间单价 = info.房间单价,房间是否使用 = info.房间是否正在使用,};foreach (var item in result){DialogResult dr = MessageBox.Show("房间号:" + listView1.FocusedItem.Text.ToString() + "\r\n房间类型:"+item.房间类型+"\r\n房间单价:"+item.房间单价+"\r\n确认使用么?", "提示", MessageBoxButtons.OKCancel);if (dr == DialogResult.OK){//用户选择确认的操作addpeople a = new addpeople(this, listView1.FocusedItem.Text.Trim().ToString());this.Hide();a.Show();}}}}}6、查看所有用户设计:namespace宾馆管理信息系统{public partial class chakanyonghu : Form{private connection c = new connection();public chakanyonghu(Form f){this.Owner = f;InitializeComponent();var result = from info in c.linq.loginselect new{用户名 = info.id,用户类型 = info.grade,};dataGridView1.DataSource = result;}}}7、修改房间的信息设计:namespace宾馆管理信息系统{public partial class changeroom : Form{private connection c = new connection();public changeroom(Form f){InitializeComponent();this.Owner = f;var result = from info in c.linq.roomselect new{房间号 = info.房间号码,房间类型 = info.房间种类,房间单价 = info.房间单价,房间是否使用 = info.房间是否正在使用,};dataGridView1.DataSource = result;}private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e){string s = Convert.ToString(dataGridView1[0, e.RowIndex].Value).Trim();changeroom2 d = new changeroom2(this, s);d.Show();this.Hide();}private void button1_Click(object sender, EventArgs e){var result = from info in c.linq.roomselect new{房间号 = info.房间号码,房间类型 = info.房间种类,房间单价 = info.房间单价,房间是否使用 = info.房间是否正在使用,};dataGridView1.DataSource = result;}}}namespace宾馆管理信息系统{public partial class changeroom2 : Form{private connection c = new connection();private string s = null;public changeroom2(Form f,string s){InitializeComponent();comboBox1.DropDownStyle = boBoxStyle.DropDownList; comboBox2.DropDownStyle = boBoxStyle.DropDownList;this.Owner = f;this.s = s;var result = from info in c.linq.roomwhere info.房间号码==sselect new{房间号 = info.房间号码,房间类型 = info.房间种类,房间单价 = info.房间单价,房间是否使用 = info.房间是否正在使用,};foreach (var item in result){this.textBox2.Text = item.房间号;this.textBox1.Text = item.房间单价.ToString();boBox1.Text = item.房间类型;boBox2.Text = item.房间是否使用;}}private void button1_Click(object sender, EventArgs e){if(textBox1.Text.Trim().ToString() != String.Empty && textBox2.Text.Trim().ToString() != String.Empty && comboBox1.Text.Trim().ToString() != String.Empty && comboBox2.Text.Trim().ToString() != String.Empty){var edit = c.linq.room.SingleOrDefault<room>(s1=>s1.房间号码==s);if (edit == null){return;}//修改student的属性edit.房间单价= double .Parse( textBox1.Text.Trim().ToString());edit.房间种类 = comboBox1.Text.Trim().ToString();edit.房间是否正在使用 = comboBox2.Text.Trim().ToString();//执行更新操作c.linq.SubmitChanges();MessageBox.Show("房间信息修改成功");this.Close();}}}}8、删除用户信息设计:namespace宾馆管理信息系统{public partial class delete : Form{private string s;private connection c = new connection();public delete(Form f){InitializeComponent();this.Owner = f;var result = from info in c.linq.loginwhere info.grade=="普通用户"select new用户名 = info.id,用户类型 = info.grade,};dataGridView1.DataSource = result;}private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) {s = Convert.ToString(dataGridView1[0, e.RowIndex].Value).Trim();delete2 d = new delete2(s,this );d.Show();this.Hide();}private void button2_Click(object sender, EventArgs e){var result = from info in c.linq.loginwhere info.grade == "普通用户"select new{用户名 = info.id,用户类型 = info.grade,};dataGridView1.DataSource = result;}}}namespace宾馆管理信息系统{public partial class delete2 : Form{private string h;private connection c = new connection();public delete2(string s,Form f){InitializeComponent();h = s;this.Owner = f;var result = from info in c.linq.loginwhere info.id == sselect new{用户名 = info.id,用户类型 = info.grade,dataGridView1.DataSource = result;}private void button1_Click(object sender, EventArgs e) {var result = from m in c.linq.loginwhere m.id == hselect m;c.linq.login.DeleteAllOnSubmit(result);c.linq.SubmitChanges();MessageBox.Show("删除成功");this.Close();}}}9、删除房间信息设计:namespace宾馆管理信息系统{public partial class deleteroom : Form{private connection c = new connection();public deleteroom(Form f){InitializeComponent();this.Owner = f;var result = from info in c.linq.roomselect new{房间号 = info.房间号码,房间类型 = info.房间种类,房间单价=info.房间单价,房间是否使用=info.房间是否正在使用,};dataGridView1.DataSource = result;}private void button2_Click(object sender, EventArgs e) {var result = from info in c.linq.roomselect new{房间号 = info.房间号码,房间类型 = info.房间种类,房间单价 = info.房间单价,房间是否使用 = info.房间是否正在使用,};dataGridView1.DataSource = result;}private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) {string s = Convert.ToString(dataGridView1[0, e.RowIndex].Value).Trim();deleteroom2 d = new deleteroom2(this,s);d.Show();this.Hide();}}}namespace宾馆管理信息系统{public partial class deleteroom2 : Form{private connection c = new connection();private string h;public deleteroom2(Form f,string h){InitializeComponent();this.Owner = f;this.h = h;var result = from info in c.linq.roomwhere info.房间号码 == hselect new{房间号 = info.房间号码,房间类型 = info.房间种类,房间单价 = info.房间单价,房间是否使用 = info.房间是否正在使用,};dataGridView1.DataSource = result;}private void button1_Click(object sender, EventArgs e){var result = from m in c.linq.roomwhere m.房间号码 == hselect m;foreach (var item in result){if (item.房间是否正在使用.Trim().ToString() == "否"){c.linq.room.DeleteAllOnSubmit(result);c.linq.SubmitChanges();MessageBox.Show("删除成功");this.Close();}else{MessageBox.Show("该房间正在使用,请先退房!");}}}}}10、查看住户信息:namespace宾馆管理信息系统{public partial class guestmessage : Form{private connection c = new connection();public guestmessage(Form f){this.Owner = f;InitializeComponent();comboBox1.DropDownStyle = boBoxStyle.DropDownList;}private void button1_Click(object sender, EventArgs e){if (comboBox1.Text.Trim().ToString() != string.Empty && textBox1.Text.Trim().ToString() !=string.Empty){switch (comboBox1.Text.Trim().ToString()){case"房间号":var edit = c.linq.guest.SingleOrDefault<guest>(s1 => s1.房间号码.Trim() ==textBox1.Text.Trim().ToString());if (edit != null){MessageBox.Show("房间号:" + edit.房间号码 + "\t\n" + "人数:" + edit.人数 + "\t\n" + "入住天数:" + edit.入住天数 + "\t\n" + "押金:" + edit.所交押金 + "\t\n" + "姓名:" + edit.姓名 + "\t\n" + "身份证号码:" + edit.住店人身份证号码);}else{MessageBox.Show("房间为空!");}break;case"用户姓名":var edit1 = c.linq.guest.SingleOrDefault<guest>(s1 => s1.姓名.Trim() ==textBox1.Text.Trim().ToString());if (edit1 != null){MessageBox.Show("房间号:"+ edit1.房间号码 + "\t\n"+ "人数:" + edit1.人数 + "\t\n" + "入住天数:" + edit1.入住天数 + "\t\n" + "押金:" + edit1.所交押金 + "\t\n" + "姓名:" + edit1.姓名 + "\t\n" + "身份证号码:" + edit1.住店人身份证号码);}else{MessageBox.Show(textBox1.Text.Trim().ToString() + "不存在");}break;case"身份证号":var edit2 = c.linq.guest.SingleOrDefault<guest>(s1 => s1.住店人身份证号码.Trim() == textBox1.Text.Trim().ToString());if (edit2 != null){MessageBox.Show("房间号:"+ edit2.房间号码 + "\t\n"+ "人数:" + edit2.人数 + "\t\n" + "入住天数:" + edit2.入住天数 + "\t\n" + "押金:" + edit2.所交押金 + "\t\n" + "姓名:" + edit2.姓名 + "\t\n" + "身份证号码:" + edit2.住店人身份证号码);}else{MessageBox.Show(textBox1.Text.Trim().ToString() + "不存在");}break;}}else{MessageBox.Show("不能为空!");}}}}11、新用户注册namespace宾馆管理信息系统{public partial class login2 : Form{private connection c = new connection();public login2(){InitializeComponent();comboBox1.DropDownStyle = boBoxStyle.DropDownList;}public login2(Form f){InitializeComponent();this.Owner = f;comboBox1.DropDownStyle = boBoxStyle.DropDownList;}private void button1_Click(object sender, EventArgs e){if(textBox1.Text.Trim().ToString() != String.Empty && textBox2.Text.Trim().ToString() != String.Empty && textBox3.Text.Trim().ToString() != String.Empty && comboBox1.Text.Trim().ToString() != String.Empty){if (comboBox1.Text.Trim().ToString() == "管理员" || comboBox1.Text.Trim().ToString() == "普通用户"){if (this.textBox2.Text.Trim().ToString() == textBox3.Text.Trim().ToString()){try{login l = new login();{l.id = textBox1.Text.Trim().ToString();l.password = textBox2.Text.Trim().ToString();l.grade = comboBox1.Text.Trim().ToString();}c.linq.login.InsertOnSubmit(l);c.linq.SubmitChanges();MessageBox.Show("注册成功");}catch{MessageBox.Show("用户名已存在!");}}else{MessageBox.Show("请再次输入确定密码!");}}else{MessageBox.Show("请选择正确的用户类型!");boBox1.Focus();}}else{MessageBox.Show("不能为空!");}}}}12、主界面设计:namespace宾馆管理信息系统{public partial class manger : Form{private string i,j;//public manger(){InitializeComponent();}public manger(string i,string j){InitializeComponent();this.i = i;this.j = j;}private void button1_Click(object sender, EventArgs e) {this.Hide();login2 l = new login2(this);l.Show();}private void manger_Load(object sender, EventArgs e) {if (i.Trim().Equals("管理员")){this.panel1.Visible = true;this.panel2.Visible = true ;}else if (i.Trim().Equals("普通用户")){this.panel2.Visible = true;this.panel1.Visible = false;}}private void button3_Click(object sender, EventArgs e){this.Hide();delete l = new delete(this);l.Show();}private void manger_FormClosed(object sender, FormClosedEventArgs e) {System.Environment.Exit(0);}private void button4_Click(object sender, EventArgs e){this.Hide();chakanyonghu l = new chakanyonghu(this);l.Show();}private void button5_Click(object sender, EventArgs e){this.Hide();xiugaimima l = new xiugaimima(this, j);l.Show();}private void button6_Click(object sender, EventArgs e){this.Hide();addroom l = new addroom(this);l.Show();}private void button7_Click(object sender, EventArgs e){this.Hide();deleteroom l = new deleteroom(this);l.Show();}private void button8_Click(object sender, EventArgs e){this.Hide();changeroom l = new changeroom(this);l.Show();}private void button2_Click(object sender, EventArgs e){this.Hide();bookroom l = new bookroom(this);l.Show();}private void button9_Click(object sender, EventArgs e){this.Hide();unsubscribe l = new unsubscribe(this);l.Show();}private void button10_Click(object sender, EventArgs e){this.Hide();allroom l = new allroom(this);l.Show();}private connection c = new connection();private ArrayList arl = new ArrayList();private void button11_Click(object sender, EventArgs e){var result = from m in c.linq.guestselect m;foreach (var item in result){if (item.入住时间.Trim() != System.DateTime.Now.Day.ToString()){var edit = c.linq.room.SingleOrDefault<room>(s => s.房间号码 == item.房间号码);if (item.所交押金 >= (item.入住天数 + 1) * edit.房间单价){item.入住天数++;item.入住时间 = System.DateTime.Now.Day.ToString();c.linq.SubmitChanges();}else{try{exitroom r = new exitroom();{r.押金不足的房间号 = item.房间号码;}c.linq.exitroom.InsertOnSubmit(r);c.linq.SubmitChanges();}catch{}MessageBox.Show("请提醒"+item.房间号码+"号房的"+item.姓名+"退房或者续交房费"); }}}var result1 = from m in c.linq.exitroomselect m;dataGridView1.DataSource = result1;}private void button12_Click(object sender, EventArgs e){var result1 = from m in c.linq.exitroomselect m;dataGridView1.DataSource = result1;}private void button13_Click(object sender, EventArgs e){rejiaofei r = new rejiaofei(this);this.Hide();r.Show();}private void button14_Click(object sender, EventArgs e){guestmessage m = new guestmessage(this);this.Hide();m.Show();}private void button15_Click(object sender, EventArgs e){this.Close();}private void button16_Click(object sender, EventArgs e){this.Hide();login1 l = new login1();l.Show();}}}13、用户再次缴费:namespace宾馆管理信息系统{public partial class rejiaofei : Form{private connection c = new connection();public rejiaofei(Form f){InitializeComponent();this.Owner = f;}private void button1_Click(object sender, EventArgs e){try{var edit = c.linq.guest.SingleOrDefault<guest>(s1 => s1.房间号码.Trim() == this.textBox1.Text.Trim().ToString());edit.所交押金 = edit.所交押金 + int.Parse(textBox2.Text.Trim().ToString()); edit.入住天数++;edit.入住时间 = System.DateTime.Now.Day.ToString();var result3 = from m in c.linq.exitroomwhere m.押金不足的房间号 == textBox1.Text.Trim().ToString()select m;c.linq.exitroom.DeleteAllOnSubmit(result3);c.linq.SubmitChanges();MessageBox.Show("缴纳成功!");}catch{MessageBox.Show("缴纳失败,请核对房间号!");}}private void rejiaofei_FormClosed(object sender, FormClosedEventArgs e){this.Owner.Show();}}}15、退房设计:namespace宾馆管理信息系统{public partial class unsubscribe : Form{private connection c = new connection();public unsubscribe(Form f){this.Owner = f;InitializeComponent();}private void button1_Click(object sender, EventArgs e){if (textBox1.Text.Trim().ToString() != string.Empty){var result = from info in c.linq.roomwhere info.房间号码==textBox1.Text.Trim().ToString()select new{房间号 = info.房间号码,房间类型 = info.房间种类,房间单价 = info.房间单价,房间是否使用 = info.房间是否正在使用,};if (result.Count() == 0){MessageBox.Show("请输入正确的房间号!");this.textBox1.Focus();}else if (result.Count() == 1){foreach (var item in result){if (item.房间是否使用.Trim() == "是"){DialogResult dr = MessageBox.Show("房间号:" + textBox1.Text.ToString() + "\r\n确认退房么?", "提示", MessageBoxButtons.OKCancel);if (dr == DialogResult.OK){var result1 = from info in c.linq.guestwhere info.房间号码 == textBox1.Text.Trim().ToString()select new{房间号 = info.房间号码,入住天数 = info.入住天数,所交押金 = info.所交押金,姓名 = info.姓名,};foreach (var item1 in result1){double i = item1.入住天数 * item.房间单价;double j = item1.所交押金 - i;MessageBox.Show("入住天数:" + item1.入住天数 + "\t\n总押金:" + item1.所交押金 + "\t\n消费金额:" + i + "应找回:" + j);var edit = c.linq.room.SingleOrDefault<room>(s1 => s1.房间号码 ==textBox1.Text.Trim().ToString());if (edit == null){return;}edit.房间是否正在使用 = "否";//执行更新操作var result2 = from m in c.linq.guestwhere m.房间号码 == textBox1.Text.Trim().ToString()select m;var result3 = from m in c.linq.exitroomwhere m.押金不足的房间号 == textBox1.Text.Trim().ToString()select m;c.linq.exitroom.DeleteAllOnSubmit(result3);c.linq.guest.DeleteAllOnSubmit(result2);c.linq.SubmitChanges();MessageBox.Show("房号为"+item1.房间号+"的"+item1 .姓名+"退房成功!");this.Close();}}}else{MessageBox.Show("该房间并未订购!无法退订!");}}}}else{MessageBox.Show("请输入房间号!");this.textBox1.Focus();}}}}16、修改用户密码:namespace宾馆管理信息系统{public partial class xiugaimima : Form{private connection c=new connection ();private string i;public xiugaimima(Form f,string i){this.Owner = f;this.i = i;InitializeComponent();}private void button1_Click(object sender, EventArgs e){if(textBox1.Text.Trim().ToString() != String.Empty && textBox2.Text.Trim().ToString() != String.Empty && textBox3.Text.Trim().ToString() != String.Empty){string id = null, pw = null, gd = null;var result = from info in c.linq.loginwhere info.id == this.iselect new{ID = info.id,pw = info.password,gd = info.grade,};foreach (var p in result){id = p.ID;pw = p.pw;gd = p.gd;}if (pw.Trim() == textBox1.Text.ToString().Trim()){if (textBox2.Text.Trim().ToString().Equals(textBox3.Text.Trim().ToString())){var edit = c.linq.login.SingleOrDefault<login>(s=>s.id==i);if (edit == null){return;}edit.password = textBox3.Text.Trim().ToString();//执行更新操作c.linq.SubmitChanges();MessageBox.Show("密码修改成功");this.Dispose();login1 l = new login1();l.Show();}}else{MessageBox.Show("密码错误!");}}else{MessageBox.Show("不能为空!");}}}}三、测试方案设计:1、测试数据房间信息:账户信息:住户信息:2、测试结果:测试次数结果登录响应时间(秒)1 登录成功0.52 登录成功0.43 登录成功0.6平均时间:0.5修改密码通过密保找回成功0.5重设密码验证密保并成功设置0.5平均时间:0.5四、测试结果分析:经过测试,数据在储存和使用过程中不会丢失,但是数据的安全性不是很高。