I am stucked with if --- else condition i dont know where my code goes wrong, i googled but couldnt get any help. the first If condition works fine but the rest else if doesnt work on run time, below is my coding, any help would be appreciated thnx
private void button1_Click(object sender, EventArgs e)
{
float PremiumCost = float.Parse(txtPremiumCost.Text);
float LoadingAmount = float.Parse(txtLoadingAmount.Text);
float PremiumFronting = float.Parse(txtPremiumFrontingFee.Text);
float ChargedStatusAmount = float.Parse(txtChargedStatusAmount.Text);
float RcvBrokerageAmount = float.Parse(txtNCBBrokerageAmount.Text);
float NetReceivable = 0;
{
if (radioButton1.Checked == true || radioButton4.Checked == true)
{
NetReceivable = PremiumCost + LoadingAmount + PremiumFronting;
}
else if (radioButton2.Checked == true)
{
NetReceivable = PremiumCost + LoadingAmount + PremiumFronting + ChargedStatusAmount;
}
else if (radioButton1.Checked == true)
{
NetReceivable = PremiumCost + LoadingAmount + PremiumFronting - ChargedStatusAmount;
}
}
txtNetReceivable.Text = NetReceivable.ToString("N2");
}