The Code Won't Execute all : <p>I have the following code:</p>

<pre><code>private void G1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
    {

            decimal quantity = 0, cost = 0;
            decimal   totalstock = 0, newtotalstock = 0;
            if (decimal.TryParse(G1.Rows[e.RowIndex].Cells["RealExport"].Value.ToString(), out quantity) &amp;&amp; decimal.TryParse(G1.Rows[e.RowIndex].Cells["Cost"].Value.ToString(), out cost))
            {
                decimal price = quantity * cost;
                G1.Rows[e.RowIndex].Cells["Total"].Value = price.ToString();
            }

            if (decimal.TryParse(G1.Rows[e.RowIndex].Cells["TotalStock"].Value.ToString(), out totalstock) &amp;&amp; decimal.TryParse(G1.Rows[e.RowIndex].Cells["RealExport"].Value.ToString(), out quantity))
            {
                newtotalstock = totalstock - quantity;
                G1.Rows[e.RowIndex].Cells["TotalStock"].Value = newtotalstock.ToString();
                return;
            }
            decimal avai = 0, newavai = 0;
            if (decimal.TryParse(G1.Rows[e.RowIndex].Cells["RealExport"].Value.ToString(), out quantity) &amp;&amp; decimal.TryParse(G1.Rows[e.RowIndex].Cells["AvailableStock"].Value.ToString(), out avai))
            {
                newavai = avai - quantity;
                G1.Rows[e.RowIndex].Cells["AvailableStock"].Value = newavai.ToString();
                return;
            } }
</code></pre>

<p>The problem is, it only <strong>execute 2 out of 3</strong> the code, I mean, when the <strong>newtotalstock</strong> is calculated, the code will end.</p>

<p>I try to change the <strong>newavai</strong> to up above, and the result is the same, it will calculate the <strong>newavai</strong> and pass the <strong>newtotalstock</strong>. I dont know why, all the code are correct. Please help</p>
