You have several issues:
You are missing an else after the first
if
.The code below can never end up being
true
.
The two if
statement collide (the txtItemNumber.Text
comparison is the problem). Hence you will never end up writing to Drinks.txt:
if ((rdoDrinks.Checked == true) && (txtItem.Text != "") && (txtItemNumber.Text == ""))
...
if ((txtItem.Text != "") && (txtItemNumber.Text != ""))