Пример #1
0
        public PaymentEditorViewModel(IApplicationState applicationState, ICacheService cacheService, IExpressionService expressionService,
            TicketTotalsViewModel paymentTotals, PaymentEditor paymentEditor, NumberPadViewModel numberPadViewModel,
            OrderSelectorViewModel orderSelectorViewModel, ITicketService ticketService,
            ForeignCurrencyButtonsViewModel foreignCurrencyButtonsViewModel, PaymentButtonsViewModel paymentButtonsViewModel,
            CommandButtonsViewModel commandButtonsViewModel, TenderedValueViewModel tenderedValueViewModel,
            ReturningAmountViewModel returningAmountViewModel, ChangeTemplatesViewModel changeTemplatesViewModel, AccountBalances accountBalances)
        {
            _applicationState = applicationState;
            _cacheService = cacheService;
            _expressionService = expressionService;
            _paymentTotals = paymentTotals;
            _paymentEditor = paymentEditor;
            _numberPadViewModel = numberPadViewModel;
            _orderSelectorViewModel = orderSelectorViewModel;
            _ticketService = ticketService;
            _foreignCurrencyButtonsViewModel = foreignCurrencyButtonsViewModel;
            _commandButtonsViewModel = commandButtonsViewModel;
            _tenderedValueViewModel = tenderedValueViewModel;
            _returningAmountViewModel = returningAmountViewModel;
            _changeTemplatesViewModel = changeTemplatesViewModel;
            _accountBalances = accountBalances;

            _makePaymentCommand = new CaptionCommand<PaymentType>("", OnMakePayment, CanMakePayment);
            _selectChangePaymentTypeCommand = new CaptionCommand<PaymentData>("", OnSelectChangePaymentType);

            ClosePaymentScreenCommand = new CaptionCommand<string>(Resources.Close, OnClosePaymentScreen, CanClosePaymentScreen);
            paymentButtonsViewModel.SetButtonCommands(_makePaymentCommand, null, ClosePaymentScreenCommand);
        }
Пример #2
0
 public TicketTotalsViewModel(ICacheService cacheService, AccountBalances accountBalances)
 {
     _cacheService = cacheService;
     _accountBalances = accountBalances;
     ResetCache();
     _model = Ticket.Empty;
 }
Пример #3
0
 public TicketTotalsViewModel(ICacheService cacheService, AccountBalances accountBalances)
 {
     _cacheService    = cacheService;
     _accountBalances = accountBalances;
     ResetCache();
     _model = Ticket.Empty;
 }
 public TicketTotalsViewModel(ICacheService cacheService, AccountBalances accountBalances,
                              IApplicationState applicationState)
 {
     _cacheService     = cacheService;
     _accountBalances  = accountBalances;
     _applicationState = applicationState;
     ResetCache();
     _model = Ticket.Empty;
 }
Пример #5
0
 public TicketTotalsViewModel(ICacheService cacheService, AccountBalances accountBalances,
     IApplicationState applicationState)
 {
     _cacheService = cacheService;
     _accountBalances = accountBalances;
     _applicationState = applicationState;
     ResetCache();
     _model = Ticket.Empty;
 }
Пример #6
0
        public PaymentEditor(IApplicationState applicationState, ITicketService ticketService, AccountBalances accountBalances)
        {
            _applicationState = applicationState;
            _ticketService = ticketService;
            _accountBalances = accountBalances;
            _selectedTicket = Ticket.Empty;

            EventServiceFactory.EventService.GetEvent<GenericEvent<EventAggregator>>().Subscribe(x =>
            {
                if (SelectedTicket != Ticket.Empty && x.Topic == EventTopicNames.CloseTicketRequested)
                {
                    SelectedTicket = Ticket.Empty;
                }
            });
        }
Пример #7
0
        public NumberPadViewModel(ISettingService settingService, PaymentEditor paymentEditor, TenderedValueViewModel tenderedValueViewModel,
            OrderSelectorViewModel orderSelectorViewModel, AccountBalances accountBalances,
            ForeignCurrencyButtonsViewModel foreignCurrencyButtonsViewModel, TicketTotalsViewModel paymentTotals)
        {
            _settingService = settingService;
            _paymentEditor = paymentEditor;
            _tenderedValueViewModel = tenderedValueViewModel;
            _orderSelectorViewModel = orderSelectorViewModel;
            _accountBalances = accountBalances;
            _foreignCurrencyButtonsViewModel = foreignCurrencyButtonsViewModel;
            _paymentTotals = paymentTotals;

            TenderAllCommand = new CaptionCommand<string>(Resources.All, OnTenderAllCommand);
            ChangeBalanceModeCommand = new DelegateCommand<string>(OnChangeBalanceMode);
            TypeValueCommand = new DelegateCommand<string>(OnTypeValueExecuted);
            SetValueCommand = new DelegateCommand<string>(OnSetValue);
            DivideValueCommand = new DelegateCommand<string>(OnDivideValue);
        }
Пример #8
0
        public PosViewModel(IRegionManager regionManager, IApplicationState applicationState, IApplicationStateSetter applicationStateSetter,
            ITicketService ticketService, ITicketServiceBase ticketServiceBase, IUserService userService, ICacheService cacheService, IMessagingService messagingService,
            TicketListViewModel ticketListViewModel, TicketTagListViewModel ticketTagListViewModel, MenuItemSelectorViewModel menuItemSelectorViewModel,
            MenuItemSelectorView menuItemSelectorView, TicketViewModel ticketViewModel, TicketOrdersViewModel ticketOrdersViewModel,
            TicketEntityListViewModel ticketEntityListViewModel, TicketTypeListViewModel ticketTypeListViewModel, AccountBalances accountBalances)
        {
            _ticketService = ticketService;
            _ticketServiceBase = ticketServiceBase;
            _userService = userService;
            _cacheService = cacheService;
            _messagingService = messagingService;
            _applicationState = applicationState;
            _applicationStateSetter = applicationStateSetter;
            _regionManager = regionManager;
            _menuItemSelectorView = menuItemSelectorView;
            _ticketViewModel = ticketViewModel;
            _ticketOrdersViewModel = ticketOrdersViewModel;
            _menuItemSelectorViewModel = menuItemSelectorViewModel;
            _ticketListViewModel = ticketListViewModel;
            _ticketTagListViewModel = ticketTagListViewModel;
            _ticketEntityListViewModel = ticketEntityListViewModel;
            _ticketTypeListViewModel = ticketTypeListViewModel;
            _accountBalances = accountBalances;

            EventServiceFactory.EventService.GetEvent<GenericEvent<Order>>().Subscribe(OnOrderEventReceived);
            EventServiceFactory.EventService.GetEvent<GenericEvent<Ticket>>().Subscribe(OnTicketEventReceived);
            EventServiceFactory.EventService.GetEvent<GenericEvent<EventAggregator>>().Subscribe(OnTicketEvent);
            EventServiceFactory.EventService.GetEvent<GenericEvent<ScreenMenuItemData>>().Subscribe(OnMenuItemSelected);
            EventServiceFactory.EventService.GetEvent<GenericIdEvent>().Subscribe(OnTicketIdPublished);
            EventServiceFactory.EventService.GetEvent<GenericEvent<OperationRequest<Entity>>>().Subscribe(OnEntitySelectedForTicket);
            EventServiceFactory.EventService.GetEvent<GenericEvent<TicketTagGroup>>().Subscribe(OnTicketTagSelected);
            EventServiceFactory.EventService.GetEvent<GenericEvent<TicketStateData>>().Subscribe(OnTicketStateSelected);
            EventServiceFactory.EventService.GetEvent<GenericEvent<TicketType>>().Subscribe(OnTicketTypeChanged);

            EventServiceFactory.EventService.GetEvent<GenericEvent<EventAggregator>>().Subscribe(
            x =>
            {
                if (x.Topic == EventTopicNames.ResetCache && _applicationState.CurrentTicketType != null)
                {
                    _menuItemSelectorViewModel.Reset();
                    _menuItemSelectorViewModel.UpdateCurrentScreenMenu(_applicationState.CurrentTicketType.GetScreenMenuId(_applicationState.CurrentTerminal));
                }
            });
        }