pstrjds, From the code you have provided I am trying to implement that code and the msdn link you provided couple of days ago. I am not sure how to put it together but I am see
The fist thing i can see is that this in not right
if (ret == 1) { lbqty.Text = "Re-order. Remaining stocks: 1"; dgUpdate(); } else
should be
if (ret - 1 == 1) { lbqty.Text = "Re-order. Remaining stocks: 1"; dgUpdate(); } else
because when the value you read is 1 and you decrease it its 0.