Пример #1
0
        public decimal ExecuteScalarDecimal(IDbCommand command)
        {
            if (AutoOpenClose)
            {
                Open();
            }

            command.Connection     = SqlConnection;
            command.CommandTimeout = CommandTimeout;
            decimal result = DatabaseConverter.ToDecimal(command.ExecuteScalar());

            if (AutoOpenClose)
            {
                Close();
            }

            return(result);
        }
Пример #2
0
        public decimal ExecuteDataTableDecimal(IDbCommand command)
        {
            DataTable dataTable = ExecuteDataTable(command);

            return(!HasRows(dataTable) ? 0 : DatabaseConverter.ToDecimal(dataTable.Rows[0][0]));
        }