Exemplo n.º 1
0
        public TicketModule(IRegionManager regionManager, IUserService userService, TicketExplorerView ticketExplorerView, TicketExplorerViewModel ticketExplorerViewModel)
            : base(regionManager, AppScreens.TicketListView)
        {
            _regionManager = regionManager;
            _userService = userService;

            _ticketExplorerView = ticketExplorerView;
            _ticketExplorerViewModel = ticketExplorerViewModel;
            _ticketExplorerViewModel.TicketAction = () => OnNavigate("");

            AddDashboardCommand<EntityCollectionViewModelBase<TicketTypeViewModel, TicketType>>(Resources.TicketType.ToPlural(), Resources.Tickets, 35);
            AddDashboardCommand<EntityCollectionViewModelBase<TicketTagGroupViewModel, TicketTagGroup>>(Resources.TicketTag.ToPlural(), Resources.Tickets, 35);
            AddDashboardCommand<EntityCollectionViewModelBase<OrderTagGroupViewModel, OrderTagGroup>>(Resources.OrderTag.ToPlural(), Resources.Tickets, 35);
            AddDashboardCommand<EntityCollectionViewModelBase<PaymentTypeViewModel, PaymentType>>(Resources.PaymentType.ToPlural(), Resources.Tickets, 35);
            AddDashboardCommand<EntityCollectionViewModelBase<ChangePaymentTypeViewModel, ChangePaymentType>>(Resources.ChangePaymentType.ToPlural(), Resources.Tickets, 35);
            AddDashboardCommand<EntityCollectionViewModelBase<CalculationTypeViewModel, CalculationType>>(Resources.CalculationType.ToPlural(), Resources.Tickets, 35);
            AddDashboardCommand<EntityCollectionViewModelBase<CalculationSelectorViewModel, CalculationSelector>>(Resources.CalculationSelector.ToPlural(), Resources.Tickets, 35);

            PermissionRegistry.RegisterPermission(PermissionNames.AddItemsToLockedTickets, PermissionCategories.Ticket, Resources.CanReleaseTicketLock);
            PermissionRegistry.RegisterPermission(PermissionNames.RemoveTicketTag, PermissionCategories.Ticket, Resources.CanRemoveTicketTag);
            PermissionRegistry.RegisterPermission(PermissionNames.MoveOrders, PermissionCategories.Ticket, Resources.CanMoveTicketLines);
            PermissionRegistry.RegisterPermission(PermissionNames.MergeTickets, PermissionCategories.Ticket, Resources.CanMergeTickets);
            PermissionRegistry.RegisterPermission(PermissionNames.DisplayOldTickets, PermissionCategories.Ticket, Resources.CanDisplayOldTickets);
            PermissionRegistry.RegisterPermission(PermissionNames.MoveUnlockedOrders, PermissionCategories.Ticket, Resources.CanMoveUnlockedTicketLines);
            PermissionRegistry.RegisterPermission(PermissionNames.ChangeExtraProperty, PermissionCategories.Ticket, Resources.CanUpdateExtraModifiers);
            PermissionRegistry.RegisterPermission(PermissionNames.DisplayOtherWaitersTickets, PermissionCategories.Ticket, Resources.CanDisplayOtherWaitersTickets);

            SetNavigationCommand(Resources.Tickets, Resources.Common, "Images/note.png", 20);

            ticketExplorerView.DataContext = ticketExplorerViewModel;
        }
Exemplo n.º 2
0
        public TicketModule(IRegionManager regionManager, TicketExplorerView ticketExplorerView, TicketExplorerViewModel ticketExplorerViewModel)
            : base(regionManager, AppScreens.TicketListView)
        {
            _regionManager = regionManager;

            _ticketExplorerView      = ticketExplorerView;
            _ticketExplorerViewModel = ticketExplorerViewModel;
            _ticketExplorerViewModel.TicketAction = () => OnNavigate("");

            AddDashboardCommand <EntityCollectionViewModelBase <TicketTypeViewModel, TicketType> >(Resources.TicketType.ToPlural(), Resources.Tickets, 35);
            AddDashboardCommand <EntityCollectionViewModelBase <TicketTagGroupViewModel, TicketTagGroup> >(Resources.TicketTag.ToPlural(), Resources.Tickets, 35);
            AddDashboardCommand <EntityCollectionViewModelBase <OrderTagTemplateViewModel, OrderTagTemplate> >(Resources.OrderTagTemplate.ToPlural(), Resources.Tickets, 35);
            AddDashboardCommand <EntityCollectionViewModelBase <OrderTagGroupViewModel, OrderTagGroup> >(Resources.OrderTag.ToPlural(), Resources.Tickets, 35);
            AddDashboardCommand <EntityCollectionViewModelBase <PaymentTypeViewModel, PaymentType> >(Resources.PaymentType.ToPlural(), Resources.Tickets, 35);
            AddDashboardCommand <EntityCollectionViewModelBase <ChangePaymentTypeViewModel, ChangePaymentType> >(Resources.ChangePaymentType.ToPlural(), Resources.Tickets, 35);
            AddDashboardCommand <EntityCollectionViewModelBase <CalculationTypeViewModel, CalculationType> >(Resources.CalculationType.ToPlural(), Resources.Tickets, 35);
            AddDashboardCommand <EntityCollectionViewModelBase <CalculationSelectorViewModel, CalculationSelector> >(Resources.CalculationSelector.ToPlural(), Resources.Tickets, 35);

            PermissionRegistry.RegisterPermission(PermissionNames.AddItemsToLockedTickets, PermissionCategories.Ticket, Resources.CanReleaseTicketLock);
            PermissionRegistry.RegisterPermission(PermissionNames.RemoveTicketTag, PermissionCategories.Ticket, Resources.CanRemoveTicketTag);
            PermissionRegistry.RegisterPermission(PermissionNames.MoveOrders, PermissionCategories.Ticket, Resources.CanMoveTicketLines);
            PermissionRegistry.RegisterPermission(PermissionNames.MergeTickets, PermissionCategories.Ticket, Resources.CanMergeTickets);
            PermissionRegistry.RegisterPermission(PermissionNames.DisplayOldTickets, PermissionCategories.Ticket, Resources.CanDisplayOldTickets);
            PermissionRegistry.RegisterPermission(PermissionNames.MoveUnlockedOrders, PermissionCategories.Ticket, Resources.CanMoveUnlockedTicketLines);
            PermissionRegistry.RegisterPermission(PermissionNames.ChangeExtraProperty, PermissionCategories.Ticket, Resources.CanUpdateExtraModifiers);
            PermissionRegistry.RegisterPermission(PermissionNames.DisplayOtherWaitersTickets, PermissionCategories.Ticket, Resources.CanDisplayOtherWaitersTickets);

            SetNavigationCommand(Resources.Tickets, Resources.Common, "Images/note.png", 20);
            ticketExplorerView.DataContext = ticketExplorerViewModel;
        }