コード例 #1
0
        public static bool DeleteUnpostedVoucher(AccountingTransactionTempDto voucherEntryDto)
        {
            try
            {
                var entity = new tAccountingTransactionTemp
                {
                    CompanyId        = voucherEntryDto.CompanyId,
                    CreditAccount    = voucherEntryDto.CreditAccount,
                    DebitAccount     = voucherEntryDto.DebitAccount,
                    AccountingYearId = voucherEntryDto.AccountingYearId,
                    VoucherNo        = voucherEntryDto.VoucherNo,
                    Currency         = voucherEntryDto.CurrencyCode,
                    LineId           = voucherEntryDto.LineId,
                    Total            = voucherEntryDto.Total,
                    UserId           = voucherEntryDto.UserId,
                    ValueTotal       = voucherEntryDto.ValueTotal,
                    VoucherDate      = voucherEntryDto.VoucherDate,
                };

                var result = AccountingDataProvider.DeleteUnpostedVoucher(entity);

                if (result == 1)
                {
                    return(true);
                }
                return(false);
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
        }
コード例 #2
0
        public static int DeleteUnpostedVoucher(tAccountingTransactionTemp transaction)
        {
            int rowsAdded;

            using (IDbConnection connection = DbConnectionHelper.GetConnection())
            {
                var query = SqlQueryHelper.GetDeleteQuery <tAccountingTransactionTemp>();

                rowsAdded = connection.Execute(query, transaction);
            }

            return(rowsAdded);
        }