私はWindowsフォームに取り組んでいます。私は非常に奇妙な問題に直面しています。
ボタンイベントハンドラーの1つで、ifおよびelse条件を適用しました。
問題は、条件と条件の両方が実行されるかどうかです。
誰かが私が間違っている場所を指摘できますか?
private void button1_Click(object sender, EventArgs e)
{
if (radioButton1.Checked == true && checkEbayName(textBox1.Text) == true )
{
DataSet ds = GetUserByEbayName(textBox1.Text);
if (ds == null)
{
return;
}
dataGridView1.DataSource = ds.Tables["Customer"];
}
if (radioButton2.Checked == true && checkName(textBox1.Text) == true)
{
DataSet ds = GetUserByName(textBox1.Text);
//if (checkCustomer(textBox1.Text, textBox2.Text) == true)
//{
if (ds == null)
{
return;
}
dataGridView1.DataSource = ds.Tables["Customer"];
}
else
{
MessageBox.Show("No Customer with matching details");
}
}