Exemplo n.º 1
0
 public ReportWizard(Laps laps, Runners runners)
 {
     _laps = laps;
     _runners = runners;
     InitializeComponent();
     SetDateRange();
 }
Exemplo n.º 2
0
        public void Create(DateTime startDate, DateTime endDate, Laps laps, Runners runners)
        {
            this.startDate = startDate;
            this.endDate   = endDate;

            var relevantLaps = from Lap lap in laps.AsEnumerable()
                               where lap.Time >= startDate && lap.Time <= endDate
                               select lap;

            var barcodeIds = (from Lap row in relevantLaps select row.BarcodeId).Distinct();

            foreach (var id in barcodeIds)
            {
                var matchingRunner = (from Runner runner in runners.AsEnumerable()
                                      where runner.BarcodeId == id
                                      select runner).FirstOrDefault();
                if (matchingRunner != null)
                {
                    var runnerLaps = (from Lap lap in relevantLaps where lap.BarcodeId == id select lap);
                    var row        = CreateNewRow();
                    row.FirstName         = matchingRunner.FirstName.Trim();
                    row.LastName          = matchingRunner.LastName.Trim();
                    row.Grade             = matchingRunner.Grade.Trim();
                    row.TeacherName       = matchingRunner.TeacherName.Trim();
                    row.Laps              = runnerLaps.Count();
                    row.ParticipationDays = (from Lap lap in runnerLaps select lap.Time.Date).Distinct().Count();
                    Rows.Add(row);
                }
            }
        }
Exemplo n.º 3
0
        public void Create(DateTime startDate, DateTime endDate, Laps laps, Runners runners)
        {
            this.startDate = startDate;
            this.endDate = endDate;

            var relevantLaps = from Lap lap in laps.AsEnumerable()
                               where lap.Time >= startDate && lap.Time <= endDate
                               select lap;

            var barcodeIds = (from Lap row in relevantLaps select row.BarcodeId).Distinct();
            foreach (var id in barcodeIds)
            {
                var matchingRunner = (from Runner runner in runners.AsEnumerable()
                                      where runner.BarcodeId == id
                                      select runner).FirstOrDefault();
                if (matchingRunner != null)
                {
                    var runnerLaps = (from Lap lap in relevantLaps where lap.BarcodeId == id select lap);
                    var row = CreateNewRow();
                    row.FirstName = matchingRunner.FirstName.Trim();
                    row.LastName = matchingRunner.LastName.Trim();
                    row.Grade = matchingRunner.Grade.Trim();
                    row.TeacherName = matchingRunner.TeacherName.Trim();
                    row.Laps = runnerLaps.Count();
                    row.ParticipationDays = (from Lap lap in runnerLaps select lap.Time.Date).Distinct().Count();
                    Rows.Add(row);
                }
            }
        }
Exemplo n.º 4
0
 public void Add(Laps lapsToAdd)
 {
     foreach (Lap row in lapsToAdd.Rows)
     {
         if (row.IsNull("BarcodeId")) {
             continue;
         }
         var lap = CreateNewRow();
         lap.Time = row.Time;
         lap.ScannerId = row.ScannerId;
         lap.BarcodeId = row.BarcodeId;
         Rows.Add(lap);
     }
 }
Exemplo n.º 5
0
 public void Add(Laps lapsToAdd)
 {
     foreach (Lap row in lapsToAdd.Rows)
     {
         if (row.IsNull("BarcodeId"))
         {
             continue;
         }
         var lap = CreateNewRow();
         lap.Time      = row.Time;
         lap.ScannerId = row.ScannerId;
         lap.BarcodeId = row.BarcodeId;
         Rows.Add(lap);
     }
 }
Exemplo n.º 6
0
 private void SetLapsDatasource()
 {
     _laps = new Laps();
     _laps.Load(LapsFile);
 }
Exemplo n.º 7
0
 private void SetLapsDatasource()
 {
     _laps = new Laps();
     _laps.Load(LapsFile);
 }
Exemplo n.º 8
0
 public ImportWizard()
 {
     InitializeComponent();
     _laps = new Laps();
     lapsGridView.DataSource = Laps;
 }
Exemplo n.º 9
0
 public ImportWizard()
 {
     InitializeComponent();
     _laps = new Laps();
     lapsGridView.DataSource = Laps;
 }