private void btnDatPhong_Click(object sender, EventArgs e) { Phong phong = new Phong(); string ten = txbTenNguoiDat.Text; int soPhong = Convert.ToInt32(txbSoPhong.Text); string sdt = txbSDT.Text; string ngayDat = dtpNgayDat.Text; string ngayTra = dtpNgayTra.Text; string loaiPhong = txbLoaiPhong.Text; if (phong.ThemPhongDatTrongTableDSPhongDaDat(ten, soPhong, sdt, ngayDat, ngayTra, loaiPhong)) { MessageBox.Show("Đã đặt phòng thành công", "Đặt phòng", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Không thể đặt phòng", "Đặt phòng", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void GiaPhongForm_Load(object sender, EventArgs e) { Phong phong = new Phong(); dataGridView1.DataSource = phong.LayTableGiaPhong(); }