예제 #1
0
 public AccountingServices(string testDb)
 {
     //_user = new User();
     _exchangeRateServices  = new ExchangeRateServices(testDb);
     _movementSetManagement = new AccountingTransactionManager(testDb);
     ConnectionManager.GetInstance(testDb);
 }
예제 #2
0
        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);
        }
예제 #3
0
 public AccountingServices(User pUser)
 {
     _user = pUser;
     _exchangeRateServices  = new ExchangeRateServices(_user);
     _movementSetManagement = new AccountingTransactionManager(pUser);
 }