protected override void InitializationComplete() { // init _moneyTransferEventService = ServiceManager.ConfigureService <MoneyTransferEventService>(); _repayDebtEventService = ServiceManager.ConfigureService <RepayDebtEventService>(); _simpleEventService = ServiceManager.ConfigureService <SimpleEventService>(); _limitService = ServiceManager.ConfigureService <LimitService>(); _recordService = ServiceManager.ConfigureService <RecordService>(); _moneyTransferService = ServiceManager.ConfigureService <MoneyTransferService>(); InitializeViewModel(); _areLimitsLoaded = false; }
public RepayDebtEventDetailsView(IRepayDebtEventService service, RepayDebtEventViewModel entity, bool isNew) : base(service, entity, isNew) { InitializeComponent(); // init eventService = ServiceManager.ConfigureService <EventService>(); // load debts IDebtService debtService = ServiceManager.ConfigureService <DebtService>(); _debts = debtService.GetActive(GlobalVariables.UserId, entity.DebtId); comboDebts.ItemsSource = _debts; // load storages IStorageService storageService = ServiceManager.ConfigureService <StorageService>(); _storages = storageService.GetVisible(GlobalVariables.UserId, entity.StorageId); comboStorage.ItemsSource = _storages; // load currencies ICurrencyService currencyService = ServiceManager.ConfigureService <CurrencyService>(); _currencies = currencyService.GetActive(GlobalVariables.UserId, entity.Debt?.CurrencyId, entity.Storage?.CurrencyId); if (isNew) { comboCurrencies.ItemsSource = _currencies; } else { UpdateCurrenciesList(); } // set currencies list compCurrencyExchangeRate.CurrencyIds = _storages.Select(_ => _.CurrencyId) .Concat(_currencies.Select(c => c.Id)).Concat(_debts.Select(c => c.CurrencyId)).Distinct().ToList(); // set header and commands panel context LabelHeader.Content = ViewHeader; CommandsPanel.DataContext = Commands; }
public EventService(ApplicationDbContext context) : base(context) { _simpleEventService = new SimpleEventService(context); _repayDebtEventService = new RepayDebtEventService(context); _moneyTransferEventService = new MoneyTransferEventService(context); }