public static int GetPurchaserClientID(this IPurchaseOrder po) { var c = po.GetPurchaser(); if (c == null) { return(0); } else { return(c.ClientID); } }