Exemple #1
0
        private void LoadFilteredVideos(bool isAjax)
        {
            int? personType = null;
            int? footageType = null;
            int? videoType = null;

            if (!string.IsNullOrEmpty(
             Request.QueryString[SiteEnums.QueryStringNames.videoType.ToString()]))
            {
                videoType = Convert.ToInt32(
                    Request.QueryString[SiteEnums.QueryStringNames.videoType.ToString()]);
            }

            if (!string.IsNullOrEmpty(
            Request.QueryString[SiteEnums.QueryStringNames.personType.ToString()]))
            {
                personType = Convert.ToInt32(
                    Request.QueryString[SiteEnums.QueryStringNames.personType.ToString()]);
            }

            if (!string.IsNullOrEmpty(
            Request.QueryString[SiteEnums.QueryStringNames.footageType.ToString()]))
            {
                footageType = Convert.ToInt32(
                    Request.QueryString[SiteEnums.QueryStringNames.footageType.ToString()]);
            }

            toShow.GetListFilter(videoPageNumber, pageSize, personType, footageType, videoType);

            if(isAjax) return;//this is ajax

            if (videoPageNumber == 1)
            {
                SongRecords sngrcs = new SongRecords();
                SongRecord sngrcd = null;

                foreach (BootBaronLib.AppSpec.DasKlub.BOL.Video vi in toShow)
                {
                    sngrcd = new SongRecord(vi);

                    sngrcs.Add(sngrcd);
                }

                ViewBag.VideosFiltered = sngrcs.VideosPageList();
            }

            MultiProperties addList = null;
            PropertyType propTyp = null;
            MultiProperties mps = null;

            // video types
            propTyp = new PropertyType(SiteEnums.PropertyTypeCode.VIDTP);
            mps = new MultiProperties(propTyp.PropertyTypeID);
            mps.Sort(delegate(MultiProperty p1, MultiProperty p2)
            {
                return p1.DisplayName.CompareTo(p2.DisplayName);
            });

            addList = new MultiProperties();

            foreach (MultiProperty mp1 in mps)
            {
                if (Videos.HasResults(footageType, mp1.MultiPropertyID, personType))
                {
                    addList.Add(mp1);
                }
            }

            ViewBag.VideoTypes = addList;

            // person types
            propTyp = new PropertyType(SiteEnums.PropertyTypeCode.HUMAN);
            mps = new MultiProperties(propTyp.PropertyTypeID);
            mps.Sort(delegate(MultiProperty p1, MultiProperty p2)
            {
                return p1.DisplayName.CompareTo(p2.DisplayName);
            });

            addList = new MultiProperties();

            foreach (MultiProperty mp1 in mps)
            {
                if (Videos.HasResults( footageType, videoType, mp1.MultiPropertyID ))
                {
                    addList.Add(mp1);
                }
            }

            ViewBag.PersonTypes = addList;

            //// footage types
            propTyp = new PropertyType(SiteEnums.PropertyTypeCode.FOOTG);
            mps = new MultiProperties(propTyp.PropertyTypeID);
            mps.Sort(delegate(MultiProperty p1, MultiProperty p2)
            {
                return p1.DisplayName.CompareTo(p2.DisplayName);
            });
            addList = new MultiProperties();

            foreach (MultiProperty mp1 in mps)
            {
                if (Videos.HasResults(footageType, mp1.MultiPropertyID, personType))
                {
                    addList.Add(mp1);
                }
            }

            ViewBag.FootageTypes = addList;
        }
Exemple #2
0
        private bool GetFilteredVideos(bool isAjax, out int? personType, out int? footageType, out int? videoType)
        {
            personType = null;
            footageType = null;
            videoType = null;

            if (!string.IsNullOrEmpty(
                Request.QueryString[SiteEnums.QueryStringNames.videoType.ToString()]))
            {
                videoType = Convert.ToInt32(
                    Request.QueryString[SiteEnums.QueryStringNames.videoType.ToString()]);
            }

            if (!string.IsNullOrEmpty(
                Request.QueryString[SiteEnums.QueryStringNames.personType.ToString()]))
            {
                personType = Convert.ToInt32(
                    Request.QueryString[SiteEnums.QueryStringNames.personType.ToString()]);
            }

            if (!string.IsNullOrEmpty(
                Request.QueryString[SiteEnums.QueryStringNames.footageType.ToString()]))
            {
                footageType = Convert.ToInt32(
                    Request.QueryString[SiteEnums.QueryStringNames.footageType.ToString()]);
            }

            _toShow.GetListFilter(_videoPageNumber, PageSize, personType, footageType, videoType);

            if (isAjax) return true;

            if (_videoPageNumber != 1) return false;

            var sngrcs = new SongRecords();

            sngrcs.AddRange(_toShow.Select(vi => new SongRecord(vi)));

            ViewBag.VideosFiltered = sngrcs.VideosPageList();
            return false;
        }
Exemple #3
0
        public JsonResult Items(int pageNumber)
        {
            videoPageNumber = pageNumber;
            toShow = new BootBaronLib.AppSpec.DasKlub.BOL.Videos();

            LoadFilteredVideos(true);

            SongRecords sngrcs = new SongRecords();
            SongRecord sngrcd = null;

            foreach (BootBaronLib.AppSpec.DasKlub.BOL.Video vi in toShow)
            {
                sngrcd = new SongRecord(vi);
                sngrcs.Add(sngrcd);
            }

            sngrcs.IncludeStateAndEndTag = false;

            return Json(new
            {
                ListItems = sngrcs.VideosPageList()
            });
        }
Exemple #4
0
        public JsonResult Items(int pageNumber)
        {
            _videoPageNumber = pageNumber;
            _toShow = new Videos();

            LoadFilteredVideos(true);

            var sngrcs = new SongRecords();
            sngrcs.AddRange(_toShow.Select(vi => new SongRecord(vi)));

            sngrcs.IncludeStateAndEndTag = false;

            return Json(new
            {
                ListItems = sngrcs.VideosPageList()
            });
        }