Example #1
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            DialogResult check = MessageBox.Show("Bạn có muốn xóa không", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (check == DialogResult.Yes)
            {
                ENTITY.Xe xe = new ENTITY.Xe();
                xe.ID_Xe = txtID_Xe.Text.Trim();
                DAL.Xe_Model x = new DAL.Xe_Model();
                x.deleteXe(xe);
            }
            showLsvThongTinXe();
            lockControl();
            clearControl();
        }
Example #2
0
 private void btnTimKiem_Click(object sender, EventArgs e)
 {
     try
     {
         clearLsvThongTinXe();
         DAL.Xe_Model  x  = new DAL.Xe_Model();
         SqlDataReader dr = x.searchXe(cmbTimKiem.Text.Trim(), cmbValue.Text.Trim());
         while (dr.Read())
         {
             addList(dr);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #3
0
 private void btnLuu_Click(object sender, EventArgs e)
 {
     ENTITY.Xe xe = new ENTITY.Xe();
     xe.ID_Xe     = txtID_Xe.Text.Trim();
     xe.ID_HangXe = cmbID_HangXe.Text.Trim();
     xe.BienSoXe  = txtBienSoXe.Text.Trim();
     xe.DoiXe     = txtDoiXe.Text.Trim();
     xe.SoKhung   = txtSoKhung.Text.Trim();
     xe.SoMay     = txtSoMay.Text.Trim();
     xe.SoKM      = txtSoKM.Text.Trim();
     DAL.Xe_Model x = new DAL.Xe_Model();
     if (kt == true)
     {
         x.insertXe(xe);
     }
     else
     {
         x.editXe(xe);
     }
     showLsvThongTinXe();
     clearControl();
     lockControl();
 }