Exemplo n.º 1
0
        private void AddToDisplayTable(List <DisplayCourse> listDisplayCourses, int tableIndex)
        {
            var displayTable = new DisplayTable
            {
                Id = tableIndex,
                ListDisplayCourses = listDisplayCourses
            };

            listDisplayTable.Add(displayTable);
        }
Exemplo n.º 2
0
        public static string GetCourseHeader(
            List <DisplayTable> listDisplayTable,
            DisplayTable displayTable,
            DisplayCourse displayCourse)
        {
            if (displayTable.ListDisplayCourses.First() != displayCourse)
            {
                return(displayCourse.CourseId);
            }

            if (displayTable.Id == 1)
            {
                return(displayCourse.CourseId);
            }

            var previousCourse = listDisplayTable.Single(c => c.Id == displayTable.Id - 1).ListDisplayCourses.Last().ListDisplayRows.Last().Course;

            var compare = (displayCourse.CourseId == previousCourse) ? true : false;

            return((compare == true) ? previousCourse + "..." : displayCourse.CourseId);
        }
Exemplo n.º 3
0
        private void DisplayColumns(DisplayTable displayTable)
        {
            html.Append("<div class='col-lg'>");
            html.Append("<table class='table'>");

            foreach (var displayCourse in displayTable.ListDisplayCourses)
            {
                var courseDetails = Shared.GetCourseHeader(_listDisplayTable, displayTable, displayCourse);
                html.Append("<thead>");
                html.Append("<tr class='class-header'>");
                html.Append("<th class='course-header' scope='col'>");
                html.Append(courseDetails);
                html.Append("</th>");

                if (_courseService.IsScoreCourse(displayCourse.CourseId))
                {
                    html.Append("<th scope='col'>#</th>");
                }

                html.Append("<th scope='col'>St</th>");
                html.Append("<th scope='col'>Name</th>");
                html.Append("<th scope='col'>Time</th>");

                if (_courseService.IsScoreCourse(displayCourse.CourseId))
                {
                    html.Append("<th scope='col'>Penalty</th>");
                    html.Append("<th scope='col'>Net Score</th>");
                }
                else
                {
                    html.Append("<th scope='col'>Diff</th>");
                }
                html.Append("</tr>");
                html.Append("</thead>");

                foreach (var item in displayCourse.ListDisplayRows)
                {
                    var classGender = string.Empty;
                    if (Shared.GetGenderFromClass(item.Class) == Constants.CLASS_TYPE_MEN)
                    {
                        classGender = "men";
                    }
                    else
                    {
                        classGender = "women";
                    }

                    html.Append("<tr");
                    html.Append(" class='");
                    html.Append(classGender);
                    html.Append("'");
                    html.Append(">");

                    html.Append("<th scope ='row'>");
                    html.Append(item.Id);
                    html.Append("</th>");

                    if (_courseService.IsScoreCourse(item.Course))
                    {
                        html.Append("<td class='class'>");
                        html.Append(item.ClassCount);
                        html.Append("</td>");
                    }

                    html.Append("<td class='status'>");
                    html.Append("<img src='Images/");
                    html.Append(Shared.GetEnumValue(item.Status));
                    html.Append("-15");
                    html.Append(".png' class='img-responsive'>");
                    html.Append("</td>");

                    html.Append("<td>");
                    html.Append("<img src='Images/");
                    html.Append(Shared.GetClubImage(Convert.ToInt32(item.SI), _competitorService));
                    html.Append("' class='img-responsive mx-auto'>");
                    html.Append(" ");
                    html.Append(item.Name);
                    html.Append("</td>");

                    html.Append("<td class='elapsed-time'>");
                    var elapsedTime = Shared.GetElapsedTime(item.ElapsedTime, item.Status);
                    html.Append(elapsedTime);
                    html.Append("</td>");

                    if (_courseService.IsScoreCourse(displayCourse.CourseId))
                    {
                        html.Append("<td class='penalty'>");
                        html.Append((item.Penalty == 0) ? string.Empty : item.Penalty.ToString());
                        html.Append("</td>");

                        html.Append("<td class='net-score'>");
                        html.Append((item.NetScore == 0) ? string.Empty : item.NetScore.ToString());
                        html.Append("</td>");
                    }
                    else
                    {
                        html.Append("<td class='time-difference'>");
                        html.Append(item.TimeDifference);
                        html.Append("</td>");
                    }

                    html.Append("</tr>");
                }
            }
            html.Append("</table>");
            html.Append("</div>");
        }