예제 #1
0
 private static async Task<List<MessageItem>> GetMessages(SubEvent item)
 {
                         var messages = await TimingService.GetMessages(item.TimingSystemId.Value);
                         return messages.Select(m => new MessageItem(m)).ToList();
 }
예제 #2
0
        private static async Task<List<StageResult>> GetAllResults(SubEvent ev)
        {
            var results = new List<StageResult>();

            var schedule = await TimingService.GetStageHeaders(ev.TimingSystemId.Value);
            var stageNumber = 0;
            foreach (var item in schedule)
            {
                if (item.IsTarget) continue;
                stageNumber++;

                foreach (var r in await TimingService.GetStage(item.Name, ev.TimingSystemId.Value))
                {
                    if (!r.HasResult) continue;
                    results.Add(new StageResult()
                    {
                        StageNumber = stageNumber,
                        StartNumber = r.StartNumber.GetValueOrDefault(999),
                        ValueSeconds = (decimal)r.Result.TotalSeconds,
                        PenalitySeconds = (decimal)r.Penality.TotalSeconds
                    });
                }
            }
            return results;
        }