private void btnSuaPhong_Click(object sender, EventArgs e) { try { int i = dgvPhong.CurrentCell.RowIndex; Phong p = new Phong(); p.MaPhong = dgvPhong.Rows[i].Cells["MaPhong"].Value.ToString(); p.TenPhong = txtTenPhong.Text; p.TrangThai = cboTrangThaiPhong.Text; p.GiaTheoGio = Convert.ToInt32(txtGiaTheoGio.Text); p.GiaTheoNgay = Convert.ToInt32(txtGiaTheoNgay.Text); p.MaLP = cboLoaiPhong.SelectedValue.ToString(); dal_phong.SuaPhong(p); dgvPhong.DataSource = dal_phong.ThongTinCacPhong(); MessageBox.Show("Sửa thông tin phòng thành công!"); } catch (Exception) { throw; } }