Skip to content

Instantly share code, notes, and snippets.

@davetheninja
Created March 31, 2010 11:52
Show Gist options
  • Select an option

  • Save davetheninja/350222 to your computer and use it in GitHub Desktop.

Select an option

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

forki commented Mar 31, 2010

Copy link
Copy Markdown

OMG ;-)

@davetheninja

Copy link
Copy Markdown
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