软件工程课程设计报告宾馆信息管理系统.docx

上传人:b****3 文档编号:5328016 上传时间:2023-05-08 格式:DOCX 页数:46 大小:62.80KB
下载 相关 举报
软件工程课程设计报告宾馆信息管理系统.docx_第1页
第1页 / 共46页
软件工程课程设计报告宾馆信息管理系统.docx_第2页
第2页 / 共46页
软件工程课程设计报告宾馆信息管理系统.docx_第3页
第3页 / 共46页
软件工程课程设计报告宾馆信息管理系统.docx_第4页
第4页 / 共46页
软件工程课程设计报告宾馆信息管理系统.docx_第5页
第5页 / 共46页
软件工程课程设计报告宾馆信息管理系统.docx_第6页
第6页 / 共46页
软件工程课程设计报告宾馆信息管理系统.docx_第7页
第7页 / 共46页
软件工程课程设计报告宾馆信息管理系统.docx_第8页
第8页 / 共46页
软件工程课程设计报告宾馆信息管理系统.docx_第9页
第9页 / 共46页
软件工程课程设计报告宾馆信息管理系统.docx_第10页
第10页 / 共46页
软件工程课程设计报告宾馆信息管理系统.docx_第11页
第11页 / 共46页
软件工程课程设计报告宾馆信息管理系统.docx_第12页
第12页 / 共46页
软件工程课程设计报告宾馆信息管理系统.docx_第13页
第13页 / 共46页
软件工程课程设计报告宾馆信息管理系统.docx_第14页
第14页 / 共46页
软件工程课程设计报告宾馆信息管理系统.docx_第15页
第15页 / 共46页
软件工程课程设计报告宾馆信息管理系统.docx_第16页
第16页 / 共46页
软件工程课程设计报告宾馆信息管理系统.docx_第17页
第17页 / 共46页
软件工程课程设计报告宾馆信息管理系统.docx_第18页
第18页 / 共46页
软件工程课程设计报告宾馆信息管理系统.docx_第19页
第19页 / 共46页
软件工程课程设计报告宾馆信息管理系统.docx_第20页
第20页 / 共46页
亲,该文档总共46页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

软件工程课程设计报告宾馆信息管理系统.docx

《软件工程课程设计报告宾馆信息管理系统.docx》由会员分享,可在线阅读,更多相关《软件工程课程设计报告宾馆信息管理系统.docx(46页珍藏版)》请在冰点文库上搜索。

软件工程课程设计报告宾馆信息管理系统.docx

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

分类号编号

华北水利水电大学

NorthChinaUniversityofWaterResourcesandElectricPower

实验报告

课程:

软件工程

实验项目2:

软件编码与测试

题目:

宾馆管理信息系统

 

院系信息工程学院

专业计算机科学与技术

班级学号201415717

姓名李卫朋

指导教师庄晋林

2017年5月29日

华北水利水电大学软件工程实验报告

2016~2017学年第二学期2014级计算机科学与技术专业

一、实验内容:

宾馆管理信息系统

任务:

入住或预订客房时,用户要对客户管理模块或预订管理模块进行核对审查,并进行登记;客户换房时,要对换房信息进行查询和更新;客户退房时,要进行结算,并对更新客房信息。

主要功能模块:

(1)登录模块:

对用户身份进行验证,只有合法用户才能进入系统;

(2)系统管理模块:

对系统用户进行管理,更改用户名、密码、权限等;

(3)客房管理模块:

对客房信息的添加、修改和删除等;

(4)入住管理模块:

对客户入住信息的登记、查询等功能

(5)订房管理模块:

对客户订房信息的登记、查询等。

(6)换房管理模块:

对客户换房信息的登记、查询等

(7)宾馆结算模块:

对已入住宾馆的顾客进行结算及对订房客户已交的押金进行结算、查询。

二、程序源:

Win764位电脑,vs2012编辑环境,sql2005数据库。

程序源码:

1、登录设计:

namespace宾馆管理信息系统

{

publicpartialclasslogin1:

Form

{

publiclogin1()

{

InitializeComponent();

}

privateconnectionc=newconnection();

privatevoidbutton1_Click(objectsender,EventArgse)

{

if(textBox1.Text.Trim().ToString()!

=String.Empty&&textBox2.Text.Trim().ToString()!

=String.Empty)

{

stringid=null,pw=null,gd=null;

varresult=frominfoinc.linq.login

whereinfo.id==textBox1.Text.ToString().Trim()

selectnew

{

ID=info.id,

pw=info.password,

gd=info.grade,

};

if(result.Count()==0)

{

MessageBox.Show("用户名不存在!

");

}

elseif(result.Count()==1)

{

foreach(varpinresult)

{

id=p.ID;

pw=p.pw;

gd=p.gd;

}

if(pw.Trim()==textBox2.Text.ToString().Trim())

{

this.Hide();

mangerlf=newmanger(gd,textBox1.Text.Trim().ToString());

lf.Show();

}

else

{

MessageBox.Show("密码错误!

");

}

}

}

else

{

MessageBox.Show("不能为空!

");

}

}

privatevoidbutton2_Click(objectsender,EventArgse)

{

this.Close();

}

privatevoidlogin1_FormClosed(objectsender,FormClosedEventArgse)

{

System.Environment.Exit(0);

}

}

}

2、添加住户设计

namespace宾馆管理信息系统

{

publicpartialclassaddpeople:

Form

{

privateconnectionc=newconnection();

privatestrings;

publicaddpeople(Formf,strings)

{

this.Owner=f;

InitializeComponent();

this.s=s;//房间号

comboBox1.DropDownStyle=System.Windows.Forms.ComboBoxStyle.DropDownList;

}

privatevoidbutton1_Click(objectsender,EventArgse)

{

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)

{

varresult=frominfoinc.linq.room

whereinfo.房间号码==s.Trim().ToString()

selectnew

{

房间号=info.房间号码,

房间类型=info.房间种类,

房间单价=info.房间单价,

房间是否使用=info.房间是否正在使用,

};

foreach(variteminresult)

{

if(item.房间单价<=int.Parse(textBox4.Text.Trim().ToString()))

{

try

{

guestr=newguest();

{

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();

}

varedit=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("不能为空!

");

}

}

privatevoidaddpeople_FormClosed(objectsender,FormClosedEventArgse)

{

this.Owner.Owner.Show();

}

}

}

3、添加房间设计:

namespace宾馆管理信息系统

{

publicpartialclassaddroom:

Form

{

publicaddroom(Formf)

{

InitializeComponent();

this.Owner=f;

comboBox1.DropDownStyle=System.Windows.Forms.ComboBoxStyle.DropDownList;

}

privateconnectionc=newconnection();

privatevoidbutton1_Click(objectsender,EventArgse)

{

if(textBox1.Text.Trim().ToString()!

=String.Empty&&comboBox1.Text.Trim().ToString()!

=String.Empty&&textBox3.Text.Trim().ToString()!

=String.Empty)

{

try

{

roomr=newroom();

{

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("不能为空!

");

}

}

privatevoidaddroom_FormClosed(objectsender,FormClosedEventArgse)

{

this.Owner.Show();

}

privatevoidbutton2_Click(objectsender,EventArgse)

{

this.Close();

}

}

}

4、查看所有房间信息设计:

namespace宾馆管理信息系统

{

publicpartialclassallroom:

Form

{

privateconnectionc=newconnection();

publicallroom(Formf)

{

InitializeComponent();

this.Owner=f;

this.listView1.Clear();

this.listView1.View=View.LargeIcon;

this.listView1.LargeImageList=this.imageList1;

Randomrd=newRandom();

this.listView1.BeginUpdate();

varresult=frominfoinc.linq.room

selectnew

{

房间号=info.房间号码,

房间类型=info.房间种类,

房间单价=info.房间单价,

房间是否使用=info.房间是否正在使用,

};

foreach(variteminresult)

{

ListViewItemlvi=newListViewItem();

if(item.房间是否使用.Trim()=="否")

{

lvi.ImageIndex=0;

}

elseif(item.房间是否使用.Trim()=="是")

{

lvi.ImageIndex=1;

}

lvi.Text=item.房间号.Trim().ToString();

this.listView1.Items.Add(lvi);

}

this.listView1.EndUpdate();

}

privatevoidlistView1_ItemActivate(objectsender,EventArgse)

{

varresult=frominfoinc.linq.room

whereinfo.房间号码==listView1.FocusedItem.Text.Trim().ToString()

selectnew

{

房间号=info.房间号码,

房间类型=info.房间种类,

房间单价=info.房间单价,

房间是否使用=info.房间是否正在使用,

};

foreach(variteminresult)

{

DialogResultdr=MessageBox.Show("房间号:

"+listView1.FocusedItem.Text.ToString()+"\r\n房间类型:

"+item.房间类型+"\r\n房间单价:

"+item.房间单价);

}

}

privatevoidallroom_FormClosed(objectsender,FormClosedEventArgse)

{

this.Owner.Show();

}

}

}

5、预订房间设计:

namespace宾馆管理信息系统

{

publicpartialclassbookroom:

Form

{

privateconnectionc=newconnection();

publicbookroom(Formf)

{

InitializeComponent();

this.Owner=f;

this.listView1.Clear();

this.listView1.View=View.LargeIcon;

this.listView1.LargeImageList=this.imageList1;

Randomrd=newRandom();

this.listView1.BeginUpdate();

varresult=frominfoinc.linq.room

whereinfo.房间是否正在使用=="否"

selectnew

{

房间号=info.房间号码,

房间类型=info.房间种类,

房间单价=info.房间单价,

房间是否使用=info.房间是否正在使用,

};

foreach(variteminresult)

{

ListViewItemlvi=newListViewItem();

lvi.ImageIndex=0;

lvi.Text=item.房间号.Trim().ToString();

this.listView1.Items.Add(lvi);

}

this.listView1.EndUpdate();

privatevoidbookroom_FormClosed(objectsender,FormClosedEventArgse)

{

this.Owner.Show();

}

privatevoidlistView1_ItemActivate(objectsender,EventArgse)

{

varresult=frominfoinc.linq.room

whereinfo.房间号码==listView1.FocusedItem.Text.Trim().ToString()

selectnew

{

房间号=info.房间号码,

房间类型=info.房间种类,

房间单价=info.房间单价,

房间是否使用=info.房间是否正在使用,

};

foreach(variteminresult)

{

DialogResultdr=MessageBox.Show("房间号:

"+listView1.FocusedItem.Text.ToString()+"\r\n房间类型:

"+item.房间类型+"\r\n房间单价:

"+item.房间单价+"\r\n确认使用么?

","提示",MessageBoxButtons.OKCancel);

if(dr==DialogResult.OK)

{

//用户选择确认的操作

addpeoplea=newaddpeople(this,listView1.FocusedItem.Text.Trim().ToString());

this.Hide();

a.Show();

}

}

}

}

}

6、查看所有用户设计:

namespace宾馆管理信息系统

{

publicpartialclasschakanyonghu:

Form

{

privateconnectionc=newconnection();

publicchakanyonghu(Formf)

{

this.Owner=f;

InitializeComponent();

varresult=frominfoinc.linq.login

selectnew

{

用户名=info.id,

用户类型=info.grade,

};

dataGridView1.DataSource=result;

}

}

}

7、修改房间的信息设计:

namespace宾馆管理信息系统

{

publicpartialclasschangeroom:

Form

{

privateconnectionc=newconnection();

publicchangeroom(Formf)

{

InitializeComponent();

this.Owner=f;

varresult=frominfoinc.linq.room

selectnew

{

房间号=info.房间号码,

房间类型=info.房间种类,

房间单价=info.房间单价,

房间是否使用=info.房间是否正在使用,

};

dataGridView1.DataSource=result;

}

privatevoiddataGridView1_CellDoubleClick(objectsender,DataGridViewCellEventArgse)

{

strings=Convert.ToString(dataGridView1[0,e.RowIndex].Value).Trim();

changeroom2d=newchangeroom2(this,s);

d.Show();

this.Hide();

}

privatevoidbutton1_Click(objectsender,EventArgse)

{

varresult=frominfoinc.linq.room

selectnew

{

房间号=info.房间号码,

房间类型=info.房间种类,

房间单价=info.房间单价,

房间是否使用=info.房间是否正在使用,

};

dataGridView1.DataSource=result;

}

}

}

namespace宾馆管理信息系统

{

publicpartialclasschangeroom2:

Form

{

privateconnectionc=newconnection();

privatestrings=null;

publicchangeroom2(Formf,strings)

{

InitializeComponent();

comboBox1.DropDownStyle=System.Windows.Forms.ComboBoxStyle.DropDownList;

comboBox2.DropDownStyle=System.Windows.Forms.ComboBoxStyle.DropDownList;

this.Owner=f;

this.s=s;

varresult=frominfoinc.linq.room

whereinfo.房间号码==s

selectnew

{

房间号=info.房间号码,

房间类型=info.房间种类,

房间单价=info.房间单价,

房间是否使用=info.房间是否正在使用,

};

foreach(variteminresult)

{

this.textBox2.Text=item.房间号;

this.textBox1.Text=item.房间单价.ToString();

boBox1.Text=item.房间类型;

boBox2.Text=item.房间是否使用;

}

}

privatevoidbutton1_Click(objectsender,EventArgse)

{

if(textBox1.Text.Trim().ToString()!

=String.Empty&&textBox2.Text.Trim().ToString()!

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 医药卫生 > 基础医学

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2