コード例 #1
0
 private void ExecuteSaveCommand(UiShooter obj)
 {
     _selectedUiSession.ShooterId = obj.ShooterId;
     _sessionDatastore.Update(UiBusinessObjectMapper.ToSession(SelectedUiSession));
     ExecuteSearchShooterCommand(ShooterNumber);
     _events.ShooterDataStoreChanged();
 }
コード例 #2
0
        private void ExecuteCreateShooterCommand(UiPerson uiPerson)
        {
            try
            {
                Shooter shooter = new Shooter();
                shooter.ShooterNumber = _shooterNumberService.GetShooterNumber();
                shooter.PersonId      = uiPerson.PersonId;
                _shooterDataStore.Create(shooter);
                _shooterDataWriterService.WriteShooterData(new SsvShooterData
                {
                    FirstName     = uiPerson.FirstName,
                    LastName      = uiPerson.LastName,
                    LicenseNumber = (uint)shooter.ShooterNumber
                });
                _windowService.ShowMessage("Schütze erstellt", string.Format("Schütze mit Schützennummer '{0}' erfolgreich erstellt.", shooter.ShooterNumber));
            }
            catch (Exception e)
            {
                ReportException(e);
                _shooterDataStore.Revert();
            }
            finally
            {
                _uiEvents.ShooterDataStoreChanged();
            }

            //try
            //{
            //  _windowService.ShowCreateShooterWindow();
            //}
            //catch (Exception e)
            //{
            //  ReportException(e);
            //}
        }