예제 #1
0
        private void RegisterReassignShooterNumberDialog(ISessionDataStore sessionDataStore)
        {
            _messenger.Register <ShowReassignShooterNumberDialogMessage>(this,
                                                                         x =>
            {
                ReassignProgramNumberViewModel vm = new ReassignProgramNumberViewModel
                {
                    Title = "Programm neu zuweisen"
                };
                vm.Initialize(x.SessionId);

                IWindow w   = _vs.ExecuteFunction <ReassignProgramNumberViewModel, IWindow>((IWindow)Current.MainWindow, vm);
                bool?result = w.ShowDialog();

                if (!result.HasValue || !result.Value)
                {
                    return;
                }

                Session s       = sessionDataStore.FindById(x.SessionId);
                s.ProgramNumber = vm.SelectedParticipation.ProgramNumber;
                sessionDataStore.Update(s);

                _messenger.Send(new RefreshDataFromRepositoriesMessage());
            });
        }
예제 #2
0
 private void ExecuteSaveCommand(UiShooter obj)
 {
     _selectedUiSession.ShooterId = obj.ShooterId;
     _sessionDatastore.Update(UiBusinessObjectMapper.ToSession(SelectedUiSession));
     ExecuteSearchShooterCommand(ShooterNumber);
     _events.ShooterDataStoreChanged();
 }
예제 #3
0
        private void RegisterReassignShooterNumberDialog(ISessionDataStore sessionDataStore)
        {
            _messenger.Register<ShowReassignShooterNumberDialogMessage>(this,
                x =>
                {
                    ReassignProgramNumberViewModel vm = new ReassignProgramNumberViewModel
                    {
                        Title = "Programm neu zuweisen"
                    };
                    vm.Initialize(x.SessionId);

                    IWindow w = _vs.ExecuteFunction<ReassignProgramNumberViewModel, IWindow>((IWindow)Current.MainWindow, vm);
                    bool? result = w.ShowDialog();

                    if (!result.HasValue || !result.Value) return;

                    Session s = sessionDataStore.FindById(x.SessionId);
                    s.ProgramNumber = vm.SelectedParticipation.ProgramNumber;
                    sessionDataStore.Update(s);

                    _messenger.Send(new RefreshDataFromRepositoriesMessage());
                });
        }