private void btnAccept_Click(object sender, EventArgs e)
{
string s="";
int count2 = 0;
foreach (string item in listOrder.Items)
{
int count = 0;
for (int i = 0; i < listOrder.Items.Count; i++)
if (item == listOrder.Items[i])
count++;
if(count>1)
{
MessageBox.Show("Ban da chon trung san pham. Hay xoa bot san pham trung", "Chu y", MessageBoxButtons.OK);
count2++;
break;
}
}
if (count2 == 0)
{
string s1 = "", s2 = "";
foreach (string item in listOrder.Items)
s += item + "\n";
RadioButton[] rd={rbMoney,rbVisa,rbSec};
foreach (RadioButton r in rd)
if (r.Checked)
s1 = r.Text;
CheckBox[] cb = { checkBox1, checkBox2, checkBox3 };
foreach (CheckBox c in cb)
if (c.Checked)
s2 += c.Text+", ";
s2 = s2.Remove(s2.Length - 2, 2);
MessageBox.Show(label1.Text + txtName.Text + "\n" + label2.Text + txtAddress.Text
+ "\n" + label4.Text + "\n" + s + groupBox2.Text + s1+"\n"+groupBox1.Text
+s2, "Xac Nhan", MessageBoxButtons.OK);
}
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.