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()); }); }
private void ExecuteSaveCommand(UiShooter obj) { _selectedUiSession.ShooterId = obj.ShooterId; _sessionDatastore.Update(UiBusinessObjectMapper.ToSession(SelectedUiSession)); ExecuteSearchShooterCommand(ShooterNumber); _events.ShooterDataStoreChanged(); }
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()); }); }