Esempio n. 1
0
        public MinneViewModel(CommunicationSetup setup)
        {
            m_communicationSetup = setup;
            var outputPath = this.m_communicationSetup.SelectedPath;

            LeonWriter.RegisterMinnePath(outputPath);
        }
Esempio n. 2
0
        private void RegisterResults(int uptoTeamNumber)
        {
            if (this.Leon == null || this.OrionResultViewModel == null || this.MainOrionViewModel == null)
            {
                return;
            }

            var toBeRegistered = Leon.LeonPersons.Where(l => l.Team <= uptoTeamNumber).Select(l => l.ShooterId).ToList();

            if (toBeRegistered != null && toBeRegistered.Any())
            {
                if (m_minneViewModel != null && m_minneViewModel.MinneRegistrations != null)
                {
                    LeonWriter.WriteLeonResults(
                        toBeRegistered,
                        this.OrionResultViewModel.OrionResults,
                        this.MainOrionViewModel,
                        this.Leon.LeonPersons,
                        this.m_minneViewModel.MinneRegistrations);
                }
                else
                {
                    LeonWriter.WriteLeonResults(
                        toBeRegistered,
                        this.OrionResultViewModel.OrionResults,
                        this.MainOrionViewModel,
                        this.Leon.LeonPersons,
                        null);
                }
            }
        }
Esempio n. 3
0
        private void InitGet()
        {
            var path          = this.m_communicationSetup.SelectedPath;
            var registrations = this.GetNewRegistrations(path);

            if (registrations != null && registrations.Any())
            {
                this.AddNewRegistrations(registrations, true);
            }

            LeonWriter.CheckTmpFile(path, true);
        }
Esempio n. 4
0
        void OrionResultViewModel_NewOrionResults(object sender, Orion.OrionResultsEventArgs e)
        {
            var        newResults = e.NewResults;
            List <int> finishedShooters;
            var        updatedRegistrations = m_orionResultUpdater.GetUpdatedRegistrationsAfterResultRegistration(
                newResults,
                this.OrionTeamsSetupViewModel.OrionRegistrations,
                this.OrionResultViewModel.OrionResults,
                out finishedShooters);

            if (finishedShooters.Any())
            {
                var finishedPersons       = Leon.LeonPersons.Where(l => finishedShooters.Contains(l.ShooterId));
                var maxTeamNumber         = finishedPersons.Max(f => f.Team);
                var shouldBeFinished      = Leon.LeonPersons.Where(l => l.Team <= maxTeamNumber).Select(l => l.ShooterId);
                var finishedRegistrations =
                    DatabaseApi.LoadCompetitionFromTable(TableName.FinishedShooter).OfType <FinishedPerson>().Select(f => f.ShooterId);
                var missingPersons = shouldBeFinished.Except(finishedRegistrations).Except(finishedShooters);
                finishedShooters.AddRange(missingPersons);
            }

            this.OrionCommunicationViewModel.UpdateChangesToOrion(updatedRegistrations);
            this.OrionResultViewModel.AddNewRegistrations(newResults);

            if (finishedShooters != null && finishedShooters.Any())
            {
                if (m_minneViewModel != null && m_minneViewModel.MinneRegistrations != null)
                {
                    LeonWriter.WriteLeonResults(
                        finishedShooters,
                        this.OrionResultViewModel.OrionResults,
                        this.MainOrionViewModel,
                        this.Leon.LeonPersons,
                        this.m_minneViewModel.MinneRegistrations);
                }
                else
                {
                    LeonWriter.WriteLeonResults(
                        finishedShooters,
                        this.OrionResultViewModel.OrionResults,
                        this.MainOrionViewModel,
                        this.Leon.LeonPersons,
                        null);
                }
            }
        }
Esempio n. 5
0
        private void InitGet()
        {
            var outputPath = CommunicationSetup.SelectedPath;

            if (NewLeonRegistrations != null)
            {
                var registrations = this.GetNewRegistrations(outputPath);
                if (registrations != null && registrations.Any())
                {
                    var args = new LeonEventArgs {
                        NewRegistrations = registrations
                    };
                    NewLeonRegistrations(this, args);
                }
            }

            LeonWriter.CheckAnyTempFiles(outputPath, "LeonTmp", "MinneLeonTemp");
        }
Esempio n. 6
0
        private void InitGet()
        {
            var path = CommunicationSetup.SelectedPath;

            if (NewLeonRegistrations != null)
            {
                var registrations = this.GetNewRegistrations(path);
                if (registrations != null && registrations.Any())
                {
                    var args = new LeonEventArgs {
                        NewRegistrations = registrations
                    };
                    NewLeonRegistrations(this, args);
                }
            }

            LeonWriter.CheckTmpFile(path);
        }