예제 #1
0
        public TicketViewModel(IApplicationState applicationState, IExpressionService expressionService,
                               ITicketService ticketService, IAccountService accountService, IEntityServiceClient locationService, IUserService userService,
                               ICacheService cacheService, TicketOrdersViewModel ticketOrdersViewModel,
                               TicketTotalsViewModel totals, TicketInfoViewModel ticketInfoViewModel)
        {
            _ticketService         = ticketService;
            _userService           = userService;
            _cacheService          = cacheService;
            _applicationState      = applicationState;
            _expressionService     = expressionService;
            _ticketOrdersViewModel = ticketOrdersViewModel;
            _totals     = totals;
            _ticketInfo = ticketInfoViewModel;

            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);
            ModifyOrderCommand          = new CaptionCommand <string>(Resources.ModifyOrder.Replace(" ", Environment.NewLine), OnModifyOrder, CanModifyOrder);

            EventServiceFactory.EventService.GetEvent <GenericEvent <OrderViewModel> >().Subscribe(OnSelectedOrdersChanged);
            EventServiceFactory.EventService.GetEvent <GenericEvent <EventAggregator> >().Subscribe(OnRefreshTicket);
            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);
            EventServiceFactory.EventService.GetEvent <GenericEvent <AutomationCommandData> >().Subscribe(OnAutomationCommandSelected);

            SelectedTicket = Ticket.Empty;
        }
예제 #2
0
 public TicketInfoView(TicketInfoViewModel viewModel)
 {
     DataContext = viewModel;
     InitializeComponent();
 }