软件工程课程设计-宾馆信息管理系统.doc_第1页
软件工程课程设计-宾馆信息管理系统.doc_第2页
软件工程课程设计-宾馆信息管理系统.doc_第3页
软件工程课程设计-宾馆信息管理系统.doc_第4页
软件工程课程设计-宾馆信息管理系统.doc_第5页
已阅读5页,还剩44页未读 继续免费阅读

下载本文档

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

文档简介

分类号 编 号 华北水利水电大学 North China University of Water Resources and Electric Power实 验 报 告课 程: 软 件 工 程 实验项目2: 软件编码与测试 题 目: 宾馆管理信息系统 院 系 信息工程学院 专 业 计算机科学与技术 班级学号 201415717 姓 名 李卫朋 指 导 教 师 庄 晋 林 2017年 5 月 29 日华北水利水电大学 软件工程 实验报告20162017学年 第 二 学期 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.login where 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 = System.Windows.Forms.ComboBoxStyle.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.room where 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(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 = System.Windows.Forms.ComboBoxStyle.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 = View.LargeIcon; this.listView1.LargeImageList = this.imageList1; Random rd = new Random(); this.listView1.BeginUpdate(); var result = from info in c.linq.room select 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.room where 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() + rn房间类型: + item.房间类型 + rn房间单价: + 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 = View.LargeIcon; this.listView1.LargeImageList = this.imageList1; Random rd = new Random(); this.listView1.BeginUpdate(); var result = from info in c.linq.room where 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.room where 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() + rn房间类型:+item.房间类型+rn房间单价:+item.房间单价+rn确认使用么?, 提示, 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.login select 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.room select new 房间号 = info.房间号码, 房间类型 = info.房间种类, 房间单价 = info.房间单价, 房间是否使用 = info.房间是否正在使用, ; dataGridView1.DataSource = result; private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) string s = Convert.ToString(dataGridView10, 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.room select 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 = System.Windows.Forms.ComboBoxStyle.DropDownList; comboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.Owner = f; this.s = s; var result = from info in c.linq.room where info.房间号码=s select 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(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.login where info.grade=普通用户 select new 用户名 = info.id, 用户类型 = info.grade, ; dataGridView1.DataSource = result; private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) s = Convert.ToString(dataGridView10, e.RowIndex.Value).Tri

温馨提示

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

评论

0/150

提交评论