Esempio n. 1
0
        public UpdatePointsImport(Race race, Mapping mapping)
        {
            _race            = race;
            _partImportUtils = new ParticipantImportUtils(mapping, _race.GetDataModel().GetParticipantCategories(), null);

            _id2row = new Dictionary <string, DataRow>();
        }
Esempio n. 2
0
        private void loadLocal()
        {
            Dictionary <string, string> dic = new Dictionary <string, string>();

            try
            {
                try
                {
                    _localReader = new FISImportReader(_pathLocal);
                }
                catch (System.IO.IOException)
                {
                    _localReader = null;
                }
            }
            catch (Exception)
            {
                _localReader = null;
            }

            if (_localReader != null)
            {
                _partImportUtils = new ParticipantImportUtils(_localReader.GetMapping(null), _dm.GetParticipantCategories(), new ClassAssignment(_dm.GetParticipantClasses()));
            }
            else
            {
                _partImportUtils = null;
            }

            var handler = DataChanged;

            handler?.Invoke(this, new EventArgs());
        }
Esempio n. 3
0
        private void loadLocal()
        {
            Dictionary <string, string> dic = new Dictionary <string, string>();

            try
            {
                string configJSON = System.IO.File.ReadAllText(_pathLocalDSV);
                Newtonsoft.Json.JsonConvert.PopulateObject(configJSON, dic);

                var stream = new MemoryStream();
                var writer = new StreamWriter(stream);
                writer.Write(dic["Data"]);
                writer.Flush();
                stream.Position = 0;

                try
                {
                    _localReader = new DSVImportReader(new DSVImportReaderStream(stream, dic["UsedDSVList"]));
                }
                catch (System.IO.IOException)
                {
                    _localReader = null;
                }
            }
            catch (Exception)
            {
                _localReader = null;
            }

            if (_localReader != null)
            {
                _partImportUtils = new ParticipantImportUtils(_localReader.Mapping, _dm.GetParticipantCategories(), new ClassAssignment(_dm.GetParticipantClasses()));
            }
            else
            {
                _partImportUtils = null;
            }

            var handler = DataChanged;

            handler?.Invoke(this, new EventArgs());
        }
Esempio n. 4
0
 public RaceImport(Race race, Mapping mapping, ClassAssignment classAssignment = null)
 {
     _race              = race;
     _partImportUtils   = new ParticipantImportUtils(mapping, _race.GetDataModel().GetParticipantCategories(), classAssignment);
     _participantImport = new ParticipantImport(_race.GetDataModel().GetParticipants(), mapping, _race.GetDataModel().GetParticipantCategories(), classAssignment);
 }
Esempio n. 5
0
 public ParticipantImport(IList <Participant> particpants, Mapping mapping, IList <ParticipantCategory> categories, ClassAssignment classAssignment = null)
 {
     _particpants     = particpants;
     _partImportUtils = new ParticipantImportUtils(mapping, categories, classAssignment);
 }