public IList <Invoice> LoadInvoicesFor(int clientId, int batchId) {//need to refactor like this so we don't get any null reference exception when call to DataEntry returns nothing try { DataSet ds = batches.LoadBatchTrns(1, batchId.ToString(), clientId, 7); DataTableCollection tables = (ds == null)?null:ds.Tables; return(new InvoiceBuilder().Build(tables["BatchTrns"])); } catch { } return(null); }
public IList <ClaimedCredit> LoadCreditsClaimed(int retentionItemDate, int clientId) { DataTableCollection tables = null; DataSet theDS = batches.LoadBatchTrns(2, retentionItemDate.ToString(), clientId, 7); if (theDS != null) { tables = theDS.Tables; return(new CreditsClaimedBuilder().Build(tables["BatchTrns"])); } return(null); }