コード例 #1
0
 private void btnXoa_Click(object sender, EventArgs e)
 {
     try
     {
         Xe xe = new Xe()
         {
             BienSo = txtBienSo.Text
         };
         XeBUS.Xe_Delete(xe);
         MessageBox.Show("Xóa thành công!!");
         tableTiepNhanXe.DataSource = XeBUS.Xe_DanhSach();
         txtBienSo.Text             = "";
         txtDiaChi.Text             = "";
         txtDienThoai.Text          = "";
         txtEmail.Text          = "";
         txtTenChuXe.Text       = "";
         cbHieuXe.SelectedIndex = 0;
         txtBienSo.Focus();
     }
     catch (Exception)
     {
         MessageBox.Show("Không thể xóa xe đang sửa chữa!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     btnXoa.Enabled = false;
 }