Ejemplo n.º 1
0
        public TicketViewModel(IApplicationState applicationState, IExpressionService expressionService,
            ITicketService ticketService, IAccountService accountService, IEntityServiceClient locationService, IUserService userService,
            ICacheService cacheService, TicketOrdersViewModel ticketOrdersViewModel,
            TicketTotalsViewModel totals, TicketInfoViewModel ticketInfoViewModel, PaymentButtonViewModel paymentButtonViewModel)
        {
            _ticketService = ticketService;
            _userService = userService;
            _cacheService = cacheService;
            _applicationState = applicationState;
            _expressionService = expressionService;
            _ticketOrdersViewModel = ticketOrdersViewModel;
            _totals = totals;
            _ticketInfo = ticketInfoViewModel;
            _paymentButtonViewModel = paymentButtonViewModel;

            SelectEntityCommand = new DelegateCommand<EntityType>(OnSelectEntity, CanSelectEntity);
            ExecuteAutomationCommnand = new DelegateCommand<CommandContainerButton>(OnExecuteAutomationCommand, CanExecuteAutomationCommand);

            IncQuantityCommand = new CaptionCommand<string>("+", OnIncQuantityCommand, CanIncQuantity);
            DecQuantityCommand = new CaptionCommand<string>("-", OnDecQuantityCommand, CanDecQuantity);
            IncSelectionQuantityCommand = new CaptionCommand<string>("(+)", OnIncSelectionQuantityCommand, CanIncSelectionQuantity);
            DecSelectionQuantityCommand = new CaptionCommand<string>("(-)", OnDecSelectionQuantityCommand, CanDecSelectionQuantity);
            ShowTicketTagsCommand = new CaptionCommand<TicketTagGroup>(Resources.Tag, OnShowTicketsTagExecute, CanExecuteShowTicketTags);
            CancelItemCommand = new CaptionCommand<string>(Resources.Cancel, OnCancelItemCommand);
            MoveOrdersCommand = new CaptionCommand<string>(Resources.MoveTicketLine, OnMoveOrders, CanMoveOrders);
            EditTicketNoteCommand = new CaptionCommand<string>(Resources.TicketNote.Replace(" ", Environment.NewLine), OnEditTicketNote, CanEditTicketNote);
            RemoveTicketLockCommand = new CaptionCommand<string>(Resources.ReleaseLock, OnRemoveTicketLock, CanRemoveTicketLock);
            ChangePriceCommand = new CaptionCommand<string>(Resources.ChangePrice, OnChangePrice, CanChangePrice);
            AddOrderCommand = new CaptionCommand<string>(Resources.AddOrder.Replace(" ", Environment.NewLine), OnAddOrder, CanAddOrder);

            EventServiceFactory.EventService.GetEvent<GenericEvent<OrderViewModel>>().Subscribe(OnSelectedOrdersChanged);
            EventServiceFactory.EventService.GetEvent<GenericEvent<EventAggregator>>().Subscribe(OnRefreshTicket);
            EventServiceFactory.EventService.GetEvent<GenericEvent<PopupData>>().Subscribe(OnAccountSelectedFromPopup);
            EventServiceFactory.EventService.GetEvent<GenericEvent<OrderTagData>>().Subscribe(OnOrderTagEvent);
            EventServiceFactory.EventService.GetEvent<GenericEvent<MenuItemPortion>>().Subscribe(OnPortionSelected);
            EventServiceFactory.EventService.GetEvent<GenericEvent<Department>>().Subscribe(OnDepartmentChanged);
            EventServiceFactory.EventService.GetEvent<GenericEvent<AutomationCommandValueData>>().Subscribe(OnAutomationCommandValueSelected);

            SelectedTicket = Ticket.Empty;
        }
Ejemplo n.º 2
0
 public UdpateEntityData(IEntityServiceClient entityServiceClient, ICacheService cacheService)
 {
     _entityServiceClient = entityServiceClient;
     _cacheService = cacheService;
 }
Ejemplo n.º 3
0
        public TicketViewModel(IApplicationState applicationState, IExpressionService expressionService,
                               ITicketService ticketService, IAccountService accountService, IEntityServiceClient locationService, IUserService userService,
                               ICacheService cacheService, TicketOrdersViewModel ticketOrdersViewModel,
                               TicketTotalsViewModel totals, TicketInfoViewModel ticketInfoViewModel, PaymentButtonViewModel paymentButtonViewModel)
        {
            _ticketService         = ticketService;
            _userService           = userService;
            _cacheService          = cacheService;
            _applicationState      = applicationState;
            _expressionService     = expressionService;
            _ticketOrdersViewModel = ticketOrdersViewModel;
            _totals                 = totals;
            _ticketInfo             = ticketInfoViewModel;
            _paymentButtonViewModel = paymentButtonViewModel;

            SelectEntityCommand       = new DelegateCommand <EntityType>(OnSelectEntity, CanSelectEntity);
            ExecuteAutomationCommnand = new DelegateCommand <CommandContainerButton>(OnExecuteAutomationCommand, CanExecuteAutomationCommand);

            IncQuantityCommand          = new CaptionCommand <string>("+", OnIncQuantityCommand, CanIncQuantity);
            DecQuantityCommand          = new CaptionCommand <string>("-", OnDecQuantityCommand, CanDecQuantity);
            IncSelectionQuantityCommand = new CaptionCommand <string>("(+)", OnIncSelectionQuantityCommand, CanIncSelectionQuantity);
            DecSelectionQuantityCommand = new CaptionCommand <string>("(-)", OnDecSelectionQuantityCommand, CanDecSelectionQuantity);
            ShowTicketTagsCommand       = new CaptionCommand <TicketTagGroup>(Resources.Tag, OnShowTicketsTagExecute, CanExecuteShowTicketTags);
            CancelItemCommand           = new CaptionCommand <string>(Resources.Cancel, OnCancelItemCommand);
            MoveOrdersCommand           = new CaptionCommand <string>(Resources.MoveTicketLine, OnMoveOrders, CanMoveOrders);
            EditTicketNoteCommand       = new CaptionCommand <string>(Resources.TicketNote.Replace(" ", Environment.NewLine), OnEditTicketNote, CanEditTicketNote);
            RemoveTicketLockCommand     = new CaptionCommand <string>(Resources.ReleaseLock, OnRemoveTicketLock, CanRemoveTicketLock);
            ChangePriceCommand          = new CaptionCommand <string>(Resources.ChangePrice, OnChangePrice, CanChangePrice);
            AddOrderCommand             = new CaptionCommand <string>(Resources.AddOrder.Replace(" ", Environment.NewLine), OnAddOrder, CanAddOrder);

            EventServiceFactory.EventService.GetEvent <GenericEvent <OrderViewModel> >().Subscribe(OnSelectedOrdersChanged);
            EventServiceFactory.EventService.GetEvent <GenericEvent <EventAggregator> >().Subscribe(OnRefreshTicket);
            EventServiceFactory.EventService.GetEvent <GenericEvent <PopupData> >().Subscribe(OnAccountSelectedFromPopup);
            EventServiceFactory.EventService.GetEvent <GenericEvent <OrderTagData> >().Subscribe(OnOrderTagEvent);
            EventServiceFactory.EventService.GetEvent <GenericEvent <MenuItemPortion> >().Subscribe(OnPortionSelected);
            EventServiceFactory.EventService.GetEvent <GenericEvent <Department> >().Subscribe(OnDepartmentChanged);
            EventServiceFactory.EventService.GetEvent <GenericEvent <AutomationCommandValueData> >().Subscribe(OnAutomationCommandValueSelected);

            SelectedTicket = Ticket.Empty;
        }
Ejemplo n.º 4
0
 public UpdateEntityState(IEntityServiceClient entityServiceClient, ICacheService cacheService)
 {
     _entityServiceClient = entityServiceClient;
     _cacheService = cacheService;
 }
Ejemplo n.º 5
0
 public UdpateEntityData(IEntityServiceClient entityServiceClient, ICacheService cacheService)
 {
     _entityServiceClient = entityServiceClient;
     _cacheService        = cacheService;
 }
Ejemplo n.º 6
0
 public UpdateEntityState(IEntityServiceClient entityServiceClient, ICacheService cacheService)
 {
     _entityServiceClient = entityServiceClient;
     _cacheService        = cacheService;
 }