Example #1
0
        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";
        }
Example #2
0
        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);
        }
Example #3
0
 public List <ChannelSimple> GetChannelListByLetter(string activeLetter, SortChannelsBy sort)
 {
     return(Channel.GetChannelListByLetter(activeLetter, sort));
 }
Example #4
0
 public PageChannelData GetChannelListByCategoryID(int userID, int categoryID, int startChannelNo, int endChannelNo, SortChannelsBy sortBy)
 {
     return(Channel.GetChannelListByCategoryID(userID, categoryID, startChannelNo, endChannelNo, sortBy));
 }