public SimpleEventDetailsView(ISimpleEventService service, SimpleEventViewModel entity, bool isNew)
            : base(service, entity, isNew)
        {
            InitializeComponent();

            // init
            eventService = ServiceManager.ConfigureService <EventService>();

            // load storages
            IStorageService storageService = ServiceManager.ConfigureService <StorageService>();

            _storages = storageService.GetVisible(GlobalVariables.UserId, entity.StorageId);
            comboStorage.ItemsSource = _storages;

            // load currencies
            ICurrencyService currencyService = ServiceManager.ConfigureService <CurrencyService>();
            var currencies = currencyService.GetActive(GlobalVariables.UserId, entity.CurrencyId, entity.Storage?.CurrencyId);

            // set currencies list
            compCurrencyExchangeRate.CurrencyIds =
                _storages.Select(_ => _.CurrencyId).Distinct().Concat(currencies.Select(c => c.Id)).Distinct().ToList();

            // set header and commands panel context
            LabelHeader.Content       = ViewHeader;
            CommandsPanel.DataContext = Commands;
        }
Esempio n. 2
0
        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;
        }
Esempio n. 3
0
 public EventService(ApplicationDbContext context) : base(context)
 {
     _simpleEventService        = new SimpleEventService(context);
     _repayDebtEventService     = new RepayDebtEventService(context);
     _moneyTransferEventService = new MoneyTransferEventService(context);
 }