public OrderSelectorViewModel(TenderedValueViewModel tenderedValueViewModel)
 {
     _tenderedValueViewModel = tenderedValueViewModel;
     Model     = new OrderSelector();
     Selectors = new ObservableCollection <SelectorViewModel>();
     SelectMergedItemCommand = new DelegateCommand <SelectorViewModel>(OnMergedItemSelected);
 }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
 public OrderSelectorViewModel(TenderedValueViewModel tenderedValueViewModel)
 {
     _tenderedValueViewModel = tenderedValueViewModel;
     Model = new OrderSelector();
     Selectors = new ObservableCollection<SelectorViewModel>();
     SelectMergedItemCommand = new DelegateCommand<SelectorViewModel>(OnMergedItemSelected);
 }
        public PaymentEditorViewModel(IApplicationState applicationState,
                                      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;
            _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);
        }
 public ForeignCurrencyButtonsViewModel(PaymentEditor paymentEditor, OrderSelectorViewModel orderSelectorViewModel,
     ICacheService cacheService, PaymentButtonsViewModel paymentButtonsViewModel, ISettingService settingService, TenderedValueViewModel tenderedValueViewModel)
 {
     _paymentEditor = paymentEditor;
     _orderSelectorViewModel = orderSelectorViewModel;
     _cacheService = cacheService;
     _paymentButtonsViewModel = paymentButtonsViewModel;
     _settingService = settingService;
     _tenderedValueViewModel = tenderedValueViewModel;
     _tenderedValueViewModel.PaymentDueChanged += TenderedValueViewModelPaymentDueChanged;
     _foreignCurrencySelectedCommand = new CaptionCommand<ForeignCurrency>("", OnForeignCurrencySelected);
     ForeignCurrencyButtons = new ObservableCollection<CommandButtonViewModel<ForeignCurrency>>(_cacheService.GetForeignCurrencies().Select(x => new CommandButtonViewModel<ForeignCurrency> { Caption = x.CurrencySymbol, Command = _foreignCurrencySelectedCommand, Parameter = x }));
 }
 public ForeignCurrencyButtonsViewModel(PaymentEditor paymentEditor, OrderSelectorViewModel orderSelectorViewModel,
                                        ICacheService cacheService, PaymentButtonsViewModel paymentButtonsViewModel, ISettingService settingService, TenderedValueViewModel tenderedValueViewModel)
 {
     _paymentEditor           = paymentEditor;
     _orderSelectorViewModel  = orderSelectorViewModel;
     _cacheService            = cacheService;
     _paymentButtonsViewModel = paymentButtonsViewModel;
     _settingService          = settingService;
     _tenderedValueViewModel  = tenderedValueViewModel;
     _tenderedValueViewModel.PaymentDueChanged += TenderedValueViewModelPaymentDueChanged;
     _foreignCurrencySelectedCommand            = new CaptionCommand <ForeignCurrency>("", OnForeignCurrencySelected);
     ForeignCurrencyButtons = new ObservableCollection <CommandButtonViewModel <ForeignCurrency> >();
 }
Ejemplo n.º 7
0
        public CommandButtonsViewModel(PaymentEditor paymentEditor, IApplicationState applicationState,
                                       TenderedValueViewModel tenderedValueViewModel, OrderSelectorViewModel orderSelectorViewModel, NumberPadViewModel numberPadViewModel,
                                       IExpressionService expressionService)
        {
            _paymentEditor          = paymentEditor;
            _applicationState       = applicationState;
            _tenderedValueViewModel = tenderedValueViewModel;

            _orderSelectorViewModel = orderSelectorViewModel;
            _numberPadViewModel     = numberPadViewModel;
            _expressionService      = expressionService;

            _executeAutomationCommand = new CaptionCommand <AutomationCommandData>("", OnExecuteAutomationCommand, CanExecuteAutomationCommand);
            _serviceSelectedCommand   = new CaptionCommand <CalculationSelector>("", OnSelectCalculationSelector, CanSelectCalculationSelector);
        }
Ejemplo n.º 8
0
        public CommandButtonsViewModel(PaymentEditor paymentEditor, IApplicationState applicationState, 
            TenderedValueViewModel tenderedValueViewModel, OrderSelectorViewModel orderSelectorViewModel, NumberPadViewModel numberPadViewModel,
            IExpressionService expressionService)
        {
            _paymentEditor = paymentEditor;
            _applicationState = applicationState;
            _tenderedValueViewModel = tenderedValueViewModel;

            _orderSelectorViewModel = orderSelectorViewModel;
            _numberPadViewModel = numberPadViewModel;
            _expressionService = expressionService;

            _executeAutomationCommand = new CaptionCommand<AutomationCommandData>("", OnExecuteAutomationCommand, CanExecuteAutomationCommand);
            _serviceSelectedCommand = new CaptionCommand<CalculationSelector>("", OnSelectCalculationSelector, CanSelectCalculationSelector);
        }
Ejemplo n.º 9
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);
        }
Ejemplo n.º 10
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);
        }
Ejemplo n.º 11
0
 public TenderedValueView(TenderedValueViewModel viewModel)
 {
     DataContext = viewModel;
     InitializeComponent();
 }
 public TenderedValueView(TenderedValueViewModel viewModel)
 {
     DataContext = viewModel;
     InitializeComponent();
 }