Ejemplo n.º 1
0
        /// <summary>
        /// Print tournament results.
        /// </summary>
        /// <returns>Htmls of result.</returns>
        public String PrintResults()
        {
            HtmlResults htmlResult = new HtmlResults();

            htmlResult.Title = title;

            IEnumerable <KeyValuePair <int, KeyValuePair <double, double> > > places =
                sessionResults.OrderByDescending(result => result.Value.Key);

            int place = 1;

            foreach (KeyValuePair <int, KeyValuePair <double, double> > pair in places)
            {
                int n          = pair.Key;
                int pairNumber = Pairs.GetInternalPairNumber(n);

                if (Pairs.GetPairNames(pairNumber).Length > 0)
                {
                    HtmlResults.Record record = new HtmlResults.Record();

                    record.Place      = place;
                    record.Number     = n;
                    record.Names      = Pairs.GetPairNames(pairNumber);
                    record.Rank       = Pairs.GetPairRank(pairNumber);
                    record.Region     = Pairs.GetPairRegion(pairNumber);
                    record.Correction = sessionMax > 0 && pair.Value.Value != 0 ?
                                        scoringMethod.PrintResult(pair.Value.Value) : "";
                    record.Result = sessionMax > 0 ? scoringMethod.PrintResult(pair.Value.Key) : "";

                    htmlResult.Records.Add(record);
                }

                place++;
            }

            return(htmlResult.print());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Print tournament results.
        /// </summary>
        /// <returns>Htmls of result.</returns>
        public String PrintResults()
        {
            HtmlResults htmlResult = new HtmlResults();

              htmlResult.Title = title;

              IEnumerable<KeyValuePair<int, KeyValuePair<double, double>>> places =
              sessionResults.OrderByDescending(result => result.Value.Key);

              int place = 1;

              foreach (KeyValuePair<int, KeyValuePair<double, double>> pair in places) {
            int n = pair.Key;
            int pairNumber = Pairs.GetInternalPairNumber(n);

            if (Pairs.GetPairNames(pairNumber).Length > 0) {
              HtmlResults.Record record = new HtmlResults.Record();

              record.Place = place;
              record.Number = n;
              record.Names = Pairs.GetPairNames(pairNumber);
              record.Rank = Pairs.GetPairRank(pairNumber);
              record.Region = Pairs.GetPairRegion(pairNumber);
              record.Correction = sessionMax > 0 && pair.Value.Value != 0 ?
              scoringMethod.PrintResult(pair.Value.Value) : "";
              record.Result = sessionMax > 0 ? scoringMethod.PrintResult(pair.Value.Key) : "";

              htmlResult.Records.Add(record);
            }

            place++;
              }

              return htmlResult.print();
        }