Im getting an "unknown selection" error on this code. Can anyone help me. I don't know what is wrong. My two text boxes both have English selected. blankl and blanlkw have both been initialized as decimals.
if (bunitsCB.Text == "English")
{
switch (dieunitsCB.Text)
{
case "English":
dielTB.Text = Convert.ToString(blankl + Convert.ToDecimal(24));
diewTB.Text = Convert.ToString(blankw + Convert.ToDecimal(24)); break;
case "Metric":
dielTB.Text = Convert.ToString(Math.Round((blankl * Convert.ToDecimal(25.4)), 0) + Convert.ToDecimal(588));
diewTB.Text = Convert.ToString(Math.Round((blankw * Convert.ToDecimal(25.4)), 0) + Convert.ToDecimal(588)); break;
default:
throw new Exception("Unknown selection");
}
}
else
{
switch (dieunitsCB.Text)
{
case "English":
dielTB.Text = Convert.ToString(Math.Round((blankl / Convert.ToDecimal(25.4)), 0) + Convert.ToDecimal(24));
diewTB.Text = Convert.ToString(Math.Round((blankw / Convert.ToDecimal(25.4)), 0) + Convert.ToDecimal(24)); break;
case "Metric":
dielTB.Text = Convert.ToString(blankl + Convert.ToDecimal(588));
diewTB.Text = Convert.ToString(blankw + Convert.ToDecimal(588)); break;
default:
throw new Exception("Unknown selection");
}
}