protected void populateChannelGroups() { ServiceInterface server = new ServiceInterface(); cbGroup.Items.Clear(); List<WebChannelGroup> groups=null; if (cbChannelType.SelectedIndex == 1) groups = server.GetTvChannelGroups(); else if (cbChannelType.SelectedIndex == 2) groups = server.GetRadioChannelGroups(); else { cbGroup.Items.Clear(); cbChannel.Items.Clear(); return; } int idx = 0; int allIndex = -1; foreach (WebChannelGroup g in groups) { if (g.name == "All Channels" && allIndex == -1) allIndex = idx; cbGroup.Items.Add(new ListItem(g.name, g.idGroup.ToString())); idx++; } cbGroup.SelectedIndex = allIndex; populateChannels(); }
protected void RefreshTv() { ServiceInterface server = new ServiceInterface(); if (cbTvGroups.Items.Count == 0) { List<WebChannelGroup> tvgroups = server.GetTvChannelGroups(); int i = 0; int index = -1; int allIndex = -1; foreach (WebChannelGroup g in tvgroups) { if (g.name == "All Channels" && allIndex == -1) allIndex = i; if (g.name != "All Channels" && index == -1) index = i; cbTvGroups.Items.Add(new ListItem(g.name, g.idGroup.ToString())); i++; } if (index != -1) cbTvGroups.SelectedIndex = index; else cbTvGroups.SelectedIndex = allIndex; } List<WebMiniEPG> epgs = server.GetTvMiniEPGForGroup(Int32.Parse(cbTvGroups.SelectedValue)); DataTable dt = new DataTable(); dt.Columns.Add("channel", typeof(string)); dt.Columns.Add("now_next", typeof(string)); dt.Columns.Add("idChannel", typeof(int)); dt.Columns.Add("logo", typeof(string)); foreach (WebMiniEPG epg in epgs) { if (epg.idChannel == 0) continue; DataRow row = dt.NewRow(); row["channel"] = epg.name; row["now_next"] = epg.epgNow.startTime.ToShortTimeString() + " - " + epg.epgNow.endTime.ToShortTimeString() + ": <a href=EPGSearch.aspx?title=" + Server.UrlEncode(epg.epgNow.title) + " target=_blank><img border=0 src=\"pics/btnRecurrences.png\" alt=\"Find recurrences\" style=\"margin-right:5px;vertical-align:middle\" title=\"Find recurrences\" /></a>" + GetScraperLink(epg.epgNow.title) + "<br/>" + epg.epgNext.startTime.ToShortTimeString() + " - " + epg.epgNext.endTime.ToShortTimeString() + ": <a href=EPGSearch.aspx?title=" + Server.UrlEncode(epg.epgNext.title) + " target=_blank><img border=0 src=\"pics/btnRecurrences.png\" alt=\"Find recurrences\" style=\"margin-right:5px;vertical-align:middle\" title=\"Find recurrences\" /></a>" + GetScraperLink(epg.epgNext.title); row["idChannel"] = epg.idChannel; row["logo"] = Utils.GetLogoURL(epg.name,true); dt.Rows.Add(row); } gridTv.DataSource = dt; gridTv.DataBind(); int width; int height; Utils.GetThumbDimensions(out width, out height); gridTv.Columns[0].ControlStyle.Width = width; gridTv.Columns[0].ControlStyle.Height = height; LoadStreamingProfiles(cbTvProfiles); }