第一范文网 - 专业文章范例文档资料分享平台

《HHL酒店管理系统》课程设计报告书V1.0 - 图文

来源:用户分享 时间:2025/5/16 10:48:39 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

6.系统实现

以下是本系统主要的八大功能的实现,包括了开房登记、换房、续房、结账退房、营业查询、住宿记录、房间类型管理、房间信息管理。

6.1开房登记功能的实现

代码如下:

SqlConnection cnn = myCon.getCon();

string sql = \ +

Convert.ToDateTime(txttime.Text.ToString())+ \ +

Convert.ToDateTime(dateTimePicker1.Text.ToString()) + \ + cmbID.SelectedItem.ToString() + \; cnn.Open();

SqlCommand cmd = new SqlCommand(sql, cnn); cmd.ExecuteNonQuery();

//正则表达式

string chardid = @\;

string phone = @\;

if (txtname.Text == \) {

MessageBox.Show(\姓名不能为空\); }

else if (cmbsex.Text == \) {

MessageBox.Show(\性别不能为空\); }

else if (cmbtype.Text == \) {

MessageBox.Show(\类型不能为空\); }

else if (cmbID.Text == \) {

MessageBox.Show(\房号不能为空\); }

else if (txtpr.Text == \) {

MessageBox.Show(\押金不能为空\); }

else if (txtroompr.Text == \) {

- 17 -

MessageBox.Show(\房费不能为空\); }

else if (txtphone.Text == \) {

MessageBox.Show(\电话号码不能为空\); }

else if (txtcardid.Text == \) {

MessageBox.Show(\身份证不能为空\); }

else if (!Regex.IsMatch(txtphone.Text, phone)) {

MessageBox.Show(\电话号码只能是为数字,并且第一位为,第二位为,5,8\); }

else if (!Regex.IsMatch(txtcardid.Text, chardid)) {

MessageBox.Show(\身份证只能是或位,为的最后一位是【X|x】\); }

else {

CustomerInf sti = new CustomerInf();

sti.Name = txtname.Text.Trim().ToString(); sti.Sex = cmbsex.SelectedItem.ToString();

sti.Id = Convert.ToInt32(cmbID.SelectedItem.ToString()); sti.Amoney = Convert.ToInt32(txtpr.Text); sti.Moeny = Convert.ToInt32(txtroompr.Text); sti.Phone = txtphone.Text.Trim().ToString(); sti.Cardid = txtcardid.Text.Trim().ToString(); sti.DaoqTime = dateTimePicker1.Text.ToString(); sti.Notes = txtinf.Text.Trim().ToString();

bool v = BLL.CustomerBLL.BllSelectNullRoom(sti); bool insertroom =

BLL.CustomerBLL.BllinsertRoom(Convert.ToInt32(txtroompr.Text), Convert.ToInt32(cmbID.SelectedItem.ToString()));

if (v) {

- 18 -

MessageBox.Show(\添加成功。。。\); }

ds = BLL.CustomerBLL.BllSelect();

dataGridView1.DataSource = ds.Tables[0];

} 运行结果: 先输入客户信息

- 19 -

点击“确定登记”按钮后

- 20 -

《HHL酒店管理系统》课程设计报告书V1.0 - 图文.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c3hqtu1wbhp4i6jo0x0ha_5.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top