Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        private void GiaPhongForm_Load(object sender, EventArgs e)
        {
            Phong phong = new Phong();

            dataGridView1.DataSource = phong.LayTableGiaPhong();
        }