private void DataResults()
        {
            DataTable dt = new DataTable();

            dt = cmpController.GetCompetitionResultsByCompetitionID(CompetitionID);
            DataView dataview = new DataView();

            dataview = dt.AsDataView();
            if (dt.Rows.Count > 0)
            {
                dataview           = dt.AsDataView();
                dataview.RowFilter = "MatchTypeId = 2";
                dataview.Sort      = "StartDate DESC";

                if (dataview.Count > 0)
                {
                    final_Results.Visible = true;
                }
                rptCompetitionResultsFinal.DataSource = dataview;
                rptCompetitionResultsFinal.DataBind();
                final_ResultsMsg.Visible = false;
            }
            else
            {
                final_ResultsMsg.Visible = true;
            }

            if (dt.Rows.Count > 0)
            {
                dataview = dt.AsDataView();

                dataview.RowFilter = "MatchTypeId = 4";
                dataview.Sort      = "StartDate DESC";
                if (dataview.Count > 0)
                {
                    semifinal_Results.Visible = true;
                }
                rptCompetitionResultsSemiFinal.DataSource = dataview;
                rptCompetitionResultsSemiFinal.DataBind();
                semifinal_ResultsMsg.Visible = false;
            }
            else
            {
                semifinal_ResultsMsg.Visible = true;
            }


            if (dt.Rows.Count > 0)
            {
                dataview           = dt.AsDataView();
                dataview.RowFilter = "MatchTypeId = 8";
                dataview.Sort      = "StartDate DESC";

                if (dataview.Count > 0)
                {
                    roundof8_Results.Visible = true;
                }
                rptCompetitionResultsRoundOf8.DataSource = dataview;
                rptCompetitionResultsRoundOf8.DataBind();
                roundof8_ResultsMsg.Visible = false;
            }
            else
            {
                roundof8_ResultsMsg.Visible = true;
            }

            #region For Quater Secondary Round

            if (dt.Rows.Count > 0)
            {
                dataview           = dt.AsDataView();
                dataview.RowFilter = "MatchTypeId = 81";
                dataview.Sort      = "StartDate DESC";

                if (dataview.Count > 0)
                {
                    RoundOf8Secondary_Results.Visible = true;
                }
                rptCompetitionResultsRoundOf8Secondary.DataSource = dataview;
                rptCompetitionResultsRoundOf8Secondary.DataBind();
                RoundOf8Secondary_Results_Msg.Visible = false;
            }
            else
            {
                RoundOf8Secondary_Results_Msg.Visible = true;
            }

            #endregion For Quater Secondary Round


            if (dt.Rows.Count > 0)
            {
                dataview           = dt.AsDataView();
                dataview.RowFilter = "MatchTypeId = 16";
                dataview.Sort      = "StartDate DESC";
                if (dataview.Count > 0)
                {
                    RoundOf16Secondary_Results.Visible = true;
                }
                rptCompetitionResultsRoundOf16.DataSource = dataview;
                rptCompetitionResultsRoundOf16.DataBind();
                RoundOf16Secondary_ResultsMsg.Visible = false;
            }
            else
            {
                RoundOf16Secondary_ResultsMsg.Visible = true;
            }

            if (dt.Rows.Count > 0)
            {
                dataview           = dt.AsDataView();
                dataview.RowFilter = "MatchTypeId = 0";
                dataview.Sort      = "StartDate DESC";
                if (dataview.Count > 0)
                {
                    GroupStage_results.Visible = true;
                }
                rptCompetitionResultsGroupStage.DataSource = dataview;
                rptCompetitionResultsGroupStage.DataBind();
                GroupStage_resultsMsg.Visible = false;
            }

            else
            {
                GroupStage_resultsMsg.Visible = true;
            }
        }
        protected void rptrCompetitionList_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Literal     ltrlTotalGroup   = e.Item.FindControl("ltrlTotalGroup") as Literal;
                Literal     ltrlTotalTeam    = e.Item.FindControl("ltrlTotalTeam") as Literal;
                HiddenField hdnCompId        = e.Item.FindControl("hdnCompId") as HiddenField;
                HyperLink   hlnkCompTitle    = e.Item.FindControl("hlnkCompTitle") as HyperLink;
                HyperLink   comp_group_view  = e.Item.FindControl("comp_group_view") as HyperLink;
                HyperLink   comp_sch_view    = e.Item.FindControl("comp_sch_view") as HyperLink;
                HyperLink   comp_res_view    = e.Item.FindControl("comp_res_view") as HyperLink;
                HyperLink   comp_newslink    = e.Item.FindControl("comp_newslink") as HyperLink;
                HyperLink   comp_videolink   = e.Item.FindControl("comp_videolink") as HyperLink;
                HyperLink   comp_gallerylink = e.Item.FindControl("comp_gallerylink") as HyperLink;


                int cid = 0;
                int.TryParse(hdnCompId.Value, out cid);

                #region For Hyperlink Visibility

                DataTable tbcheckData = new DataTable();

                tbcheckData = cmpController.GetCompetitionFixturesByCompetitionID(cid);

                if (tbcheckData.Rows.Count != 0)
                {
                    comp_sch_view.Visible = true;
                }

                tbcheckData = cmpController.GetCompetitionResultsByCompetitionID(cid);

                if (tbcheckData.Rows.Count != 0)
                {
                    comp_res_view.Visible = true;
                }

                tbcheckData = cmpController.GetCompetitionPointsByCompetitionID(cid);

                if (tbcheckData.Rows.Count != 0)
                {
                    comp_group_view.Visible = true;
                }

                tbcheckData = cmpController.GetCompetitionPhotoByCompetitionID(cid);

                if (tbcheckData.Rows.Count != 0)
                {
                    comp_gallerylink.Visible = true;
                }

                tbcheckData = cmpController.GetCompetitionVideoByCompetitionIDCheck(cid);

                if (tbcheckData.Rows.Count != 0)
                {
                    comp_videolink.Visible = true;
                }

                tbcheckData = cmpController.GetNewsByCompetitionId(cid, PortalId);

                if (tbcheckData.Rows.Count != 0)
                {
                    comp_newslink.Visible = true;
                }

                #endregion For Hyperlink Visibility

                if (hlnkCompTitle != null && cid > 0)
                {
                    hlnkCompTitle.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "conCompetitionAllDetail", "CompetitionID=" + cid);
                }

                if (comp_newslink != null && cid > 0)
                {
                    comp_newslink.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "conCompetitionAllDetail", "CompetitionID=" + cid, "CompTabID=4");
                }

                if (comp_videolink != null && cid > 0)
                {
                    comp_videolink.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "conCompetitionAllDetail", "CompetitionID=" + cid, "CompTabID=5");
                }

                if (comp_gallerylink != null && cid > 0)
                {
                    comp_gallerylink.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "conCompetitionAllDetail", "CompetitionID=" + cid, "CompTabID=6");
                }

                if (comp_group_view != null && cid > 0)
                {
                    comp_group_view.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "conCompetitionAllDetail", "CompetitionID=" + cid, "CompTabID=1");
                }

                if (comp_sch_view != null && cid > 0)
                {
                    comp_sch_view.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "conCompetitionAllDetail", "CompetitionID=" + cid, "CompTabID=2");
                }

                if (comp_res_view != null && cid > 0)
                {
                    comp_res_view.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "conCompetitionAllDetail", "CompetitionID=" + cid, "CompTabID=3");
                }

                StringBuilder sb = new StringBuilder();
                sb.Append("<div class=\"competition-allteam\">");

                if (ltrlTotalTeam.Text == "0" || ltrlTotalTeam.Text == String.Empty)
                {
                    ltrlTotalTeam.Visible = false;
                }
                else
                {
                    ltrlTotalTeam.Text = "Teams : <font color=\"Black\">" + ltrlTotalTeam.Text + "</font>";
                }

                if (ltrlTotalGroup.Text == "0" || ltrlTotalGroup.Text == String.Empty)
                {
                    ltrlTotalGroup.Visible = false;
                    //ltrlGroupText.Visible = false;

                    DataTable dt = cmpController.GetDetailAllTeamCompetitionGroupByCompetitionId(cid);

                    if (dt != null && dt.Rows.Count > 0)
                    {
                        if (dt != null && dt.Rows.Count > 0)
                        {
                            sb.Append("<div class=\"nogroup competition-groupcontainer\">");
                            sb.Append("<ul class=\"competition-group\">");
                            for (int i = 0; i < dt.Rows.Count; i++)
                            {
                                sb.Append("<li class=\"competition-team\">");
                                sb.Append("<a href='" + Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "TeamAllDetail", "TeamID=" + dt.Rows[i]["TeamID"]) + "' >");
                                string imagePath = "/Images/Team_Logo.png";

                                if (dt.Rows[i]["TeamLogo"] != null)
                                {
                                    if (System.IO.File.Exists(Server.MapPath("DesktopModules\\ThSport\\" + dt.Rows[i]["TeamLogo"].ToString())))
                                    {
                                        sb.Append("<img alt=\"\" src=\"\\DesktopModules\\ThSport\\" + dt.Rows[i]["TeamLogo"] + "\" class=\"flag\">");
                                    }
                                    else
                                    {
                                        sb.Append("<img alt=\"\" src=\"\\DesktopModules\\ThSport\\" + imagePath + "\" class=\"flag\">");
                                    }
                                }

                                if (dt.Rows[i]["TeamName"] != null)
                                {
                                    sb.Append("<span class=\"competition-team-name\">" + dt.Rows[i]["TeamName"] + "</span>");
                                }
                                sb.Append("</a>");
                                sb.Append("</li>");
                            }
                            sb.Append("</ul>");
                            sb.Append("</div>");
                        }
                    }
                }
                else
                {
                    ltrlTotalGroup.Text = "Groups: <font color=\"Black\">" + ltrlTotalGroup.Text + "</font>";
                    DataTable dt = cmpController.GetDetailAllTeamCompetitionGroupByCompetitionId(cid);
                    DataView  dv = dt.AsDataView();
                    dv.RowFilter = "CompetitionGroupName IS NOT NULL";
                    dt           = dv.ToTable();
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            if (i == 0)
                            {
                                string groupname = dt.Rows[i]["CompetitionGroupName"] == null ? String.Empty : dt.Rows[i]["CompetitionGroupName"].ToString();
                                sb.Append("<div class=\"competition-groupcontainer\">");
                                sb.Append("<ul class=\"competition-group\">");
                                sb.Append("<li class=\"competition-group-name\">" + dt.Rows[i]["CompetitionGroupName"].ToString() + "</a></li>");
                            }
                            else if (dt.Rows[i]["CompetitionGroupName"].ToString() != dt.Rows[i - 1]["CompetitionGroupName"].ToString())
                            {
                                string groupname = dt.Rows[i]["CompetitionGroupName"] == null ? String.Empty : dt.Rows[i]["CompetitionGroupName"].ToString();
                                sb.Append("</div><div class=\"competition-groupcontainer\">");
                                sb.Append("</ul><ul class=\"competition-group\">");
                                sb.Append("<li class=\"competition-group-name\">" + dt.Rows[i]["CompetitionGroupName"].ToString() + "</li>");
                            }

                            sb.Append("<li class=\"competition-team\">");
                            sb.Append("<a href='" + Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "", "mctl=" + "TeamAllDetail", "TeamID=" + dt.Rows[i]["TeamID"]) + "' >");

                            string imagePath = "/Images/Team_Logo.png";

                            if (dt.Rows[i]["TeamLogo"] != null)
                            {
                                if (System.IO.File.Exists(Server.MapPath("DesktopModules\\ThSport\\" + dt.Rows[i]["TeamLogo"].ToString())))
                                {
                                    sb.Append("<img alt=\"\" src=\"\\DesktopModules\\ThSport\\" + dt.Rows[i]["TeamLogo"] + "\" class=\"flag\">");
                                }
                                else
                                {
                                    sb.Append("<img alt=\"\" src=\"\\DesktopModules\\ThSport\\" + imagePath + "\" class=\"flag\">");
                                }
                            }

                            if (dt.Rows[i]["TeamName"] != null)
                            {
                                sb.Append("<span class=\"competition-team-name\">" + dt.Rows[i]["TeamName"] + "</span>");
                            }
                            sb.Append("</a>");
                            sb.Append("</li>");
                        }

                        sb.Append("</ul>");
                        sb.Append("</div>");
                    }
                }

                sb.Append("</div>");
                Literal ltrlTeams = e.Item.FindControl("ltrlTeams") as Literal;
                ltrlTeams.Text = sb.ToString();
            }
        }