Skip to content

Instantly share code, notes, and snippets.

@davetheninja
Created March 31, 2010 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davetheninja/350222 to your computer and use it in GitHub Desktop.
Save davetheninja/350222 to your computer and use it in GitHub Desktop.
public int GetTotalStock(Guid ProductGuid)
{
DataSet dsStock = new ProductsService().GetStockCount(ProductGuid);
if (dsStock.Tables != null)
{
if (dsStock.Tables[0].Rows.Count > 0)
{
if (dsStock.Tables[0].Rows[0]["TotalStock"] != null)
{
return int.Parse(dsStock.Tables[0].Rows[0]["TotalStock"].ToString());
}
else
{
return 0;
}
}
else
{
return 0;
}
}
else
{
return 0;
}
}
@forki
Copy link

forki commented Mar 31, 2010

OMG ;-)

@davetheninja
Copy link
Author

Just stumbled across this bad boy clearing out an old server :-) Priceless!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment