public DefaultConfiguration() { //_shootingRange = new SiusDataFileProvider(@"C:\Users\eberlid\Dropbox\SSC\2014\Herbstschiessen\ShootingRange\20140516_164043.log"); //_shootingRange = new SiusDataFileProvider(@"C:\Users\eberlid\Documents\My Dropbox\SSC\2014\Herbstschiessen\ShootingRange\20140516_164043.log"); //_shootingRange = new SiusDataFileProvider(@"C:\Users\eberlid\Dropbox\SSC\2014\Herbstschiessen\ShootingRange\20130914_132912.log"); //_shootingRange = new SiusApiProvider("http://192.168.1.4"); _shootingRange = new SiusDataSocketProvider("127.0.0.1", 4000); _events = new ShootingRangeEvents(); _uiEvents = new UIEvents(); ShootingRangeEntities entities = new ShootingRangeEntities(); _personRepository = new PersonDataStore(entities); _shooterRepository = new ShooterDataStore(entities); _participationDataStore = new ParticipationDataStore(entities); _sessionDataStore = new SessionDataStore(entities); _shotDataStore = new ShotDataStore(entities); _sessionDetailsView = new SessionDetailsView(entities); _shooterNumberConfigDataStore = new ShooterNumberConfigDataStore(entities); _shooterParticipationDataStore = new ShooterParticipationDataStore(entities); _sessionSubtotalDataStore = new SessionSubtotalDataStore(entities); _programItemDataStore = new ProgramItemDataStore(entities); _groupMemberDetailsView = new GroupMemberDetailsView(entities); _groupDetailsView = new GroupDetailsView(entities); _shooterParticipationView = new ShooterParticipationView(entities); _windowService = new WindowService(); _barcodePrintService = new PtouchBarcodePrinter(); _barcodeBuilderService = new Barcode2Of5InterleavedService(); _shooterNumberService = new ShooterNumberService(_shooterNumberConfigDataStore); _shooterCollectionParticipationDataStore = new ShooterCollectionParticipationDataStore(entities); _shooterCollectionDataStore = new ShooterCollectionDataStore(entities); _collectionShooterDataStore = new CollectionShooterDataStore(entities); _ssvShooterDataWriterService = new SsvFileWriter(@"C:\Sius\SiusData\SSVDaten\SSV_schuetzen.txt"); }
public EditPassViewModel() { if (!DesignTimeHelper.IsInDesignMode) { IConfiguration config = ConfigurationSource.Configuration; _shooterDatastore = config.GetShooterDataStore(); _sessionDatastore = config.GetSessionDataStore(); _programItemDatastore = config.GetProgramItemDataStore(); _personDatastore = config.GetPersonDataStore(); _windowService = config.GetWindowService(); _events = config.GetUIEvents(); List <UiShooter> shooters = _shooterDatastore.GetAll().Select(UiBusinessObjectMapper.ToUiShooter).ToList(); shooters.ForEach(_ => { if (_.PersonId != null) { _.FetchPerson(_personDatastore.FindById((int)_.PersonId)); } }); UiShooters = new ObservableCollection <UiShooter>(shooters.OrderBy(_ => _.LastName).ThenBy(_ => _.FirstName)); SearchShooterCommand = new RelayCommand <string>(ExecuteSearchShooterCommand, CanExecuteSearchShooterCommand); DeleteCommand = new RelayCommand <UiSession>(ExecuteDeleteCommand, CanExecuteDeleteCommand); CancelCommand = new RelayCommand <object>(ExecuteCancelCommand); SaveCommand = new RelayCommand <UiShooter>(ExecuteSaveCommand, CanExecuteSaveCommand); UiShooter selectedUiShooter = _events.FetchSelectedShooter(); if (selectedUiShooter != null) { ShooterNumber = string.Format("{0}", selectedUiShooter.ShooterNumber); ExecuteSearchShooterCommand(ShooterNumber); } } }
public EditPassViewModel() { if (!DesignTimeHelper.IsInDesignMode) { IConfiguration config = ConfigurationSource.Configuration; _shooterDatastore = config.GetShooterDataStore(); _sessionDatastore = config.GetSessionDataStore(); _programItemDatastore = config.GetProgramItemDataStore(); _personDatastore = config.GetPersonDataStore(); _windowService = config.GetWindowService(); _events = config.GetUIEvents(); List<UiShooter> shooters = _shooterDatastore.GetAll().Select(UiBusinessObjectMapper.ToUiShooter).ToList(); shooters.ForEach(_ => { if (_.PersonId != null) _.FetchPerson(_personDatastore.FindById((int) _.PersonId)); }); UiShooters = new ObservableCollection<UiShooter>(shooters.OrderBy(_ => _.LastName).ThenBy(_ => _.FirstName)); SearchShooterCommand = new RelayCommand<string>(ExecuteSearchShooterCommand, CanExecuteSearchShooterCommand); DeleteCommand = new RelayCommand<UiSession>(ExecuteDeleteCommand, CanExecuteDeleteCommand); CancelCommand = new RelayCommand<object>(ExecuteCancelCommand); SaveCommand = new RelayCommand<UiShooter>(ExecuteSaveCommand, CanExecuteSaveCommand); UiShooter selectedUiShooter = _events.FetchSelectedShooter(); if (selectedUiShooter != null) { ShooterNumber = string.Format("{0}", selectedUiShooter.ShooterNumber); ExecuteSearchShooterCommand(ShooterNumber); } } }
public DefaultConfiguration() { //_shootingRange = new SiusDataFileProvider(@"C:\Users\eberlid\Dropbox\SSC\2014\Herbstschiessen\ShootingRange\20140516_164043.log"); //_shootingRange = new SiusDataFileProvider(@"C:\Users\eberlid\Documents\My Dropbox\SSC\2014\Herbstschiessen\ShootingRange\20140516_164043.log"); //_shootingRange = new SiusDataFileProvider(@"C:\Users\eberlid\Dropbox\SSC\2014\Herbstschiessen\ShootingRange\20130914_132912.log"); //_shootingRange = new SiusApiProvider("http://192.168.1.4"); _shootingRange = new SiusDataSocketProvider("127.0.0.1", 4000); _events = new ShootingRangeEvents(); _uiEvents = new UIEvents(); ShootingRangeEntities entities = new ShootingRangeEntities(); _personRepository = new PersonDataStore(entities); _shooterRepository = new ShooterDataStore(entities); _participationDataStore = new ParticipationDataStore(entities); _sessionDataStore = new SessionDataStore(entities); _shotDataStore = new ShotDataStore(entities); _sessionDetailsView = new SessionDetailsView(entities); _shooterNumberConfigDataStore = new ShooterNumberConfigDataStore(entities); _shooterParticipationDataStore = new ShooterParticipationDataStore(entities); _sessionSubtotalDataStore = new SessionSubtotalDataStore(entities); _programItemDataStore = new ProgramItemDataStore(entities); _groupMemberDetailsView = new GroupMemberDetailsView(entities); _groupDetailsView = new GroupDetailsView(entities); _shooterParticipationView = new ShooterParticipationView(entities); _windowService = new WindowService(); _barcodePrintService = new PtouchBarcodePrinter(); _barcodeBuilderService = new Barcode2Of5InterleavedService(); _shooterNumberService = new ShooterNumberService(_shooterNumberConfigDataStore); _shooterCollectionParticipationDataStore = new ShooterCollectionParticipationDataStore(entities); _shooterCollectionDataStore = new ShooterCollectionDataStore(entities); _collectionShooterDataStore = new CollectionShooterDataStore(entities); _ssvShooterDataWriterService = new SsvFileWriter(@"C:\Sius\SiusData\SSVDaten\SSV_schuetzen.txt"); }