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

合集下载

软件工程课程设计-宾馆客房管理系统

软件工程课程设计-宾馆客房管理系统

软件工程课程设计-宾馆客房管理系统《软件工程》课程设计报告宾馆客房管理系统指导教师: 班级: 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. 系统实现与测试- 学习系统实现的基本步骤,包括界面设计、功能实现和系统集成。

软件工程课程设计论文—旅店信息管理系统

软件工程课程设计论文—旅店信息管理系统

成绩:软件工程课程设计题目 _旅店信息管理系统专业_班级 _学号姓名 _完成日期2011年12月6日指导教师课程设计(论文)任务书摘要计算机应用已经扩展到人们生活的各个方面,他方便了我们对各项工作的管理,大大提高了我们的工作效率,为我们节省了许多时间。

SQL语言是关系数据库的标准语言,是一个通用的、功能极强的关系数据库语言。

当前,几乎所有的关系数据库管理系统软件都支持SQL语言。

SQL语言既是独立的语言,又是嵌入式语言。

作为独立性语言,它能独立地用于联机交互的使用方式,用户可以在终端键盘上直接键入SQL命令对数据库进行操作;作为嵌入式语言,SQL语句能嵌入到高级语言程序中,供程序员设计程序时用。

VB是一种方便、快捷的界面设计软件,用户可以通过它设计出满足需求的功能界面,然后通过必要的程序,实现界面上各个控件的现实功能。

本旅店管理系统是用SQL和VB开发的一个小型的数据库管理、应用系统(旅店管理系统)。

在系统设计之初,使用SQL语言在数据库中建立六个与系统功能相匹配的表(用户表、管理表、住宿情况表、旅客信息表、结算表、收入统计表),然后用VB设计出功能界面,在界面中加入实现功能的若个控件,并与数据库中相应的表建立连接。

通过在界面上的各种操作实现对数据库表中记录的添加(把登记的旅客信息添加进旅客信息表中)、删除(在旅客信息表中删除相关的旅客信息记录)、修改(在旅客住宿登记、结算完成后,对住宿情况表中的“剩余床位数”、“状态”值加以修改)、查询(把已结算的旅客信息显示在界面上)、统计(统计出某个时间段内旅店的总收入,并将其显示在界面上)等操作。

关键词:计算机、软件、旅店、查询、数据库目录第一章问题定义 ......................................................................................................................... - 1 -1、引言 ................................................................................................................................... - 1 -1.1 编写目的 .................................................................................................................. - 1 -1.2 项目背景 .................................................................................................................. - 1 -1.3 定义 .......................................................................................................................... - 1 -1.4 参考资料 .................................................................................................................. - 2 -第2章可行性研究 ..................................................................................................................... - 2 -2.1 系统概述 .......................................................................................................................... - 2 -2.1.1 当前系统分析 ....................................................................................................... - 2 -2.1.2 目标系统分析 ....................................................................................................... - 3 -2.2 可行性分析研究 .............................................................................................................. - 3 -2.2.1 技术可行性 ........................................................................................................... - 3 -2.2.2 经济可行性 ........................................................................................................... - 5 -2.2.3 社会可行性 ........................................................................................................... - 5 -2.3 结论 .................................................................................................................................. - 5 -第3章需求分析 ......................................................................................................................... - 6 -3.1 任务概述 .......................................................................................................................... - 6 -3.1.1目标 ........................................................................................................................ - 6 -3.2 具体需求分析 .................................................................................................................. - 6 -3.2.1系统流程图 ............................................................................................................ - 6 -3.2.2数据流图 ................................................................................................................ - 7 -3.2.3数据字典 ................................................................................................................ - 7 -3.3 支持信息 .......................................................................................................................... - 9 -3.3.1 运行环境 ............................................................................................................... - 9 -3.3.2支持软件 ................................................................................................................ - 9 -3.3.3接口 ...................................................................................................................... - 10 -3.3.4 控制 ..................................................................................................................... - 10 -3.3.5需求注释 .............................................................................................................. - 10 -3.4 结论 ................................................................................................................................ - 10 -第4章概要设计 ......................................................................................................................... - 10 -4.1总体设计 ......................................................................................................................... - 10 -4.1.1需求规定 .............................................................................................................. - 10 -4.1.2运行环境 .............................................................................................................. - 10 -4.1.3基本设计概念和处理流程................................................................................... - 11 -4.1.4结构 ...................................................................................................................... - 13 -4.1.5功能需求与程序的关系....................................................................................... - 13 -4.1.6人工处理过程 ...................................................................................................... - 14 -4.2接口设计 ......................................................................................................................... - 14 -4.2.1用户接口 .............................................................................................................. - 14 -4.2.2外部接口 .............................................................................................................. - 14 -4.2.3内部接口 .............................................................................................................. - 14 -4.3运行设计 ......................................................................................................................... - 15 -4.3.1运行模块组合 ...................................................................................................... - 15 -4.3.2运行控制 .............................................................................................................. - 15 -4.4系统数据结构设计 ......................................................................................................... - 16 -4.4.1逻辑结构设计要点............................................................................................... - 16 -4.4.2物理结构设计要点............................................................................................... - 17 -4.5系统出错处理设计 ......................................................................................................... - 18 -4.5.1出错信息 .............................................................................................................. - 18 -4.5.2补救措施 .............................................................................................................. - 18 -第5章详细设计 ......................................................................................................................... - 19 -5.1程序系统的结构 ............................................................................................................. - 19 -5.2程序设计说明 ................................................................................................................. - 19 -5.2.1概述 ...................................................................................................................... - 19 -5.2.2功能 ...................................................................................................................... - 20 -5.2.3输入项 .................................................................................................................. - 28 -5.2.4输出项 .................................................................................................................. - 29 -5.2.5算法 ...................................................................................................................... - 29 -5.2.6流程逻辑 .............................................................................................................. - 29 -5.2.7限制条件 .............................................................................................................. - 31 -5.2.8实施方案 .............................................................................................................. - 32 -5.2.10运行环境及配置说明 ........................................................................................ - 33 -第6章软件测试 ......................................................................................................................... - 33 -6.1操作方法 ......................................................................................................................... - 33 -6.1.1登陆 ...................................................................................................................... - 33 -6.1.2 注册新用户 ....................................................................................................... - 33 -6.1.3 旅客登记 ........................................................................................................... - 33 -6.1.4 旅客结算 ........................................................................................................... - 33 -6.1.5 旅客查询 ........................................................................................................... - 34 -6.1.6删除旅客信息 ...................................................................................................... - 34 -6.1.7旅店收入统计 ...................................................................................................... - 34 -6.2调试测试 ......................................................................................................................... - 34 -6.2.1登陆测试 .............................................................................................................. - 34 -6.2.2新用户注册测试 .................................................................................................. - 35 -6.2.3旅客登记测试 ...................................................................................................... - 35 -6.2.4旅客结算测试 ...................................................................................................... - 36 -6.2.5删除旅客信息测试............................................................................................... - 36 -6.2.6旅客信息查询测试............................................................................................... - 36 -6.2.7 旅店收入统计测试.............................................................................................. - 36 -第7章总结 ................................................................................................................................. - 38 -参考文献 ................................................................................................................................. - 39 -第一章问题定义1、引言1.1 编写目的计算机应用已经扩展到人们生活的各个方面,他方便了我们对各项工作的管理,大大提高了我们的工作效率,为我们节省了许多时间。

软件工程课程设计_完整版

软件工程课程设计_完整版

项目名称:酒店宾馆住宿管理系统专业:计算机科学与技术班级: 06计本(2)班指导老师:李 * *开发组长: * *开发成员: ***、***、*****、***2009年5月前言计算机的高速发展正改变着人类的生活,它的多姿多彩正一点一滴的渗透到人们生活的每个方面,计算机的应用覆盖的广阔性是世界各地各个行业的人们利用计算机进行高效管理的重要手段。

人们并通过将各个行业软件装入计算机,使计算机更高效的工作。

本项目编程的一个主要工具是Visual C++。

因为C++是一种面向对象的程序设计方法,具有某些特有的优点:封装性,即把数据和行为隐藏,用户不需要知道内部结构;继承性,方便开发人员重用代码,提高效率;多态性等。

所以Visual C++为本项目的最佳开发工具。

本系统采用VC++面向对象编程语言编写,用SQL 2000数据库系统存放用户信息和产生的数据。

本系统采用C/S服务器结构,能基本满足客户需求。

目录1 前言....................................................................................................... 错误!未定义书签。

2 项目组成员分工 (4)3 文件的使用者 (5)4 软件生存周期与各种文件的编制 (5)5 可行性研究报告(项目开发计划) (6)6 软件需求说明书................................................................................... 错误!未定义书签。

7 概要设计说明书 (15)8详细设计说明书.................................................................................... 错误!未定义书签。

9 编码与数据库设计说明书 (44)10测试计划 (50)11心得体会 (55)2.项目组成员分工1、可行性研究与项目开发计划-------------**2、需求分析-------------***3、概要设计-----------***4、详细设计----------***5、数据库设计--------**6、编码与调试--------**7、测试计划---------盛**3 文件的使用者对于使用文件的人员而言,他们所关心的文件的种类,随他们所承担的工作而异。

宾馆管理信息系统-软件工程课程设计

宾馆管理信息系统-软件工程课程设计

内蒙古师范大学计算机与信息工程学院管理信息系统课程设计宾馆管理信息系统系别:信息管理与信息系统专业班级:导师:日期:小组成员:目录1开发背景说明 (2)2系统分析 (2)2.1 可行性分析 (2)2.2 需求分析 (3)3系统概要设计 (4)3.1 功能需求 (4)3.2 主要功能 (4)3.3 系统开发目的 (5)3.4 运行环境 (5)3.5 项目意义 (6)4 系统详细设计 (6)4.1 组织结构图 (6)4.2 宾馆的业务流程图 (6)4.3 宾馆的功能结构图 (7)4.4 系统功能设计 (8)4.5 模块功能设计 (8)4.5.1. 系统登录模块 (8)4.5.2. 系统管理模块 (9)4.5.3. 客房管理模块 (10)4.5.4. 入住管理模块 (10)4.5.5. 订房管理模块 (11)4.5.6、换房管理模块 (12)4.5.7、宾馆结算模块 (13)4.6 UML系统建模部分 (14)4.6.1用例图 (14)4.6.2 活动图 (17)4.6.3 时序图 (19)5 部门职能及岗位职责 (27)5.1 前台职能 (27)5.2 前台工作人员的职责 (28)5.3 系统管理员的职责 (28)一、开发背景说明:进入21世纪后我国的经济增长在全球的突影而出,人们的生活质量也在不断的提高,从而带来旅游业的高速发展,宾馆行业的服务档次迫切需要提高。

在宾馆竞争日趋激烈的今天,要想在竞争中生存发展,就必须与高新技术紧密结合。

硬件设施落后、管理水平滞后、服务质量低下的宾馆将被逐步淘汰。

传统的纯手工或简单的计算工具,已经不适应现代经济高速发展和信息快速增长的要求,因此必须运用现代化管理手段,配备完善的自动化设备,采用全新的计算机网络和宾馆管理系统,来提高宾馆自身的服务水平与质量,最大限度地发挥准确、快捷、高效等作用,从而赢得宾馆的高信誉、强实力、好效益!二、系统分析2.1 可行性分析2.1.1 目标方案可行性(1) 计算机设备处理繁杂的宾馆日常事务,大幅度减少人力、物力,极大地提高宾馆的管理水平和管理效率。

宾馆住宿管理系统课程设计(详细完整,附代码)

宾馆住宿管理系统课程设计(详细完整,附代码)

宾馆住宿管理系统课程设计设计报告宾馆住宿管理系统前言:本系统针对宾馆住宿的一般管理模式,采用基于计算机网络技术的宾馆管理解决方案,按照宾馆的现代化管理要求设计,实现对宾馆住宿的接待,客房,订房,收支情况,电话等服务设施的全面全方位计算机管理。

目标在于提高宾馆营业体系的作业效率,提高服务的客户满意度,加强宾馆的市场竞争力,树立良好的企业形象.通过计算机管理,一方面提供给客户快捷准确可靠的服务,另一方面提高宾馆自身的管理水平,及时准确获取营业信息,辅助对市场需求变化的决策.第一章系统概述1.1系统开发的背景和意义随着我国经济的迅速发展,人们的生活水平有了显著的提高,假日经济和旅游经济已成为人们消费的热点。

各地也把旅游业当作本地经济发展的重要经济支柱之一,从而促进了宾馆酒店业的快速发展。

同时,随着宾馆酒店越来越多,人们的要求越来越高,宾馆酒店业的竞争也愈来愈激烈。

如何在激烈的竞争中生从发展,是每一个宾馆酒店必须面临的问题。

对宾馆的经营状况起决定作用的是宾馆的服务管理水平。

如何利用先进的管理手段、提高宾馆的管理水平,以成为宾馆酒店业发展的当务之急。

面对信息时代的机遇和挑战,利用科技手段提高企业管理水平是企业管理无疑的一条行之有效的途径。

现在的宾馆行业已经发生拉巨大变化,已不仅是提供给人们一个吃住行的简单场所,所以,将计算机管理引入宾馆的管理体系中,无疑对宾馆的服务水平更上一层楼提供了一种有利的支持。

虽然计算机管理并不是宾馆管理走向成功的关键元素,但它可以最大限度地发挥准确、快捷、高效等作用,对宾馆的服务管理提供强有力的支持。

因此,采用全新的计算机网络和宾馆管理系统,已成为提高宾馆的管理效率、改善服务的水准的重要手段之一。

在某种意义上,宾馆客房管理方面的信息话已成为现代化宾馆的重要标志。

1.2系统所要实现功能该系统应充分利用信息技术提高宾馆客房的管理水平、服务水平。

酒店客房管理系统要实现客房住宿的登记、宿费提醒、追加押金、调房登记、退房结帐、查询统计等功能。

宾馆管理信息系统课程设计

宾馆管理信息系统课程设计

信息科学与技术学院信息系统分析与设计课程设计课题名称:宾馆管理信息系统学生姓名:学院:信息科学与技术学院专业年级:信息管理与信息系统2010级指导教师:完成日期:二○一三年一月十五日目录第一章任务书 (3)第二章系统开发可行性分析 (5)第三章需求分析 (8)1。

项目开发的背景 (8)2.项目开发的目标 (8)3。

系统开发的意义 (9)4.系统开发的主要功能 (9)5.系统的主要内容 (9)第四章系统分析 (10)1.系统模块 (10)2.总体功能模块图 (11)3。

业务流程分析 (11)4。

数据流程分析 (13)第五章系统规划与设计 (19)一、系统概要设计 (19)1.数据库设计 (19)二、系统详细设计 (21)1.系统功能模块设计 (21)2.系统功能展示 (28)第六章开发总结 (31)参考文献 (32)第一章任务书1.题目关于宾馆管理信息系统的开发2。

设计时间(1)第1-2天搜集、整理、分析相关文献、资料(2)第3-6天对用户进行需求分析(3)第7天系统功能模块分析及其划分(4)第8-9天数据库设计(5)第10—13天系统设计及其编程实现(6)第14—15天系统运行调试、修改并撰写文档(7)第16天准备答辩总计16天3.其他相关内容项目提出者:石河子大学信息科学与技术学院相邻课题情况或子课题情况:国家“863”项目和科技支撑计划项目指导老师:陈敏开发人员:信息科学与技术学院信管10级蔡成飞(2010508159)软件用户:宾馆4。

设计资料网上收集资料,寻找案例《项目开发计划规范》《软件需求说明书规范》《数据库设计说明书规范》《数据要求说明书规范》5。

工作内容(1)系统可行性分析和需求分析分析系统的可行性,说明该软件开发项目的实现在技术上、经济上和操作上的可行性,评述为了合理地达到开发目标可供选择的各种可能实施方案,说明并论证所选定实施方案的理由。

并且对系统需求做出较为全面的规定;给出系统的约束条件以及某些数据格式.对所开发软件的功能、用户界面及运行环境等作出详细的说明。

宾馆管理信息系统课程设计

宾馆管理信息系统课程设计

宾馆管理信息系统课程设计小型宾馆住宿管理系统1现行系统概述随着当今社会科学技术水平的不断提高,信息通讯技术的发展对社会各个方面的影响越来越大,尤其是计算机技术的的飞速发展,当代似乎一切事情都能与计算机有所关联,我们正朝着智能化,信息化的时代迈进。

有效的利用先进的信息技术,设计有效的、合理的、特定的信息系统能够大大的减少企业或部门的人力物力,节省大量的资金,减少对资源的浪费。

可以说21世纪社会的发展主要靠信息化来推动,一些系统或是软件可以大大提高效率。

当然旅店也不例外,信息社会的高科技,商品经济化的高效益,使计算机的应用已普及到经济和社会生活的各个领域。

计算机虽然与人类的关系愈来愈密切,还有人由于计算机操作不方便继续用手工劳动。

为了适应现代社会人们高度强烈的时间观念,宾馆管理系统软件为管理人员带来了极大的方便。

宾馆管理需要对客人预订客房、入住、居住和离店期间的一切服务进行管理,并存储宾馆客房的所有静态和动态信息,并且严格服从有关规定,按一定的模式或规律进行。

这样就减少了一部分相当复杂的工作,减轻了管理人员的负担,使管理得到了更好的改善。

现具体就体育用品的销售管理做出相关的分析与设计。

外加现在旅店业的竞争也愈来愈烈,想要在竞争中硬的优势,就必须在经营管理、服务等方面提高服务管理意识,要有好的服务,要有合理管理,顾客们最关心的就是价钱跟住宿条件,所以这两方面都要妥善处理好。

2系统分析2.1需求分析1、系统现状:由于采用计算机所带来的便利性和高效性,旅店的业务做起来会方便很多,在客户中树立良好的形象,但随着数据的增加,业务的增加,竞争的加剧,原有的工作系统已暴露出运行速度慢,处理时间长等缺点。

随着近几年网络的飞快发展,人们的消费行为也随着改变,越来越多的人们希望通过网络迅速了解旅店信息和进行消费,基于上述原因,我们决定试着开发一个新系统,来代替原来的系统,以满足实际的需求。

2、用户需求:用户希望通过使用旅店客房管理系统得到所需信息,达到提高管理水平的目的,希望新系统具有以下功能:(1)使用计算机快速处理日常的业务。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 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四、测试结果分析:经过测试,数据在储存和使用过程中不会丢失,但是数据的安全性不是很高。

相关文档
最新文档