public static bool DeleteVoucherTemplate(VoucherTemplateDto voucherTemplate) { try { var entity = new tVoucherTemplate { CompanyId = voucherTemplate.CompanyId, CreditAccount = voucherTemplate.CreditAccountCode, DebitAccount = voucherTemplate.DebitAccountCode, Narration = voucherTemplate.Narration, ShortCode = voucherTemplate.ShortCode, }; var result = AccountingDataProvider.DeleteVoucherTemplate(entity); if (result == 1) { return(true); } return(false); } catch (Exception exception) { throw new Exception(exception.Message); } }
public static AccountingTransactionTempDto GetUnpostedVoucherByNo(int voucherNo) { try { var table = AccountingDataProvider.GetUnpostedVoucherByNo(voucherNo); var 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 }; return(model); } catch (Exception exception) { throw new Exception(exception.Message); } }
public static VoucherTemplateDto GetlVoucherTemplateByCode(string shortCode, int companyId) { try { var voucherTemplate = AccountingDataProvider.GetVoucherTemplateByCode(shortCode, companyId); var viewModel = new VoucherTemplateDto { CompanyId = voucherTemplate.CompanyId, CompanyName = "", CreditAccountCode = voucherTemplate.CreditAccount, CreditAccountName = AccountingDataProvider.GetAccountByCode(voucherTemplate.CompanyId, voucherTemplate.CreditAccount).AccountName, DebitAccountCode = voucherTemplate.DebitAccount, DebitAccountName = AccountingDataProvider.GetAccountByCode(voucherTemplate.CompanyId, voucherTemplate.DebitAccount).AccountName, Narration = voucherTemplate.Narration, ShortCode = voucherTemplate.ShortCode, }; return(viewModel); } catch (Exception exception) { throw new Exception(exception.Message); } }
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); } }
public static int DeleteAccountingYear(tAccountingYear tAccountingYear) { try { return(AccountingDataProvider.DeleteAccountingYear(tAccountingYear)); } catch (Exception exception) { throw new Exception(exception.Message); } }
public static tAccountingYear GetAccountingYearById(int companyId, int accountYearId) { try { return(AccountingDataProvider.GetAccountingYearById(companyId, accountYearId)); } catch (Exception exception) { throw new Exception(exception.Message); } }
public static int DeleteDebtorGroup(tDebtorGroup debtorGroup) { try { return(AccountingDataProvider.DeleteDebtorGroup(debtorGroup)); } catch (Exception exception) { throw new Exception(exception.Message); } }
public static tDebtorGroup GetDebtorGroupById(string debtorGroupId) { try { return(AccountingDataProvider.GetDebtorGroupById(debtorGroupId)); } catch (Exception exception) { throw new Exception(exception.Message); } }
public static int DeleteCurrencyRate(tCurrencyRate currencyRate) { try { return(AccountingDataProvider.DeleteCurrencyRate(currencyRate)); } catch (Exception exception) { throw new Exception(exception.Message); } }
public static tChartOfAccount GetAccountByCode(int companyId, int accountcode) { try { return(AccountingDataProvider.GetAccountByCode(companyId, accountcode)); } catch (Exception exception) { throw new Exception(exception.Message); } }
public static IEnumerable <tCurrencyRate> GetAllCurrencieRates() { try { return(AccountingDataProvider.GetAllCurrencieRates()); } catch (Exception exception) { throw new Exception(exception.Message); } }
public static int UpdateCurrency(tCurrency currency) { try { return(AccountingDataProvider.UpdateCurrency(currency)); } catch (Exception exception) { throw new Exception(exception.Message); } }
public static tCurrency GetCurrencyByCode(string currencyCode) { try { return(AccountingDataProvider.GetCurrencyByCode(currencyCode)); } catch (Exception exception) { throw new Exception(exception.Message); } }
public static int UpdateAccountingYear(tAccountingYear tAccountingYear) { try { return(AccountingDataProvider.UpdateAccountingYear(tAccountingYear)); } catch (SqlException ex) { throw new BusinessApplicationException("Error in busines logic of UpdateAccountingYear", ex); } }
public static tTaxSetup GetTaxesByCode(int companyId, string taxCode) { try { return(AccountingDataProvider.GetTaxesByCode(companyId, taxCode)); } catch (Exception exception) { throw new Exception(exception.Message); } }
public static IEnumerable <tChartOfAccount> GetAllChartOfAccount() { try { return(AccountingDataProvider.GetAllChartOfAccount()); } catch (Exception exception) { throw new Exception(exception.Message); } }
public static IEnumerable <AccountingTransactionPrePostingDto> GetPrePostingTransaction(int accountYearId, int companyId) { try { return(AccountingDataProvider.GetPrePostingTransaction(accountYearId, companyId)); } catch (Exception exception) { throw new Exception(exception.Message); } }
public static IEnumerable <tTaxSetup> GetAllTaxes() { try { return(AccountingDataProvider.GetAllTaxes()); } catch (Exception exception) { throw new Exception(exception.Message); } }
public static int DeleteAccount(tChartOfAccount account) { try { return(AccountingDataProvider.DeleteAccount(account)); } catch (Exception exception) { throw new Exception(exception.Message); } }
public static int AddAccountingYear(tAccountingYear tAccountingYear) { try { return(AccountingDataProvider.AddAccountingYear(tAccountingYear)); } catch (SqlException ex) { throw new BusinessApplicationException("Error in busines logic of AddAccountingYear", ex); } //catch (Exception exception) //{ // throw new Exception(exception.Message); //} }
public static bool DeleteTax(tTaxSetup taxSetup) { try { var result = AccountingDataProvider.DeleteTax(taxSetup); if (result == 1) { return(true); } return(false); } catch (Exception exception) { throw new Exception(exception.Message); } }
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); }
public static IEnumerable <VoucherTemplateDto> GetAllVoucherTemplates() { try { var vouchers = (List <tVoucherTemplate>)AccountingDataProvider.GetAllVoucherTemplates(); var voucherViewModel = new List <VoucherTemplateDto>(); VoucherTemplateDto model; if (vouchers != null) { vouchers.ForEach(delegate(tVoucherTemplate voucherTemplate) { model = new VoucherTemplateDto { CompanyId = voucherTemplate.CompanyId, CompanyName = "", CreditAccountCode = voucherTemplate.CreditAccount, CreditAccountName = AccountingDataProvider.GetAccountByCode(voucherTemplate.CompanyId, voucherTemplate.CreditAccount).AccountName, DebitAccountCode = voucherTemplate.DebitAccount, DebitAccountName = AccountingDataProvider.GetAccountByCode(voucherTemplate.CompanyId, voucherTemplate.DebitAccount).AccountName, Narration = voucherTemplate.Narration, ShortCode = voucherTemplate.ShortCode, }; voucherViewModel.Add(model); } ); return(voucherViewModel); } } catch (Exception exception) { throw new Exception(exception.Message); } return(null); }