Ejemplo n.º 1
0
 private void btnTimKiem_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtMaNCC.Text != "")
         {
             nhaCungCapDTO.MaNCC = Convert.ToInt32(txtMaNCC.Text);
             dgvNCC.DataSource   = nccBLL.SearchNCC1(nhaCungCapDTO);
         }
         else if (txtTenNCC.Text != "")
         {
             nhaCungCapDTO.HoTen = txtTenNCC.Text;
             dgvNCC.DataSource   = nccBLL.SearchNCC2(nhaCungCapDTO);
         }
     }
     catch (SqlException ex)
     {
         MessageBox.Show("Lỗi " + ex.Message.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }