示例#1
0
        /// <summary>
        /// 单击DataGridView控件中的单元格
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvGuest_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            //显示编辑区
            VisibleEditSection();
            //获取双击客人信息的ID
            id = Convert.ToInt32(this.dgvGuest.Rows[e.RowIndex].Cells["GuestID"].Value);
            //调用业务逻辑层通过客人ID得到客房信息
            guest = GuestManager.GetGuestByID(Convert.ToInt32(id));
            //将客人信息回绑到编辑控件
            this.txtName.Text  = guest.Name.ToString();
            this.txtSex.Text   = guest.Sex.ToString();
            this.txtPhone.Text = guest.Mobile.ToString();
            //Room room = RoomManager.GetRoomByRoomId(Convert.ToInt32(guest.RoomId));
            this.txtRoomID.Text     = guest.RoomId.ToString();
            this.txtArriveTime.Text = guest.ArriveTime.ToString();
            this.txtLeaveTime.Text  = guest.LeaveTime.ToString();
            //调用业务逻辑层通过客人类型ID得到客人类型信息
            GuestCategory gc = GuestCategoryManager.GetGuestCategoryByCategoryID(Convert.ToInt32(guest.CategoryId));

            //回绑客房类型信息
            this.cboCatagory.Text = gc.CategoryName.ToString();
        }