المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : if loop cant excuted properly



C# Programming
02-11-2013, 04:22 PM
if (txtdisc.Text ==null) { txttot22013 = txtpr22013 + txtpr22014 + txtpr22015 + txtpr22016 + txtpr22017; Double txtdisc22013 = Convert.ToDouble(txtdisc.Text); txttot22013 = txttot22013 - txtdisc22013; txttot.Text = txttot22013.ToString(); } else { txttot22013 = txtpr22013 + txtpr22014 + txtpr22015 + txtpr22016 + txtpr22017; txttot.Text = txttot22013.ToString(); } if (txtvat.Text == null) { MessageBox.Show("Enter Vat Amount"); } else { Double txtvat22013 = Convert.ToDouble(txtvat.Text); txtvat22013 = txtvat22013 / 100; txtvat22013 = txtvat22013 * txttot22013; Double txtvatinclu22013 = txtvat22013 + txttot22013; txtvatinclu.Text = txtvatinclu22013.ToString(); }