Beispiel #1
0
        public ActionResult Contests()
        {
            BootBaronLib.AppSpec.DasKlub.BOL.VideoContest.Contests contests = new Contests();

            contests.GetAll();

            return View(contests);
        }
Beispiel #2
0
        public ActionResult Contests()
        {
            var contests = new Contests();

            contests.GetAll();

            contests.Sort((p1, p2) => p2.BeginDate.CompareTo(p1.BeginDate));

            return View(contests);
        }
Beispiel #3
0
        private static void VideoCount()
        {
            var vids = new Videos();
            var conts = new Contests();
            conts.GetAll();

            int count = 0;
            int totalVids = 0;

            foreach (Contest c1 in conts)
            {
                var cv = new ContestVideo();
                var cvs = new ContestVideos();
                cvs.GetContestVideosForContest(c1.ContestID);
                totalVids += cvs.Count;
                count += (from cv2 in cvs
                    select new Video(cv2.VideoID)
                    into v1
                    let doc = new XmlDocument()
                    select
                        Utilities.GETRequest(
                            new Uri("http://gdata.youtube.com/feeds/api/videos/" + v1.ProviderKey +
                                    @"?v=2&alt=json"))
                    into s
                    where !string.IsNullOrWhiteSpace(s)
                    select (JObject) JsonConvert.DeserializeObject(s)
                    into JObj
                    select JObj["entry"]
                    into entry
                    from thumbnail in entry["yt$statistics"]
                    where !thumbnail.ToString().Contains("fav")
                    select
                        Convert.ToInt32(thumbnail.ToString()
                            .Replace(@"""viewCount"": """, string.Empty)
                            .Replace(@"""", string.Empty))).Sum();
            }
        }
Beispiel #4
0
        private void LoadContests()
        {
            //
            var contests = new Contests();

            contests.GetAll();

            ddlContest.DataSource = contests;
            ddlContest.DataTextField = "name";
            ddlContest.DataValueField = "contestID";
            ddlContest.DataBind();

            ddlContest.Items.Add(new ListItem(unknownValue));

            ddlContest.SelectedValue = unknownValue;
        }