public Int32 getPaymentCount(DailyTransactionRange range)
        {
            var result = _databaseConnection.Query <Int32>(@"SELECT count(*) FROM TRANSACTIONS T WHERE T.TYPE NOT IN ('S','C','D') and amount <> 0 and t.status <> 'D' and TRAN_NUM >= :startTran and TRAN_NUM <= :EndTran",
                                                           new { StartTran = range.FromTxn, EndTran = range.ToTxn });

            return(result.DefaultIfEmpty(0).FirstOrDefault <Int32>());
        }
        public List <Int32> getRefundTransactionIds(DailyTransactionRange range)
        {
            var result = _databaseConnection.Query <Int32>(@"
                    SELECT T.TRAN_NUM FROM TRANSACTIONS T WHERE T.TYPE = 'D' and T.adjustment_type is not null and T.impacts = 'C' and amount <> 0 and t.status <> 'D' and TRAN_NUM >= :startTran and TRAN_NUM <= :EndTran
            ", new { StartTran = range.FromTxn, EndTran = range.ToTxn });

            return(result.ToList <Int32>());
        }
        public List <Int32> getPaymentTransactionIds(DailyTransactionRange range)
        {
            var result = _databaseConnection.Query <Int32>(@"
                    SELECT T.TRAN_NUM FROM TRANSACTIONS T WHERE T.TYPE NOT IN ('S','C','D','F') and amount <> 0 and t.status <> 'D' and tran_num >= :StartTran and tran_num <= :EndTran
            ", new { StartTran = range.FromTxn, EndTran = range.ToTxn });

            return(result.ToList <Int32>());
        }