public decimal GetTotalPaymentsByInvoiceId(int InvoiceID) { PaymentData data = new PaymentData(); decimal tot = 0; try { tot = data.GetTotalPaymentsByInvoice(InvoiceID); } catch (Exception ex) { log.Write(ex.Message, "GetTotalPaymentsByInvoiceId"); throw (ex); } finally { data = null; } return(tot); }