private void UpdatePaidUntilIfRental(AccountTransaction accountTransaction) { if (accountTransaction.AccountTransactionType == AccountTransactionType.Rental && accountTransaction.AccountTransactionInputType == AccountTransactionInputType.Payment) { var account = _customerAccountRepository.GetById(accountTransaction.CustomerAccountId) as RentalAccount; var unit = account.RentedUnits.Single(c => c.StockId == accountTransaction.GroupId && c.RemovalDate == null); unit.PaidUntil = (unit.PaidUntil == null ? unit.RentedDate : (DateTime)unit.PaidUntil).AddDays( (double)(-accountTransaction.Amount / unit.Amount) * ConstantValues.AvgDaysPerMonth); } }
//public Stock GetStock(int id) //{ // return _stockService.GetStock(id); //} //public IEnumerable<Stock> FindStock(Expression<Func<Stock, bool>> where) //{ // return _stockService.FindStock(where); //} public CustomerAccount GetCustomerAccount(int id) { return(_contractUnitRepsoitory.GetById(id)); }
public CustomerAccount GetAccount(int id) { return(_customerAccountRepository.GetById(id)); }