protected void Page_Load(object sender, EventArgs e) { string sortBy = null; if (Request.QueryString["active"] == null) { _activeLetter = "A"; } else { _activeLetter = Request.QueryString["active"]; } if (Request.QueryString["sortBy"] == null) { sortBy = "a"; } else { sortBy = Request.QueryString["sortBy"]; } _sort = TryParseSortChannelsBy(sortBy); GetSortingLinks(); BLClient client = null; // access the DB for most popular channels and bind "most popular" once if (!Page.IsPostBack) { try { client = new BLClient(); MostPopular.DataSource = client.GetChannelMostPopular(); MostPopular.DataBind(); } finally { client.Dispose(); } GetChannels(); } Panel activeLetterPanel = GetActivePanel(_activeLetter); AddSortingInfoToAlphabet(sortBy); activeLetterPanel.CssClass = "ActiveLetter"; }
private string TryParseSortChannelsBy(Type type, string sortBy, out SortChannelsBy sortChannelBy) { try { sortChannelBy = (SortChannelsBy)Enum.Parse(type, sortBy); } catch { sortChannelBy = SortChannelsBy.Alphabetical; return(ErrorWrapper.SendError(sortBy + " cannot be parsed.")); } return(String.Empty); }
public List <ChannelSimple> GetChannelListByLetter(string activeLetter, SortChannelsBy sort) { return(Channel.GetChannelListByLetter(activeLetter, sort)); }
public PageChannelData GetChannelListByCategoryID(int userID, int categoryID, int startChannelNo, int endChannelNo, SortChannelsBy sortBy) { return(Channel.GetChannelListByCategoryID(userID, categoryID, startChannelNo, endChannelNo, sortBy)); }