Ejemplo n.º 1
0
        private void Load_DuLieu(object sender, EventArgs e)
        {
            string sql1 = "Select * from QLTTB";

            dataTB.DataSource = null;
            dataTB.DataSource = KetNoiCSDL_TB.LoadDuLieu(sql1, "QLTTB");
        }
Ejemplo n.º 2
0
        private void btn_timkiem_Click(object sender, EventArgs e)
        {
            KetNoiCSDL_TB.TaoKetNoi_CSDL();
            grdtimkiem.DataSource = null;
            string sql1 = "Select * from QLTTB where MA_PHONG like '" + txt_timkiem.Text + "' or MA_LOAITB like '" + txt_timkiem.Text + "' or TEN_TB like '%" + txt_timkiem.Text + "%' or SO_LUONG like '" + txt_timkiem.Text + "'";

            grdtimkiem.DataSource = KetNoiCSDL_TB.LoadDuLieu(sql1, "QLTTB");
        }
Ejemplo n.º 3
0
        private void btnChen_Click(object sender, EventArgs e)
        {
            try
            {
                string d = txt_maphong.Text;
                string a = txtMLTB.Text;
                string b = txtTTB.Text;
                string c = txtSL.Text;



                KetNoiCSDL_TB.Chen_DuLieu(d, a, b, c);
                Load_DuLieu(null, null);
                HienThi_DL();
            }
            catch (OleDbException Exception)
            {
                String a = Convert.ToString(Exception.ErrorCode);
                MessageBox.Show(a);
            }
        }
Ejemplo n.º 4
0
        private void load(object sender, EventArgs e)
        {
            string sql = "SELECT * from TKB";

            grd_tkb.DataSource = null;
            grd_tkb.DataSource = ketnoiCSDL_TKB.laydl(sql, "TKB");

            string SQL = "Select * from LOP";

            grd_lop.DataSource = null;
            grd_lop.DataSource = KeyNoiCSDL_LOP.LoadDuLieu(SQL, "LOP");

            string SQL1 = "Select * from QLTTB";

            grd_TB.DataSource = null;
            grd_TB.DataSource = KetNoiCSDL_TB.LoadDuLieu(SQL1, "QLTTB");

            string SQL2 = "Select * from ROOM";

            grd_room.DataSource = null;
            grd_room.DataSource = KETNOICSDL_ROOM.laydulieu(SQL2, "ROOM");
        }
Ejemplo n.º 5
0
 private void btnXoa_Click_1(object sender, EventArgs e)
 {
     KetNoiCSDL_TB.Xoa_Dulieu(txt_maphong.Text);
     Load_DuLieu(null, null);
     HienThi_DL();
 }
Ejemplo n.º 6
0
 private void btnLuu_Click_1(object sender, EventArgs e)
 {
     KetNoiCSDL_TB.Luu_Dulieu(txtMLTB.Text, txtTTB.Text, txtSL.Text, txt_maphong.Text);
     Load_DuLieu(null, null);
     HienThi_DL();
 }