void Calculate()
{
foreach (Label lbl in alblOutputValues)
lbl.Text = "";
float price1;
float price2;
try
{
price1 = ParseInput(atbxInputValues[0].Text);
price2 = ParseInput(atbxInputValues[1].Text);
}
catch
{
foreach (Label lbl in alblOutputValues)
lbl.Text = "";
return;
}
if (price1 > price2)
{
for (int i = afLevels.Length - 1; i >= 0; i--)
alblOutputValues[i].Text = ((price1 - price2) * afLevels[i] / 100 + price2).ToString("F4");
}
else if (price1 < price2)
{
for (int i = 0; i < afLevels.Length; i++)
alblOutputValues[i].Text = (price2 - (price2 - price1) * afLevels[i] / 100).ToString("F4");
}
else
foreach (Label lbl in alblOutputValues)
lbl.Text = "";
return;
}