当前位置:首页 > 《HHL酒店管理系统》课程设计报告书V1.0 - 图文
else
MessageBox.Show(\可以添加!\); }
private void button2_Click(object sender, EventArgs e) {
if (this.textBox1.Text == \ || this.textBox2.Text == \||this.comboBox1.Text==\||this.comboBox2.Text==\) {
MessageBox.Show(\请把楼层、房间号、房价、房间类型填写完整!\); } else {
SqlConnection cnn = myCon.getCon();
string sql = \ + this.textBox1.Text + \ + this.comboBox2.SelectedItem.ToString() + \ + this.textBox2.Text + \ + this.comboBox1.SelectedItem.ToString() + \空房','','','无')\; cnn.Open();
SqlCommand cmd = new SqlCommand(sql, cnn); cmd.ExecuteNonQuery();
MessageBox.Show(\添加成功!\); } }
private void button3_Click(object sender, EventArgs e) {
if (this.textBox1.Text == \ || this.textBox2.Text == \ || this.comboBox1.Text == \ || this.comboBox2.Text == \) {
MessageBox.Show(\请把楼层、房间号、房价、房间类型填写完整!\); } else {
SqlConnection cnn = myCon.getCon();
string sql = \ + this.textBox2.Text + \ + this.comboBox1.SelectedItem.ToString() + \ + this.textBox1.Text + \; cnn.Open();
SqlCommand cmd = new SqlCommand(sql, cnn); cmd.ExecuteNonQuery();
MessageBox.Show(\修改成功!\); } }
- 37 -
private void button4_Click(object sender, EventArgs e) {
SqlConnection cnn = myCon.getCon();
string sql = \ + this.textBox1.Text + \; cnn.Open();
SqlCommand cmd = new SqlCommand(sql, cnn); string rt = (string)cmd.ExecuteScalar(); if (rt != \空房\)
MessageBox.Show(\该房间在使用中\); else if(rt==\空房\) {
string sql1 = \from Room where R_ID='\ + this.textBox1.Text + \;
SqlCommand cmd1 = new SqlCommand(sql1, cnn); cmd1.ExecuteNonQuery();
MessageBox.Show(\删除成功!\); } }
private void button5_Click(object sender, EventArgs e) {
SqlConnection con = myCon.getCon(); DataSet ds = null; con.Open();
StringBuilder sql = new StringBuilder();
sql.Append(\房间号,R_floor as 楼层,R_money as 房价,R_type as 房间类型,R_status as 房间状态,R_intime as 入住时间,R_daoqitime as 退房时间,R_notes as 备注 from Room where R_ID='\ + this.textBox1.Text + \); SqlDataAdapter dapt = new SqlDataAdapter(sql.ToString(), con); ds = new DataSet(); dapt.Fill(ds, \);
dataGridView1.DataSource = ds.Tables[0]; }
private void FrmRoomInf_Load(object sender, EventArgs e) {
SqlConnection con = myCon.getCon(); DataSet ds = null; con.Open();
StringBuilder sql = new StringBuilder();
sql.Append(\房间号,R_floor as 楼层,R_money as 房价,R_type as 房间类型,R_status as 房间状态,R_intime as 入住时间,R_daoqitime as 退房时间,R_notes as 备注 from Room\);
- 38 -
SqlDataAdapter dapt = new SqlDataAdapter(sql.ToString(), con); ds = new DataSet(); dapt.Fill(ds, \);
dataGridView1.DataSource = ds.Tables[0]; } 运行结果:
由右边的显示区可知道一楼总共有八间房,从101——108,现在想添加一间109房。
输入109房号后检测是否存在该房号
- 39 -
系统提示可以添加,确定价格和类型,之后点击“添加”
查询109是否添加到数据库
显示区有109房的添加成功的信息。
7.设计心得
黄健帮心得
HHL酒店管理系统对于我甚至我组员来说比较陌生,因为可能对酒店的业务流程不是很
熟悉,例如一间酒店有很多层,每一层有很多间套房,更大的酒店甚至会有几栋楼层,再如,房间的状态也是要有所考虑的,空房、住房中、维修中等等,因此,要先确定好需求,才可以把系统的功能确定下来。在数据库设计过程中,在约束建立时容易出现错误,这里要必须要理清表间关系。另外,我负责本系统的房间信息管理、房间类型管理、客户信息管理、换房管理等功能。其中房间信息管理,我主要对房间信息的添加、修改、删除和查询等功能进
- 40 -
共分享92篇相关文档