public AccountingServices(string testDb) { //_user = new User(); _exchangeRateServices = new ExchangeRateServices(testDb); _movementSetManagement = new AccountingTransactionManager(testDb); ConnectionManager.GetInstance(testDb); }
private bool MaxAmountExceed() { OCurrency maxGuarantorAmount = ServicesProvider.GetInstance().GetGeneralSettings().MaxGuarantorAmount; OCurrency tempAmount; if (code.IsPivot) { tempAmount = _guarantor.Amount; } else { ExchangeRateServices rateServices = ServicesProvider.GetInstance().GetExchangeRateServices(); ExchangeRate currentRate = rateServices.SelectExchangeRate(TimeProvider.Now, code); if (currentRate == null) { ExchangeRateForm xrForm = new ExchangeRateForm(TimeProvider.Now.Date, code); xrForm.ShowDialog(); currentRate = xrForm.ExchangeRate; } tempAmount = _guarantor.Amount / currentRate.Rate; } if (tempAmount > maxGuarantorAmount) { return(true); } return(false); }
public AccountingServices(User pUser) { _user = pUser; _exchangeRateServices = new ExchangeRateServices(_user); _movementSetManagement = new AccountingTransactionManager(pUser); }