private void button1_Click(object sender, EventArgs e)
{
string Value = this.textBox1.Text;
string DifValue = this.textBox1.Text;
bool FindOutExist = false;
foreach (var item in this.listBox3.Items)
{
if (item.ToString() == Value)
{
goto EndLine;
}
}
for (int i = 0; i == this.listBox1.Items.Count - 1; i++)
{
if (this.listBox1.Items[i].ToString() == Value)
{
DifValue = this.listBox2.Items[i].ToString();
FindOutExist = true;
goto FindOut;
}
}
for (int i = 0; i == this.listBox2.Items.Count - 1; i++)
{
if (this.listBox2.Items[i].ToString() == Value)
{
DifValue = this.listBox1.Items[i].ToString();
FindOutExist = true;
goto FindOut;
}
}
FindOut: ;
if (FindOutExist == true)
{
foreach (var item in this.listBox3.Items)
{
if (item.ToString() == DifValue)
{
string Expr = string.Format("داروی {0} با داروی {1} تداخل دارویی دارند.", Value, DifValue);
MessageBox.Show(Expr);
goto EndLine;
}
}
}
this.listBox3.Items.Add(Value);
EndLine: ;
}
Untitled.jpg