Esempio n. 1
0
        public ImportResults DoImport(DataSet ds)
        {
            buildDictionary(ds);

            ImportResults impRes = new ImportResults();

            // Update the points for all participants in the race
            foreach (var rp in _race.GetParticipants())
            {
                string key = string.Format("{0}_{1}", rp.Code, rp.SvId);

                try
                {
                    DataRow row    = _id2row[key];
                    double  points = _partImportUtils.GetPoints(row);
                    rp.Points = points;
                    impRes.AddSuccess();
                }
                catch (KeyNotFoundException)
                {
                    rp.Points = 99999.99;
                    impRes.AddError(string.Format("{0} (SvId: {1}) ist nicht der der Punktedatei. Punkte wurden auf {2:0.00} gesetzt", rp.Fullname, rp.SvId, rp.Points));
                }
                catch (Exception)
                {
                    impRes.AddError();
                }
            }

            return(impRes);
        }
Esempio n. 2
0
        public RaceParticipant ImportRow(DataRow row)
        {
            Participant importedParticipant = _participantImport.ImportRow(row);

            double points = _partImportUtils.GetPoints(row);
            uint   sn     = _partImportUtils.GetStartNumber(row);

            RaceParticipant rp = _race.AddParticipant(importedParticipant, sn, points);

            return(rp);
        }