Пример #1
0
        public void StartRunning(string eventName, string distance)
        {
            try
            {
                var now = DateTime.Now;
                List <RunnerInfo> runners = new List <RunnerInfo>();
                using (RunnerDataContext db = new RunnerDataContext())
                {
                    runners = db.RunnerInfos.Where(x => x.Event == eventName && x.Distance == distance).ToList();

                    List <RunnerScanDateTime> insertingList = new List <RunnerScanDateTime>();
                    foreach (var runner in runners)
                    {
                        RunnerScanDateTime record = new RunnerScanDateTime()
                        {
                            RunnerIdentification = runner.RunnerBIB,
                            ScannedDateTime      = now
                        };
                        insertingList.Add(record);
                    }

                    db.RunnerScanDateTimes.InsertAllOnSubmit(insertingList);
                    db.SubmitChanges();
                }
                MessageBox.Show($"Start {eventName} {distance} successfully");
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
        }
Пример #2
0
 partial void UpdateRunnerScanDateTime(RunnerScanDateTime instance);
Пример #3
0
 partial void DeleteRunnerScanDateTime(RunnerScanDateTime instance);
Пример #4
0
 partial void InsertRunnerScanDateTime(RunnerScanDateTime instance);