Пример #1
0
 private void checkBox1_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         dataGridView4.DataSource = Phongcontrol.getdatap();
     }
 }
Пример #2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     dataGridPHONG.DataSource     = Phongcontrol.getdatap();
     dataGridView2.DataSource     = Khachhangcontrol.getdataK();
     dataGridView3.DataSource     = Dichvucontrol.getdatadv();
     datDOAN.DataSource           = Doancontrol.getdatadoan();
     dataNCP.DataSource           = NgCPcontrol.getdataNCP();
     dataNV.DataSource            = Nhanviencontrol.getdatanv();
     datap_thue.DataSource        = P_Thuecontrol.getdatap_thue();
     datachitietp_thue.DataSource = Chitietp_Thuecontrol.getdatactThue();
     dathoadon.DataSource         = Hoadoncontrol.getdatahd();
 }
Пример #3
0
 //thêm phòng
 private void btnthem_Click(object sender, EventArgs e)
 {
     try
     {
         Phongbject pp = new Phongbject();
         pp.Map   = txtMAP.Text;
         pp.Loaip = cmbLOAIP.Text;
         pp.Hangp = cmbHANGP.Text;
         pp.Giap  = Int32.Parse(txtGIAP.Text);
         pp.Ttp   = cmbTTP.Text;
         pp.Sdtp  = Int32.Parse(txtSDTP.Text);
         Phongcontrol.addphong(pp);
         dataGridPHONG.DataSource = Phongcontrol.getdatap();
     }
     catch { }
 }
Пример #4
0
 //xóa phòng
 private void btnnxoa_Click(object sender, EventArgs e)
 {
     try
     {
         DialogResult dg = new DialogResult();
         dg = MessageBox.Show("Bạn có muốn xóa không", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (dg == DialogResult.Yes)
         {
             Phongbject P = new Phongbject();
             P.Map = txtMAP.Text;
             Phongcontrol.deletephong(P);
             dataGridPHONG.DataSource = Phongcontrol.getdatap();
         }
     }
     catch { }
 }
Пример #5
0
 //sửa phòng
 private void btnsua_Click(object sender, EventArgs e)
 {
     try
     {
         Phongbject P = new Phongbject();
         P.Map   = txtMAP.Text;
         P.Loaip = cmbLOAIP.Text;
         P.Hangp = cmbHANGP.Text;
         P.Giap  = Int32.Parse(txtGIAP.Text);
         P.Ttp   = cmbTTP.Text;
         P.Sdtp  = Int32.Parse(txtSDTP.Text);
         Phongcontrol.updatephong(P);
         dataGridPHONG.DataSource = Phongcontrol.getdatap();
     }
     catch { }
 }
Пример #6
0
 private void button2_Click(object sender, EventArgs e)
 {
     dataGridPHONG.DataSource = Phongcontrol.getdatap();
 }