public PaymentButtonGroupViewModel(ICaptionCommand makePaymentCommand, ICaptionCommand settleCommand, ICaptionCommand closeCommand)
 {
     _makePaymentCommand = makePaymentCommand;
     _settleCommand = settleCommand;
     _closeCommand = closeCommand;
     _paymentButtons = new ObservableCollection<CommandButtonViewModel<PaymentTemplate>>();
 }
Example #2
0
 public PaymentButtonGroupViewModel(ICaptionCommand makePaymentCommand, ICaptionCommand settleCommand, ICaptionCommand closeCommand)
 {
     _makePaymentCommand = makePaymentCommand;
     _settleCommand      = settleCommand;
     _closeCommand       = closeCommand;
     _paymentButtons     = new ObservableCollection <CommandButtonViewModel <PaymentType> >();
 }
Example #3
0
        public ModifierModule(IRegionManager regionManager, IUserService userService,
            ExtraModifierEditorView extraModifierEditorView, ExtraModifierEditorViewModel extraModifierEditorViewModel,
            TicketNoteEditorView ticketNoteEditorView, TicketNoteEditorViewModel ticketNoteEditorViewModel,
            TicketTagEditorView ticketTagEditorView, TicketTagEditorViewModel ticketTagEditorViewModel,
            OrderTagEditorView selectedOrdersView, OrderTagEditorViewModel selectedOrdersViewModel)
        {
            _selectedOrdersView = selectedOrdersView;
            _selectedOrdersViewModel = selectedOrdersViewModel;
            _ticketNoteEditorView = ticketNoteEditorView;
            _ticketNoteEditorViewModel = ticketNoteEditorViewModel;
            _ticketTagEditorView = ticketTagEditorView;
            _ticketTagEditorViewModel = ticketTagEditorViewModel;
            _extraModifierEditorViewModel = extraModifierEditorViewModel;
            _extraModifierEditorView = extraModifierEditorView;

            _regionManager = regionManager;
            _userService = userService;

            EventServiceFactory.EventService.GetEvent<GenericEvent<SelectedOrdersData>>().Subscribe(OnSelectedOrdersDataEvent);
            EventServiceFactory.EventService.GetEvent<GenericEvent<EventAggregator>>().Subscribe(OnDisplayTicketDetailsScreen);
            EventServiceFactory.EventService.GetEvent<GenericEvent<TicketTagData>>().Subscribe(OnTicketTagDataSelected);
            EventServiceFactory.EventService.GetEvent<GenericEvent<Ticket>>().Subscribe(OnTicketEvent);

            _showExtraModifierCommand = new CaptionCommand<Ticket>(Resources.ExtraModifier, OnExtraModifiersSelected, CanSelectExtraModifier);
            _showExtraModifierCommand.PublishEvent(EventTopicNames.AddCustomOrderCommand);
        }
Example #4
0
        public AccountSelectorViewModel(IAccountService accountService, ICacheService cacheService, IApplicationState applicationState, IEntityService entityService,
                                        IReportServiceClient reportServiceClient)
        {
            _accounts                        = new ObservableCollection <AccountScreenRow>();
            _accountService                  = accountService;
            _cacheService                    = cacheService;
            _applicationState                = applicationState;
            _entityService                   = entityService;
            _reportServiceClient             = reportServiceClient;
            ShowAccountDetailsCommand        = new CaptionCommand <string>(Resources.AccountDetails.Replace(' ', '\r'), OnShowAccountDetails, CanShowAccountDetails);
            PrintCommand                     = new CaptionCommand <string>(Resources.Print, OnPrint);
            AccountButtonSelectedCommand     = new CaptionCommand <AccountScreen>("", OnAccountScreenSelected);
            AutomationCommandSelectedCommand = new CaptionCommand <AccountScreenAutmationCommandMap>("", OnAutomationCommandSelected);

            EventServiceFactory.EventService.GetEvent <GenericEvent <EventAggregator> >().Subscribe(
                x =>
            {
                if (x.Topic == EventTopicNames.ResetCache)
                {
                    _accountButtons        = null;
                    _batchDocumentButtons  = null;
                    _selectedAccountScreen = null;
                }
            });
        }
        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);
        }
Example #6
0
        public PaymentEditorViewModel()
        {
            _manualPrintCommand            = new CaptionCommand <PrintJob>(Resources.Print, OnManualPrint, CanManualPrint);
            SubmitCashPaymentCommand       = new CaptionCommand <string>(Resources.Cash, OnSubmitCashPayment, CanSubmitCashPayment);
            SubmitCreditCardPaymentCommand = new CaptionCommand <string>(Resources.CreditCard_r, OnSubmitCreditCardPayment,
                                                                         CanSubmitCashPayment);
            SubmitTicketPaymentCommand  = new CaptionCommand <string>(Resources.Voucher_r, OnSubmitTicketPayment, CanSubmitCashPayment);
            SubmitAccountPaymentCommand = new CaptionCommand <string>(Resources.AccountBalance_r, OnSubmitAccountPayment, CanSubmitAccountPayment);
            ClosePaymentScreenCommand   = new CaptionCommand <string>(Resources.Close, OnClosePaymentScreen, CanClosePaymentScreen);
            TenderAllCommand            = new CaptionCommand <string>(Resources.All, OnTenderAllCommand);
            TypeValueCommand            = new DelegateCommand <string>(OnTypeValueExecuted);
            SetValueCommand             = new DelegateCommand <string>(OnSetValue);
            DivideValueCommand          = new DelegateCommand <string>(OnDivideValue);
            SelectMergedItemCommand     = new DelegateCommand <MergedItem>(OnMergedItemSelected);

            SetDiscountAmountCommand     = new CaptionCommand <string>(Resources.Round, OnSetDiscountAmountCommand, CanSetDiscount);
            AutoSetDiscountAmountCommand = new CaptionCommand <string>(Resources.Flat, OnAutoSetDiscount, CanAutoSetDiscount);
            SetDiscountRateCommand       = new CaptionCommand <string>(Resources.DiscountPercentSign, OnSetDiscountRateCommand, CanSetDiscountRate);

            MergedItems = new ObservableCollection <MergedItem>();
            ReturningAmountVisibility = Visibility.Collapsed;

            LastTenderedAmount = "1";
            EventServiceFactory.EventService.GetEvent <GenericEvent <CreditCardProcessingResult> >().Subscribe(OnProcessCreditCard);
        }
Example #7
0
 public AutomationCommandSelectorViewModel(IApplicationState applicationState, IExpressionService expressionService)
 {
     _applicationState       = applicationState;
     _expressionService      = expressionService;
     SelectAutomationCommand = new DelegateCommand <AutomationCommandData>(OnSelectAutomationCommand, CanSelectAutomationCommand);
     CloseCommand            = new CaptionCommand <string>(Resources.Close, OnCloseCommandExecuted);
 }
        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 PaymentEditorViewModel(IApplicationState applicationState, ITicketService ticketService,
            IPrinterService printerService, IUserService userService, IAutomationService automationService, TicketTotalsViewModel totals)
        {
            _applicationState = applicationState;
            _ticketService = ticketService;
            _printerService = printerService;
            _userService = userService;
            _automationService = automationService;

            _manualPrintCommand = new CaptionCommand<PrintJob>(Resources.Print, OnManualPrint, CanManualPrint);
            _makePaymentCommand = new CaptionCommand<PaymentTemplate>("", OnMakePayment, CanMakePayment);
            _serviceSelectedCommand = new CaptionCommand<CalculationTemplate>("", OnSelectCalculationTemplate);

            SubmitAccountPaymentCommand = new CaptionCommand<string>(Resources.AccountBalance_r, OnSubmitAccountPayment, CanSubmitAccountPayment);
            ClosePaymentScreenCommand = new CaptionCommand<string>(Resources.Close, OnClosePaymentScreen, CanClosePaymentScreen);
            TenderAllCommand = new CaptionCommand<string>(Resources.All, OnTenderAllCommand);
            TypeValueCommand = new DelegateCommand<string>(OnTypeValueExecuted);
            SetValueCommand = new DelegateCommand<string>(OnSetValue);
            DivideValueCommand = new DelegateCommand<string>(OnDivideValue);
            SelectMergedItemCommand = new DelegateCommand<MergedItem>(OnMergedItemSelected);

            SetDiscountAmountCommand = new CaptionCommand<string>(Resources.Round, OnSetDiscountAmountCommand, CanSetDiscount);
            AutoSetDiscountAmountCommand = new CaptionCommand<string>(Resources.Flat, OnAutoSetDiscount, CanAutoSetDiscount);
            SetDiscountRateCommand = new CaptionCommand<string>(Resources.DiscountPercentSign, OnSetDiscountRateCommand, CanSetDiscountRate);

            MergedItems = new ObservableCollection<MergedItem>();
            ReturningAmountVisibility = Visibility.Collapsed;

            Totals = totals;

            PaymentButtonGroup = new PaymentButtonGroupViewModel(_makePaymentCommand, null, ClosePaymentScreenCommand);

            LastTenderedAmount = "1";
        }
 public WarehouseInventoryViewModel(IInventoryService inventoryService, ICacheService cacheService, IApplicationState applicationState)
 {
     _inventoryService = inventoryService;
     _cacheService = cacheService;
     _applicationState = applicationState;
     WarehouseButtonSelectedCommand = new CaptionCommand<Warehouse>("", OnWarehouseSelected);
 }
        public PaymentEditorViewModel()
        {
            _manualPrintCommand = new CaptionCommand<PrintJob>(Resources.Print, OnManualPrint, CanManualPrint);
            SubmitCashPaymentCommand = new CaptionCommand<string>(Resources.Cash, OnSubmitCashPayment, CanSubmitCashPayment);
            SubmitCreditCardPaymentCommand = new CaptionCommand<string>(Resources.CreditCard_r, OnSubmitCreditCardPayment,
                                                                        CanSubmitCashPayment);
            SubmitTicketPaymentCommand = new CaptionCommand<string>(Resources.Voucher_r, OnSubmitTicketPayment, CanSubmitCashPayment);
            SubmitAccountPaymentCommand = new CaptionCommand<string>(Resources.AccountBalance_r, OnSubmitAccountPayment, CanSubmitAccountPayment);
            ClosePaymentScreenCommand = new CaptionCommand<string>(Resources.Close, OnClosePaymentScreen, CanClosePaymentScreen);
            TenderAllCommand = new CaptionCommand<string>(Resources.All, OnTenderAllCommand);
            TypeValueCommand = new DelegateCommand<string>(OnTypeValueExecuted);
            SetValueCommand = new DelegateCommand<string>(OnSetValue);
            DivideValueCommand = new DelegateCommand<string>(OnDivideValue);
            SelectMergedItemCommand = new DelegateCommand<MergedItem>(OnMergedItemSelected);

            SetDiscountAmountCommand = new CaptionCommand<string>(Resources.Round, OnSetDiscountAmountCommand, CanSetDiscount);
            AutoSetDiscountAmountCommand = new CaptionCommand<string>(Resources.Flat, OnAutoSetDiscount, CanAutoSetDiscount);
            SetDiscountRateCommand = new CaptionCommand<string>(Resources.DiscountPercentSign, OnSetDiscountRateCommand, CanSetDiscountRate);

            MergedItems = new ObservableCollection<MergedItem>();
            ReturningAmountVisibility = Visibility.Collapsed;

            LastTenderedAmount = "1";
            EventServiceFactory.EventService.GetEvent<GenericEvent<CreditCardProcessingResult>>().Subscribe(OnProcessCreditCard);
        }
 public AutomationCommandSelectorViewModel(IApplicationState applicationState, IExpressionService expressionService)
 {
     _applicationState = applicationState;
     _expressionService = expressionService;
     SelectAutomationCommand = new DelegateCommand<AutomationCommandData>(OnSelectAutomationCommand, CanSelectAutomationCommand);
     CloseCommand = new CaptionCommand<string>(Resources.Close, OnCloseCommandExecuted);
 }
 public RuleConstraintValueViewModel(RuleConstraintValue ruleConstraintValue, IEnumerable<RuleConstraintName> ruleConstraintNames, ICaptionCommand removeConstraintCommand)
 {
     _model = ruleConstraintValue;
     _ruleConstraintNames = ruleConstraintNames;
     _removeConstraintCommand = removeConstraintCommand;
     Values = ParameterSources.GetParameterSource(Left);
 }
Example #14
0
 public WarehouseInventoryViewModel(IInventoryService inventoryService, ICacheService cacheService, IApplicationState applicationState)
 {
     _inventoryService = inventoryService;
     _cacheService     = cacheService;
     _applicationState = applicationState;
     WarehouseButtonSelectedCommand = new CaptionCommand <Warehouse>("", OnWarehouseSelected);
 }
Example #15
0
 public RuleConstraintValueViewModel(RuleConstraintValue ruleConstraintValue, IEnumerable <RuleConstraintName> ruleConstraintNames, ICaptionCommand removeConstraintCommand)
 {
     _model = ruleConstraintValue;
     _ruleConstraintNames     = ruleConstraintNames;
     _removeConstraintCommand = removeConstraintCommand;
     Values = ParameterSources.GetParameterSource(Left);
 }
        public AccountSelectorViewModel(IAccountService accountService, ICacheService cacheService, IApplicationState applicationState, IEntityService entityService,
            IReportServiceClient reportServiceClient)
        {
            _accounts = new ObservableCollection<AccountScreenRow>();
            _accountService = accountService;
            _cacheService = cacheService;
            _applicationState = applicationState;
            _entityService = entityService;
            _reportServiceClient = reportServiceClient;
            ShowAccountDetailsCommand = new CaptionCommand<string>(Resources.AccountDetails.Replace(' ', '\r'), OnShowAccountDetails, CanShowAccountDetails);
            PrintCommand = new CaptionCommand<string>(Resources.Print, OnPrint);
            AccountButtonSelectedCommand = new CaptionCommand<AccountScreen>("", OnAccountScreenSelected);
            AutomationCommandSelectedCommand = new CaptionCommand<AccountScreenAutmationCommandMap>("", OnAutomationCommandSelected);

            EventServiceFactory.EventService.GetEvent<GenericEvent<EventAggregator>>().Subscribe(
            x =>
            {
                if (x.Topic == EventTopicNames.ResetCache)
                {
                    _accountButtons = null;
                    _batchDocumentButtons = null;
                    _selectedAccountScreen = null;
                }
            });
        }
 public void InsertCommand(ICaptionCommand command, int index = -1)
 {
     if (index > -1)
     {
         AllCommands.Insert(index, command);
     }
     else AllCommands.Add(command);
 }
 public void RemoveCommand(ICaptionCommand command)
 {
     if (AllCommands.Contains(command))
     {
         AllCommands.Remove(command);
         RaisePropertyChanged(nameof(AllCommands));
     }
 }
Example #19
0
 public DepartmentViewModel(Department model)
     : base(model)
 {
     AddTicketTagGroupCommand        = new CaptionCommand <string>(string.Format(Resources.Add_f, Resources.TagGroup), OnAddTicketTagGroup);
     DeleteTicketTagGroupCommand     = new CaptionCommand <string>(string.Format(Resources.Delete_f, Resources.TagGroup), OnDeleteTicketTagGroup, CanDeleteTicketTagGroup);
     AddTaxServiceTemplateCommand    = new CaptionCommand <string>(string.Format(Resources.Add_f, Resources.TaxServiceTemplate), OnAddTaxServiceTemplate);
     DeleteTaxServiceTemplateCommand = new CaptionCommand <string>(string.Format(Resources.Delete_f, Resources.TaxServiceTemplate), OnDeleteTaxServiceTempalte, CanDeleteTaxServiceTemplate);
 }
 public void RemoveCommand(ICaptionCommand command)
 {
     if (AllCommands.Contains(command))
     {
         AllCommands.Remove(command);
         RaisePropertyChanged(() => AllCommands);
     }
 }
Example #21
0
 public RecipeListViewModel(IInventoryService inventoryService)
 {
     _inventoryService     = inventoryService;
     TestRecipesCommand    = new CaptionCommand <string>(string.Format(Resources.Find_f, Resources.RequiredRecipes), OnTestRequiredRecipes);
     TestAllRecipesCommand = new CaptionCommand <string>(string.Format(Resources.Find_f, Resources.MissingRecipes), OnTestMissingRecipes);
     CustomCommands.Add(TestRecipesCommand);
     CustomCommands.Add(TestAllRecipesCommand);
 }
 public PeriodicConsumptionViewModel(IApplicationState applicationState,
                                     IInventoryService inventoryService, ICacheService cacheService)
 {
     _applicationState        = applicationState;
     _inventoryService        = inventoryService;
     _cacheService            = cacheService;
     UpdateCalculationCommand = new CaptionCommand <string>(Resources.CalculateCost, OnUpdateCalculation);
     AddUnmappedItemsCommand  = new CaptionCommand <string>(Resources.AppendUnmappedItems, OnAddUnmappedItems, CanSave);
 }
Example #23
0
 public RuleViewModel(IAutomationService automationService, IAutomationDao automationDao)
 {
     _automationService      = automationService;
     _automationDao          = automationDao;
     SelectActionsCommand    = new CaptionCommand <string>(Resources.SelectActions, OnSelectActions);
     AddConstraintCommand    = new CaptionCommand <string>(string.Format(Resources.Add_f, Resources.CustomConstraint), OnAddConstraint, CanAddConstraint);
     RemoveConstraintCommand = new CaptionCommand <RuleConstraintValueViewModel>(Resources.Remove, OnRemoveConstraint);
     Constraints             = new ObservableCollection <RuleConstraint>();
 }
 public ProgramSettingsViewModel(ISettingService settingService)
 {
     _settingService             = settingService;
     SaveCommand                 = new CaptionCommand <string>(Resources.Save, OnSave);
     WeightBarcodePrefix         = _settingService.ProgramSettings.WeightBarcodePrefix;
     WeightBarcodeItemLength     = _settingService.ProgramSettings.WeightBarcodeItemLength;
     WeightBarcodeItemFormat     = _settingService.ProgramSettings.WeightBarcodeItemFormat;
     WeightBarcodeQuantityLength = _settingService.ProgramSettings.WeightBarcodeQuantityLength;
     AutoRoundDiscount           = _settingService.ProgramSettings.AutoRoundDiscount;
 }
Example #25
0
 public ProgramSettingsViewModel()
 {
     SaveCommand                 = new CaptionCommand <string>(Resources.Save, OnSave);
     WeightBarcodePrefix         = AppServices.SettingService.WeightBarcodePrefix;
     WeightBarcodeItemLength     = AppServices.SettingService.WeightBarcodeItemLength;
     WeightBarcodeItemFormat     = AppServices.SettingService.WeightBarcodeItemFormat;
     WeightBarcodeQuantityLength = AppServices.SettingService.WeightBarcodeQuantityLength;
     PhoneNumberInputMask        = AppServices.SettingService.PhoneNumberInputMask;
     AutoRoundDiscount           = AppServices.SettingService.AutoRoundDiscount;
 }
 public ProgramSettingsViewModel()
 {
     SaveCommand = new CaptionCommand<string>(Resources.Save, OnSave);
     WeightBarcodePrefix = AppServices.SettingService.WeightBarcodePrefix;
     WeightBarcodeItemLength = AppServices.SettingService.WeightBarcodeItemLength;
     WeightBarcodeItemFormat = AppServices.SettingService.WeightBarcodeItemFormat;
     WeightBarcodeQuantityLength = AppServices.SettingService.WeightBarcodeQuantityLength;
     PhoneNumberInputMask = AppServices.SettingService.PhoneNumberInputMask;
     AutoRoundDiscount = AppServices.SettingService.AutoRoundDiscount;
 }
 public void InsertCommand(ICaptionCommand command, int index = -1)
 {
     if (index > -1)
     {
         AllCommands.Insert(index, command);
     }
     else
     {
         AllCommands.Add(command);
     }
 }
Example #28
0
 public ResourceEditorViewModel(ICacheService cacheService, IAccountService accountService, IUserService userService, ITicketService ticketService)
 {
     _cacheService         = cacheService;
     _accountService       = accountService;
     _userService          = userService;
     _ticketService        = ticketService;
     SaveResourceCommand   = new CaptionCommand <string>(Resources.Save, OnSaveResource, CanSelectResource);
     SelectResourceCommand = new CaptionCommand <string>(string.Format(Resources.Select_f, Resources.Resource).Replace(" ", "\r"), OnSelectResource, CanSelectResource);
     CreateAccountCommand  = new CaptionCommand <string>(string.Format(Resources.Create_f, Resources.Account).Replace(" ", "\r"), OnCreateAccount, CanCreateAccount);
     EventServiceFactory.EventService.GetEvent <GenericEvent <EntityOperationRequest <Resource> > >().Subscribe(OnEditResource);
 }
Example #29
0
 public TicketListViewModel(ITicketService ticketService, ITicketServiceBase ticketServiceBase, IApplicationState applicationState)
 {
     _ticketService = ticketService;
     _ticketServiceBase = ticketServiceBase;
     _applicationState = applicationState;
     _tickets = new List<TicketButtonViewModel>();
     AddTicketCommand = new CaptionCommand<string>(string.Format(Resources.Add_f, Resources.Ticket).Replace(" ", "\r"), OnAddTicket, CanAddTicket);
     MergeTicketsCommand = new CaptionCommand<string>(Resources.MergeTickets.Replace(" ", "\r"), OnMergeTickets, CanMergeTickets);
     CloseCommand = new CaptionCommand<string>(Resources.Close.Replace(" ", "\r"), OnCloseCommand);
     _executeAutomationCommand = new CaptionCommand<AutomationCommandData>("", OnExecuteAutomationCommand, CanExecuteAutomationCommand);
 }
Example #30
0
 public TicketListViewModel(ITicketService ticketService, ITicketServiceBase ticketServiceBase, IApplicationState applicationState)
 {
     _ticketService            = ticketService;
     _ticketServiceBase        = ticketServiceBase;
     _applicationState         = applicationState;
     _tickets                  = new List <TicketButtonViewModel>();
     AddTicketCommand          = new CaptionCommand <string>(string.Format(Resources.Add_f, Resources.Ticket).Replace(" ", "\r"), OnAddTicket, CanAddTicket);
     MergeTicketsCommand       = new CaptionCommand <string>(Resources.MergeTickets.Replace(" ", "\r"), OnMergeTickets, CanMergeTickets);
     CloseCommand              = new CaptionCommand <string>(Resources.Close.Replace(" ", "\r"), OnCloseCommand);
     _executeAutomationCommand = new CaptionCommand <AutomationCommandData>("", OnExecuteAutomationCommand, CanExecuteAutomationCommand);
 }
 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> >();
 }
Example #33
0
 public ProgramSettingsViewModel(ISettingService settingService)
 {
     _settingService             = settingService;
     SaveCommand                 = new CaptionCommand <string>(Resources.Save, OnSave);
     UserInfo                    = _settingService.ProgramSettings.UserInfo;
     QuantitySeparators          = _settingService.ProgramSettings.QuantitySeparators;
     WeightBarcodePrefix         = _settingService.ProgramSettings.WeightBarcodePrefix;
     WeightBarcodeItemLength     = _settingService.ProgramSettings.WeightBarcodeItemLength;
     WeightBarcodeItemFormat     = _settingService.ProgramSettings.WeightBarcodeItemFormat;
     WeightBarcodeQuantityLength = _settingService.ProgramSettings.WeightBarcodeQuantityLength;
     AutoRoundDiscount           = _settingService.ProgramSettings.AutoRoundDiscount;
     PaymentScreenValues         = _settingService.ProgramSettings.PaymentScreenValues;
 }
 public ProgramSettingsViewModel(ISettingService settingService)
 {
     _settingService = settingService;
     SaveCommand = new CaptionCommand<string>(Resources.Save, OnSave);
     UserInfo = _settingService.ProgramSettings.UserInfo;
     QuantitySeparators = _settingService.ProgramSettings.QuantitySeparators;
     WeightBarcodePrefix = _settingService.ProgramSettings.WeightBarcodePrefix;
     WeightBarcodeItemLength = _settingService.ProgramSettings.WeightBarcodeItemLength;
     WeightBarcodeItemFormat = _settingService.ProgramSettings.WeightBarcodeItemFormat;
     WeightBarcodeQuantityLength = _settingService.ProgramSettings.WeightBarcodeQuantityLength;
     AutoRoundDiscount = _settingService.ProgramSettings.AutoRoundDiscount;
     PaymentScreenValues = _settingService.ProgramSettings.PaymentScreenValues;
 }
 public EntityEditorViewModel(ICacheService cacheService, IAccountService accountService, IUserService userService,
     ITicketServiceBase ticketServiceBase, IApplicationState applicationState, IEntityService entityService)
 {
     _cacheService = cacheService;
     _accountService = accountService;
     _userService = userService;
     _ticketServiceBase = ticketServiceBase;
     _applicationState = applicationState;
     _entityService = entityService;
     SaveEntityCommand = new CaptionCommand<string>(Resources.Save, OnSaveEntity, CanSelectEntity);
     SelectEntityCommand = new CaptionCommand<string>(string.Format(Resources.Select_f, Resources.Entity).Replace(" ", "\r"), OnSelectEntity, CanSelectEntity);
     CreateAccountCommand = new CaptionCommand<string>(string.Format(Resources.Create_f, Resources.Account).Replace(" ", "\r"), OnCreateAccount, CanCreateAccount);
     EventServiceFactory.EventService.GetEvent<GenericEvent<OperationRequest<Entity>>>().Subscribe(OnEditEntity);
 }
 public EntityEditorViewModel(ICacheService cacheService, IAccountService accountService, IUserService userService,
                              ITicketServiceBase ticketServiceBase, IApplicationState applicationState, IEntityService entityService)
 {
     _cacheService        = cacheService;
     _accountService      = accountService;
     _userService         = userService;
     _ticketServiceBase   = ticketServiceBase;
     _applicationState    = applicationState;
     _entityService       = entityService;
     SaveEntityCommand    = new CaptionCommand <string>(Resources.Save, OnSaveEntity, CanSelectEntity);
     SelectEntityCommand  = new CaptionCommand <string>(string.Format(Resources.Select_f, Resources.Entity).Replace(" ", "\r"), OnSelectEntity, CanSelectEntity);
     CreateAccountCommand = new CaptionCommand <string>(string.Format(Resources.Create_f, Resources.Account).Replace(" ", "\r"), OnCreateAccount, CanCreateAccount);
     EventServiceFactory.EventService.GetEvent <GenericEvent <OperationRequest <Entity> > >().Subscribe(OnEditEntity);
 }
        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);
        }
        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);
        }
 public AccountDetailsViewModel(IApplicationState applicationState, IAccountService accountService,
                                ICacheService cacheService, IReportService reportService)
 {
     _applicationState         = applicationState;
     _accountService           = accountService;
     _cacheService             = cacheService;
     _reportService            = reportService;
     CloseAccountScreenCommand = new CaptionCommand <string>(Resources.Close, OnCloseAccountScreen);
     DisplayTicketCommand      = new CaptionCommand <string>(Resources.FindTicket.Replace(" ", "\r"), OnDisplayTicket);
     PrintAccountCommand       = new CaptionCommand <string>(Resources.Print, OnPrintAccount);
     RefreshCommand            = new CaptionCommand <string>(Resources.Refresh, OnRefreshCommand);
     AccountDetails            = new ObservableCollection <AccountDetailData>();
     DocumentTypes             = new ObservableCollection <DocumentTypeButtonViewModel>();
     AccountSummaries          = new ObservableCollection <AccountSummaryData>();
     EventServiceFactory.EventService.GetEvent <GenericEvent <OperationRequest <AccountData> > >().Subscribe(OnDisplayAccountTransactions);
 }
 public AccountDetailsViewModel(IApplicationState applicationState, IAccountService accountService,
     ICacheService cacheService, IReportService reportService)
 {
     _applicationState = applicationState;
     _accountService = accountService;
     _cacheService = cacheService;
     _reportService = reportService;
     CloseAccountScreenCommand = new CaptionCommand<string>(Resources.Close, OnCloseAccountScreen);
     DisplayTicketCommand = new CaptionCommand<string>(Resources.FindTicket.Replace(" ", "\r"), OnDisplayTicket);
     PrintAccountCommand = new CaptionCommand<string>(Resources.Print, OnPrintAccount);
     RefreshCommand = new CaptionCommand<string>(Resources.Refresh, OnRefreshCommand);
     AccountDetails = new ObservableCollection<AccountDetailData>();
     DocumentTypes = new ObservableCollection<DocumentTypeButtonViewModel>();
     AccountSummaries = new ObservableCollection<AccountSummaryData>();
     EventServiceFactory.EventService.GetEvent<GenericEvent<OperationRequest<AccountData>>>().Subscribe(OnDisplayAccountTransactions);
 }
        public void Display(IList<ChangePaymentType> changeTemplates, decimal tenderedAmount, decimal paymentDueAmount, PaymentType paymentType, ICaptionCommand selectChangePaymentTypeCommand)
        {
            ChangeTemplates.Clear();
            ChangeTemplates.AddRange(changeTemplates.Select(x => new CommandButtonViewModel<PaymentData>
            {
                Caption = GetChangeAmountCaption(paymentDueAmount, tenderedAmount, x),
                Parameter = new PaymentData
                {
                    ChangePaymentType = x,
                    PaymentDueAmount = paymentDueAmount,
                    TenderedAmount = tenderedAmount,
                    PaymentType = paymentType
                },
                Command = selectChangePaymentTypeCommand
            }));

            this.PublishEvent(EventTopicNames.Activate);
        }
        public TicketExplorerViewModel(ITicketServiceBase ticketServiceBase,
            IUserService userService, ICacheService cacheService, IApplicationState applicationState)
        {
            _ticketServiceBase = ticketServiceBase;
            _userService = userService;
            _cacheService = cacheService;
            _applicationState = applicationState;

            ResetFilters();

            _timer = new Timer(250);
            _timer.Elapsed += TimerElapsed;

            CloseCommand = new CaptionCommand<string>(Resources.Close, OnCloseCommandExecuted);
            PreviousWorkPeriod = new CaptionCommand<string>("<<", OnExecutePreviousWorkPeriod);
            NextWorkPeriod = new CaptionCommand<string>(">>", OnExecuteNextWorkPeriod);
            RefreshDatesCommand = new CaptionCommand<string>(Resources.Refresh, OnRefreshDates);
            DisplayTicketCommand = new CaptionCommand<string>(Resources.Display, OnDisplayTicket);
        }
        public TicketExplorerViewModel(ITicketServiceBase ticketServiceBase,
                                       IUserService userService, ICacheService cacheService, IApplicationState applicationState)
        {
            _ticketServiceBase = ticketServiceBase;
            _userService       = userService;
            _cacheService      = cacheService;
            _applicationState  = applicationState;

            ResetFilters();

            _timer          = new Timer(250);
            _timer.Elapsed += TimerElapsed;

            CloseCommand         = new CaptionCommand <string>(Resources.Close, OnCloseCommandExecuted);
            PreviousWorkPeriod   = new CaptionCommand <string>("<<", OnExecutePreviousWorkPeriod);
            NextWorkPeriod       = new CaptionCommand <string>(">>", OnExecuteNextWorkPeriod);
            RefreshDatesCommand  = new CaptionCommand <string>(Resources.Refresh, OnRefreshDates);
            DisplayTicketCommand = new CaptionCommand <string>(Resources.Display, OnDisplayTicket);
        }
        public PaymentEditorViewModel(ITicketService ticketService, ICacheService cacheService, IAccountService accountService,
            IUserService userService, IAutomationService automationService, TicketTotalsViewModel totals)
        {
            _ticketService = ticketService;
            _cacheService = cacheService;
            _accountService = accountService;
            _userService = userService;
            _automationService = automationService;

            _executeAutomationCommand = new CaptionCommand<AutomationCommandData>("", OnExecuteAutomationCommand, CanExecuteAutomationCommand);
            _makePaymentCommand = new CaptionCommand<PaymentTemplate>("", OnMakePayment, CanMakePayment);
            _serviceSelectedCommand = new CaptionCommand<CalculationSelector>("", OnSelectCalculationSelector, CanSelectCalculationSelector);

            ClosePaymentScreenCommand = new CaptionCommand<string>(Resources.Close, OnClosePaymentScreen, CanClosePaymentScreen);
            TenderAllCommand = new CaptionCommand<string>(Resources.All, OnTenderAllCommand);
            TypeValueCommand = new DelegateCommand<string>(OnTypeValueExecuted);
            SetValueCommand = new DelegateCommand<string>(OnSetValue);
            DivideValueCommand = new DelegateCommand<string>(OnDivideValue);
            SelectMergedItemCommand = new DelegateCommand<MergedItem>(OnMergedItemSelected);

            SetDiscountAmountCommand = new CaptionCommand<string>(Resources.Round, OnSetDiscountAmountCommand, CanSetDiscount);
            AutoSetDiscountAmountCommand = new CaptionCommand<string>(Resources.Flat, OnAutoSetDiscount, CanAutoSetDiscount);
            SetDiscountRateCommand = new CaptionCommand<string>(Resources.DiscountPercentSign, OnSetDiscountRateCommand, CanSetDiscountRate);

            MergedItems = new ObservableCollection<MergedItem>();
            ReturningAmountVisibility = Visibility.Collapsed;

            Totals = totals;

            PaymentButtonGroup = new PaymentButtonGroupViewModel(_makePaymentCommand, null, ClosePaymentScreenCommand);

            LastTenderedAmount = "1";

            EventServiceFactory.EventService.GetEvent<GenericEvent<EventAggregator>>().Subscribe(x =>
            {
                if (SelectedTicket != null && x.Topic == EventTopicNames.CloseTicketRequested)
                {
                    SelectedTicket = null;
                }
            });
        }
        public PaymentEditorViewModel(ITicketService ticketService, ICacheService cacheService, IAccountService accountService,
            ISettingService settingService, IAutomationService automationService, TicketTotalsViewModel totals, IApplicationStateSetter applicationStateSetter)
        {
            _ticketService = ticketService;
            _cacheService = cacheService;
            _accountService = accountService;
            _settingService = settingService;
            _automationService = automationService;
            _applicationStateSetter = applicationStateSetter;

            _executeAutomationCommand = new CaptionCommand<AutomationCommandData>("", OnExecuteAutomationCommand, CanExecuteAutomationCommand);
            _makePaymentCommand = new CaptionCommand<PaymentType>("", OnMakePayment, CanMakePayment);
            _selectChangePaymentTypeCommand = new CaptionCommand<PaymentData>("", OnSelectChangePaymentType);
            _serviceSelectedCommand = new CaptionCommand<CalculationSelector>("", OnSelectCalculationSelector, CanSelectCalculationSelector);
            _foreignCurrencySelectedCommand = new CaptionCommand<ForeignCurrency>("", OnForeignCurrencySelected);

            ClosePaymentScreenCommand = new CaptionCommand<string>(Resources.Close, OnClosePaymentScreen, CanClosePaymentScreen);

            ChangeTemplates = new ObservableCollection<CommandButtonViewModel<PaymentData>>();
            ReturningAmountVisibility = Visibility.Collapsed;

            Totals = totals;

            PaymentButtonGroup = new PaymentButtonGroupViewModel(_makePaymentCommand, null, ClosePaymentScreenCommand);
            ForeignCurrencyButtons = new List<CommandButtonViewModel<ForeignCurrency>>();
            NumberPadViewModel = new NumberPadViewModel();
            NumberPadViewModel.TypedValueChanged += NumberPadViewModelTypedValueChanged;
            NumberPadViewModel.ResetValue += NumberPadViewModelResetValue;
            NumberPadViewModel.PaymentDueChanged += NumberPadViewModelPaymentDueChanged;
            OrderSelector = new OrderSelectorViewModel(new OrderSelector(), NumberPadViewModel);

            EventServiceFactory.EventService.GetEvent<GenericEvent<EventAggregator>>().Subscribe(x =>
            {
                if (SelectedTicket != null && x.Topic == EventTopicNames.CloseTicketRequested)
                {
                    SelectedTicket = null;
                }
            });
        }
Example #46
0
        public PaymentEditorViewModel(ITicketService ticketService, ICacheService cacheService, IAccountService accountService,
                                      ISettingService settingService, IAutomationService automationService, TicketTotalsViewModel totals, IApplicationStateSetter applicationStateSetter)
        {
            _ticketService          = ticketService;
            _cacheService           = cacheService;
            _accountService         = accountService;
            _settingService         = settingService;
            _automationService      = automationService;
            _applicationStateSetter = applicationStateSetter;

            _executeAutomationCommand       = new CaptionCommand <AutomationCommandData>("", OnExecuteAutomationCommand, CanExecuteAutomationCommand);
            _makePaymentCommand             = new CaptionCommand <PaymentType>("", OnMakePayment, CanMakePayment);
            _selectChangePaymentTypeCommand = new CaptionCommand <PaymentData>("", OnSelectChangePaymentType);
            _serviceSelectedCommand         = new CaptionCommand <CalculationSelector>("", OnSelectCalculationSelector, CanSelectCalculationSelector);
            _foreignCurrencySelectedCommand = new CaptionCommand <ForeignCurrency>("", OnForeignCurrencySelected);

            ClosePaymentScreenCommand = new CaptionCommand <string>(Resources.Close, OnClosePaymentScreen, CanClosePaymentScreen);

            ChangeTemplates           = new ObservableCollection <CommandButtonViewModel <PaymentData> >();
            ReturningAmountVisibility = Visibility.Collapsed;

            Totals = totals;

            PaymentButtonGroup     = new PaymentButtonGroupViewModel(_makePaymentCommand, null, ClosePaymentScreenCommand);
            ForeignCurrencyButtons = new List <CommandButtonViewModel <ForeignCurrency> >();
            NumberPadViewModel     = new NumberPadViewModel();
            NumberPadViewModel.TypedValueChanged += NumberPadViewModelTypedValueChanged;
            NumberPadViewModel.ResetValue        += NumberPadViewModelResetValue;
            NumberPadViewModel.PaymentDueChanged += NumberPadViewModelPaymentDueChanged;
            OrderSelector = new OrderSelectorViewModel(new OrderSelector(), NumberPadViewModel);

            EventServiceFactory.EventService.GetEvent <GenericEvent <EventAggregator> >().Subscribe(x =>
            {
                if (SelectedTicket != null && x.Topic == EventTopicNames.CloseTicketRequested)
                {
                    SelectedTicket = null;
                }
            });
        }
Example #47
0
 public void SetButtonCommands(ICaptionCommand makePaymentCommand, ICaptionCommand settleCommand, ICaptionCommand closeCommand)
 {
     _makePaymentCommand = makePaymentCommand;
     _settleCommand      = settleCommand;
     _closeCommand       = closeCommand;
 }
Example #48
0
 public TicketLogViewerViewModel()
 {
     CloseCommand = new CaptionCommand <string>(Resources.Close, OnClose);
 }
 public TicketLogViewerViewModel()
 {
     CloseCommand = new CaptionCommand<string>(Resources.Close, OnClose);
 }
 public TicketNoteEditorViewModel()
 {
     CloseCommand = new CaptionCommand<string>(Resources.Close, OnClose);
 }
Example #51
0
 public LoginViewModel()
 {
     EnterValueCommand = new CaptionCommand<string>("Cmd", OnEnterValue);
     SubmitPinCommand = new CaptionCommand<string>("Gir", OnPinSubmitted);
 }
 public BatchEntityEditorViewModel()
 {
     Commands = new List<ICaptionCommand>();
     SaveCommand = new CaptionCommand<string>(Resources.SaveChanges, OnSave, CanSave);
     Commands.Add(SaveCommand);
 }
 public void SetButtonCommands(ICaptionCommand makePaymentCommand, ICaptionCommand settleCommand, ICaptionCommand closeCommand)
 {
     PaymentButtonGroup.SetButtonCommands(makePaymentCommand, settleCommand, closeCommand);
 }
 public TicketNoteEditorViewModel()
 {
     CloseCommand = new CaptionCommand <string>(Resources.Close, OnClose);
 }
 public void SetButtonCommands(ICaptionCommand makePaymentCommand, ICaptionCommand settleCommand, ICaptionCommand closeCommand)
 {
     _makePaymentCommand = makePaymentCommand;
     _settleCommand = settleCommand;
     _closeCommand = closeCommand;
 }
 public void SetButtonCommands(ICaptionCommand makePaymentCommand, ICaptionCommand settleCommand, ICaptionCommand closeCommand)
 {
     PaymentButtonGroup.SetButtonCommands(makePaymentCommand, settleCommand, closeCommand);
 }
Example #57
0
 public TaskTypeViewModel()
 {
     AddCustomFieldCommand    = new CaptionCommand <string>(Resources.Add, OnAddCustomField);
     DeleteCustomFieldCommand = new CaptionCommand <string>(Resources.Delete, OnDeleteCustomField, CanDeleteCustomField);
 }
        public void Display(IList <ChangePaymentType> changeTemplates, decimal tenderedAmount, decimal paymentDueAmount, PaymentType paymentType, ICaptionCommand selectChangePaymentTypeCommand)
        {
            ChangeTemplates.Clear();
            ChangeTemplates.AddRange(changeTemplates.Select(x => new CommandButtonViewModel <PaymentData>
            {
                Caption   = GetChangeAmountCaption(paymentDueAmount, tenderedAmount, x),
                Parameter = new PaymentData
                {
                    ChangePaymentType = x,
                    PaymentDueAmount  = paymentDueAmount,
                    TenderedAmount    = tenderedAmount,
                    PaymentType       = paymentType
                },
                Command = selectChangePaymentTypeCommand
            }));

            this.PublishEvent(EventTopicNames.Activate);
        }
 public LoggedInUserViewModel()
 {
     CloseScreenCommand = new CaptionCommand<string>("Close", OnCloseScreen);
 }