Can someone tell me what I am doing wrong, which leads to the fact that the variables do not matter?
Of course, you are ignoring the possibility that it is workshopIndexnot 0, 1, 2, 3, or 4.
, , :
default:
throw new InvalidOperationException("Invalid selected index " + workshopIndex);
, , :
default:
days = 1;
registration = 100;
break;
, days registration .
, , , lbWorkshop.SelectedIndex != -1. else :
else
{
MessageBox.Show("You didn't select a workshop.");
}
... else . , :
else
{
MessageBox.Show("You didn't select a workshop.");
return;
}
locFees, switch, else.
, : , . , . .