private void dgvShowInfoRoom_MouseDoubleClick(object sender, MouseEventArgs e) { if (dgvShowInfoRoom.SelectedRows.Count == 0) { return; } Room roomM = new Room( Convert.ToInt32(dgvShowInfoRoom.SelectedRows[0].Cells["RoomID"].Value), dgvShowInfoRoom.SelectedRows[0].Cells["Number"].Value.ToString(), Convert.ToInt32(dgvShowInfoRoom.SelectedRows[0].Cells["BedNumber"].Value), dgvShowInfoRoom.SelectedRows[0].Cells["Description"].Value.ToString(), dgvShowInfoRoom.SelectedRows[0].Cells["State"].Value.ToString(), Convert.ToInt32(dgvShowInfoRoom.SelectedRows[0].Cells["GuestNumber"].Value), Convert.ToInt32(dgvShowInfoRoom.SelectedRows[0].Cells["TypeID"].Value) ); RoomDetailForm frmRoomDetail = new RoomDetailForm(roomM); frmRoomDetail.MdiParent = this.MdiParent; frmRoomDetail.Show(); }
private void tsbtnAdd_Click(object sender, EventArgs e) { thisRoomID = 0; RoomDetailForm frmRoomDetail = new RoomDetailForm(thisRoomID); frmRoomDetail.MdiParent = this.MdiParent; frmRoomDetail.Show(); }