コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (this.cb_rzfj.SelectedIndex == 0)
            {
                toolTip1.Show("请选择入住房间类型", this.cb_rzfj, 1000);
                cb_rzfj.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txt_lxdh.Text.Trim()))
            {
                toolTip1.Show("联系电话不能为空!", this.txt_lxdh, 1000);
                txt_lxdh.Focus();
                return;
            }
            RoomRecord record = new RoomRecord();

            record.lsh  = LshCreate.GetLsh();
            record.lxdh = this.txt_lxdh.Text.Trim();
            record.fjbh = Bll_Room.GetFreeRoomIdWithFjlx(cb_rzfj.SelectedValue.ToString()).ToString();
            record.rzzt = "4";
            if (Bll_Guset.AddReserveRecord(record) > 0)
            {
                MessageBox.Show("预约成功!房间号:" + record.fjbh, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
コード例 #2
0
ファイル: FrmSearch.cs プロジェクト: yyl7727/HotelManager
        private void button1_Click(object sender, EventArgs e)
        {
            SearchInfoVo searchInfoVo = new SearchInfoVo();

            if (!string.IsNullOrEmpty(textBox1.Text.Trim()))
            {
                searchInfoVo.lsh = textBox1.Text.Trim();
            }
            if (!string.IsNullOrEmpty(textBox2.Text.Trim()))
            {
                searchInfoVo.khxm = textBox2.Text.Trim();
            }
            if (!string.IsNullOrEmpty(textBox3.Text.Trim()))
            {
                searchInfoVo.lxdh = textBox3.Text.Trim();
            }
            if (!string.IsNullOrEmpty(textBox4.Text.Trim()))
            {
                searchInfoVo.fjbh = textBox4.Text.Trim();
            }
            if (!string.IsNullOrEmpty(textBox5.Text.Trim()))
            {
                searchInfoVo.sfzhm = textBox5.Text.Trim();
            }
            DataTable dataTable = Bll_Guset.GetRecordDataTable(searchInfoVo);

            dataGridView1.DataSource = dataTable;
        }
コード例 #3
0
ファイル: FrmCheckin.cs プロジェクト: yyl7727/HotelManager
        private void btn_ok_Click(object sender, EventArgs e)
        {
            if (listView1.Items.Count == 0)
            {
                toolTip1.Show("客户信息不能为空!", this.listView1, 1000);
                listView1.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txt_rzts.Text.Trim()))
            {
                toolTip1.Show("入住天数不能为空!", this.txt_rzts, 1000);
                txt_rzts.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txt_lxdh.Text.Trim()))
            {
                toolTip1.Show("联系电话不能为空!", this.txt_lxdh, 1000);
                txt_lxdh.Focus();
                return;
            }
            if (this.cb_rzfj.SelectedIndex == 0)
            {
                toolTip1.Show("请选择入住房间类型", this.cb_rzfj, 1000);
                cb_rzfj.Focus();
                return;
            }
            RoomRecord record = new RoomRecord();

            record.lsh  = LshCreate.GetLsh();
            record.lxdh = txt_lxdh.Text.Trim();
            record.rzyj = txt_rzyj.Text.Trim();
            record.fjbh = Bll_Room.GetFreeRoomIdWithFjlx(cb_rzfj.SelectedValue.ToString()).ToString();
            record.rzrq = this.dtp_rzsj.Value;
            record.rzts = this.txt_rzts.Text.Trim();
            record.tfrq = record.rzrq.AddDays(Convert.ToInt32(record.rzts));
            record.rzzt = "1";
            record.khxx = TempGuest.guests;

            try
            {
                if (Bll_Guset.AddCheckinRecord(record) > 0)
                {
                    MessageBox.Show("入住办理成功!房间号:" + record.fjbh, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (MySqlException ex)
            {
                MessageBox.Show("数据库异常:" + ex.Message);
            }
            catch (Exception ex)
            {
                MessageBox.Show("其它异常:" + ex.Message);
            }
        }
コード例 #4
0
ファイル: FrmCheckin.cs プロジェクト: yyl7727/HotelManager
        /// <summary>
        /// 通过手机号查询客户预约信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            string phone = textBox1.Text.Trim();

            RoomRecord roomRecord = Bll_Guset.GetReserveRecordByPhone(phone);

            if (!string.IsNullOrEmpty(roomRecord.lsh))
            {
                textBox5.Text = roomRecord.fjbh;
                textBox4.Text = roomRecord.lxdh;
            }
            else
            {
                MessageBox.Show("没有查询到对应的预约信息");
            }
        }
コード例 #5
0
 /// <summary>
 /// 根据房间编号获取状态为1的入住记录
 /// </summary>
 private void GetGuestInfoWifhFjbh()
 {
     try
     {
         guestrecord    = Bll_Guset.GetRecordInfo(fjbh);
         lb_khxm.Text   = guestrecord.khxm;
         lb_sfzmhm.Text = guestrecord.sfzmhm;
         lb_rzrq.Text   = guestrecord.rzrq.ToString();
     }
     catch (MySqlException ex)
     {
         MessageBox.Show("数据库异常:" + ex.Message);
     }
     catch (Exception ex)
     {
         MessageBox.Show("其它异常:" + ex.Message);
     }
 }
コード例 #6
0
        /// <summary>
        /// 退房
        /// </summary>
        private void CheckOut()
        {
            int flag = 0;

            try
            {
                flag = Bll_Guset.RoomCheckOut(lb_fjbh.Text);
            }
            catch (MySqlException ex)
            {
                MessageBox.Show("数据库异常:" + ex.Message);
            }
            catch (Exception ex)
            {
                MessageBox.Show("其它异常:" + ex.Message);
            }
            if (flag > 0)
            {
                MessageBox.Show("退房成功!");
                this.Close();
            }
        }
コード例 #7
0
ファイル: FrmCheckin.cs プロジェクト: yyl7727/HotelManager
        /// <summary>
        /// 预约入住确认
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button2_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(textBox3.Text))
            {
                toolTip1.Show("入住天数不能为空!", this.textBox3, 1000);
                textBox3.Focus();
                return;
            }
            if (listView2.Items.Count == 0)
            {
                toolTip1.Show("客户信息不能为空!", this.listView2, 1000);
                listView2.Focus();
                return;
            }
            RoomRecord roomRecord = Bll_Guset.GetReserveRecordByPhone(textBox4.Text.Trim());

            roomRecord.rzyj = textBox2.Text.Trim();
            roomRecord.rzrq = dateTimePicker1.Value;
            roomRecord.rzts = textBox3.Text.Trim();
            roomRecord.tfrq = roomRecord.rzrq.AddDays(Convert.ToInt32(roomRecord.rzts));
            roomRecord.rzzt = "1";
            roomRecord.khxx = TempGuest.guests;
            try
            {
                if (Bll_Guset.UpdateReserveRecord(roomRecord) > 0)
                {
                    MessageBox.Show("入住办理成功!房间号:" + roomRecord.fjbh, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (MySqlException ex)
            {
                MessageBox.Show("数据库异常:" + ex.Message);
            }
            catch (Exception ex)
            {
                MessageBox.Show("其它异常:" + ex.Message);
            }
        }
コード例 #8
0
ファイル: FrmMain.cs プロジェクト: yyl7727/HotelManager
        /// <summary>
        /// 取消预订
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void 取消预订ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (lv_room.SelectedItems.Count == 1 && lv_room.SelectedItems[0].ImageIndex == 3)
            {
                string fjbh = lv_room.SelectedItems[0].Text;

                //根据房间编号获取对应房间的预约信息
                RoomRecord roomRecord = Bll_Guset.GetReserveRecordByFjbh(fjbh);
                //取消对应流水号的预定信息
                if (Bll_Guset.CancelReserveRecord(roomRecord) > 0)
                {
                    FrmMain_Load(null, null);
                }
                else
                {
                    MessageBox.Show("取消预约失败");
                }
            }
            else
            {
                MessageBox.Show("不满足取消预约条件!");
            }
        }
コード例 #9
0
ファイル: FrmSearch.cs プロジェクト: yyl7727/HotelManager
        private void InitData()
        {
            DataTable dataTable = Bll_Guset.GetRecordDataTable(new SearchInfoVo());

            dataGridView1.DataSource = dataTable;
        }
コード例 #10
0
        private void btn_ok_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txt_khxm.Text.Trim()))
            {
                toolTip1.Show("客户姓名不能为空!", this.txt_khxm, 1000);
                txt_khxm.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txt_sfzmhm.Text.Trim()))
            {
                toolTip1.Show("身份证号不能为空!", this.txt_sfzmhm, 1000);
                txt_sfzmhm.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txt_rzts.Text.Trim()))
            {
                toolTip1.Show("入住天数不能为空!", this.txt_rzts, 1000);
                txt_rzts.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txt_lxdh.Text.Trim()))
            {
                toolTip1.Show("联系电话不能为空!", this.txt_lxdh, 1000);
                txt_lxdh.Focus();
                return;
            }
            if (this.cb_rzfj.SelectedIndex == 0)
            {
                toolTip1.Show("请选择入住房间类型", this.cb_rzfj, 1000);
                cb_rzfj.Focus();
                return;
            }
            GuestRecord guest = new GuestRecord();

            guest.lsh    = lshCreate.GetLsh();
            guest.khxm   = this.txt_khxm.Text.Trim();
            guest.sfzmhm = this.txt_sfzmhm.Text.Trim();
            guest.lxdh   = this.txt_lxdh.Text.Trim();
            guest.xb     = this.cb_khxb.Text;
            guest.rzyj   = this.txt_rzyj.Text.Trim();
            guest.fjbh   = Bll_Room.GetFreeRoomIdWithFjlx(cb_rzfj.SelectedValue.ToString()).ToString();
            guest.rzrq   = this.dtp_rzsj.Value;
            guest.rzts   = this.txt_rzts.Text.Trim();
            guest.tfrq   = guest.rzrq.AddDays(Convert.ToInt32(guest.rzts));
            guest.rzzt   = "1";
            try
            {
                if (Bll_Guset.AddGuest(guest) > 0)
                {
                    MessageBox.Show("入住办理成功!房间号:" + guest.fjbh, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (MySqlException ex)
            {
                MessageBox.Show("数据库异常:" + ex.Message);
            }
            catch (Exception ex)
            {
                MessageBox.Show("其它异常:" + ex.Message);
            }
        }