Exemplo n.º 1
0
        private void RegisterCreateGroupingDialog(IShooterCollectionDataStore shooterCollectionDataStore, ServiceDeskConfiguration serviceDeskConfiguration)
        {
            _messenger.Register <CreateGroupingDialogMessage>(this,
                                                              x =>
            {
                var m = new CreateGroupingViewModel(serviceDeskConfiguration)
                {
                    Title = "Gruppierung erstellen"
                };

                IWindow w   = _vs.ExecuteFunction <CreateGroupingViewModel, IWindow>((IWindow)Current.MainWindow, m);
                bool?result = w.ShowDialog();
                if (!result.HasValue || !result.Value)
                {
                    return;
                }

                ShooterCollection sc = new ShooterCollection
                {
                    CollectionName = m.GroupingName,
                    ProgramNumber  = int.Parse(m.SelectedParticipation.ProgramNumber)
                };

                shooterCollectionDataStore.Create(sc);
                _messenger.Send(new RefreshDataFromRepositoriesMessage());
            });
        }
        private void ExecuteAddCommand(string obj)
        {
            ShooterCollection sc = new ShooterCollection
            {
                CollectionName = obj
            };

            _shooterCollectionDataStore.Create(sc);

            UiEventsDelegate <UiParticipation> handler = _uiEvents.FetchSelectedParticipation;

            if (handler != null)
            {
                UiParticipation p = handler();
                if (p != null)
                {
                    ShooterCollectionParticipation scp = new ShooterCollectionParticipation
                    {
                        ParticipationId     = p.ParticipationId,
                        ShooterCollectionId = sc.ShooterCollectionId
                    };
                    _shooterCollectionParticipationDataStore.Create(scp);
                }
            }

            _windowService.CloseTextBoxInputDialog();
        }
        private void ExecuteCreateParticipationCommand(ParticipationDraft participationDraft)
        {
            ShooterCollection shooterCollection = new ShooterCollection
            {
                CollectionName = participationDraft.ParticipationName
            };

            _shooterCollectionDataStore.Create(shooterCollection);

            ShooterCollectionParticipation collectionParticipation = new ShooterCollectionParticipation
            {
                ParticipationId     = participationDraft.ParticipationType.ParticipationTypeId,
                ShooterCollectionId = shooterCollection.ShooterCollectionId
            };

            _shooterCollectionParticipationDataStore.Create(collectionParticipation);
            _windowService.CloseCreateParticipationWindow();
        }
Exemplo n.º 4
0
        private void RegisterCreateGroupingDialog(IShooterCollectionDataStore shooterCollectionDataStore, ServiceDeskConfiguration serviceDeskConfiguration)
        {
            _messenger.Register<CreateGroupingDialogMessage>(this,
                x =>
                {
                    var m = new CreateGroupingViewModel(serviceDeskConfiguration)
                    {
                        Title = "Gruppierung erstellen"
                    };

                    IWindow w = _vs.ExecuteFunction<CreateGroupingViewModel, IWindow>((IWindow) Current.MainWindow, m);
                    bool? result = w.ShowDialog();
                    if (!result.HasValue || !result.Value) return;

                    ShooterCollection sc = new ShooterCollection
                    {
                        CollectionName = m.GroupingName,
                        ProgramNumber = int.Parse(m.SelectedParticipation.ProgramNumber)
                    };

                    shooterCollectionDataStore.Create(sc);
                    _messenger.Send(new RefreshDataFromRepositoriesMessage());
                });
        }