public static IEnumerable <AccountingTransactionTempDto> GetAllUnpostedVoucher() { try { var vouchers = AccountingDataProvider.GetAllUnpostedVoucher() as List <tAccountingTransactionTemp>; var voucherViewModel = new List <AccountingTransactionTempDto>(); AccountingTransactionTempDto model; if (vouchers != null) { vouchers.ForEach(delegate(tAccountingTransactionTemp table) { model = new AccountingTransactionTempDto { CompanyId = table.CompanyId, CreditAccount = table.CreditAccount, CreditAccountName = AccountingDataProvider.GetAccountByCode(table.CompanyId, table.CreditAccount).AccountName, DebitAccount = table.DebitAccount, DebitAccountName = AccountingDataProvider.GetAccountByCode(table.CompanyId, table.DebitAccount).AccountName, AccountingYearId = table.AccountingYearId, VoucherNo = table.VoucherNo, CurrencyCode = table.Currency, LineId = table.LineId, Total = table.Total, UserId = table.UserId, ValueTotal = table.ValueTotal, VoucherDate = table.VoucherDate }; voucherViewModel.Add(model); } ); return(voucherViewModel); } } catch (Exception exception) { throw new Exception(exception.Message); } return(null); }