public ActionResult Playlist() { ViewBag.VideoHeight = (Request.Browser.IsMobileDevice) ? 100 : 277; ViewBag.VideoWidth = (Request.Browser.IsMobileDevice) ? 225 : 400; mu = Membership.GetUser(); ua = new UserAccount(Convert.ToInt32(mu.ProviderUserKey)); ViewBag.UserName = ua.UserName; BootBaronLib.AppSpec.DasKlub.BOL.Playlist plyst = new Playlist(); plyst.GetUserPlaylist(ua.UserAccountID); ViewBag.AutoPlay = plyst.AutoPlay; ViewBag.AutoPlayNumber = (plyst.AutoPlay) ? 1 : 0; ViewBag.UserPlaylistID = plyst.PlaylistID; PlaylistVideos plyvids = new PlaylistVideos(); plyvids.GetPlaylistVideosForPlaylist(plyst.PlaylistID); BootBaronLib.AppSpec.DasKlub.BOL.Videos vids = new BootBaronLib.AppSpec.DasKlub.BOL.Videos(); Video vid = null; foreach (PlaylistVideo plv in plyvids) { vid = new Video(plv.VideoID); vids.Add(vid); } SongRecords sngrcs = new SongRecords(); SongRecord sngrcd = null; foreach (BootBaronLib.AppSpec.DasKlub.BOL.Video vi in vids) { sngrcd = new SongRecord(vi); sngrcs.Add(sngrcd); } ViewBag.PlaylistVideos = sngrcs.VideoPlaylist(); return View(); }
public ActionResult Playlist() { ViewBag.VideoHeight = (Request.Browser.IsMobileDevice) ? 100 : 277; ViewBag.VideoWidth = (Request.Browser.IsMobileDevice) ? 225 : 400; if (_mu != null) _ua = new UserAccount(Convert.ToInt32(_mu.ProviderUserKey)); ViewBag.UserName = _ua.UserName; var plyst = new Playlist(); plyst.GetUserPlaylist(_ua.UserAccountID); ViewBag.AutoPlay = plyst.AutoPlay; ViewBag.AutoPlayNumber = (plyst.AutoPlay) ? 1 : 0; ViewBag.UserPlaylistID = plyst.PlaylistID; var plyvids = new PlaylistVideos(); plyvids.GetPlaylistVideosForPlaylist(plyst.PlaylistID); var vids = new Videos(); vids.AddRange(plyvids.Select(plv => new Video(plv.VideoID))); var sngrcs = new SongRecords(); sngrcs.AddRange(vids.Select(vi => new SongRecord(vi))); ViewBag.PlaylistVideos = sngrcs.VideoPlaylist(); return View(); }
public ActionResult ManageVideos() { mu = Membership.GetUser(); UserAccountVideos uavs = new UserAccountVideos(); uavs.GetVideosForUserAccount(Convert.ToInt32(mu.ProviderUserKey), 'U'); if (uavs.Count > 0) { Videos favvids = new Videos(); Video f1 = new Video(); foreach (UserAccountVideo uav1 in uavs) { f1 = new Video(uav1.VideoID); if (f1.IsEnabled) favvids.Add(f1); } SongRecord sng1 = null; SongRecords sngrcds2 = new SongRecords(); foreach (Video v1 in favvids) { sng1 = new SongRecord(v1); sngrcds2.Add(sng1); } sngrcds2.IsUserSelected = true; sngrcds2.EnableChangeOrder = false; ViewBag.UserUploaded = sngrcds2.VideoPlaylist(); } return View(uavs); }
public ActionResult ManageVideos() { var uavs = new UserAccountVideos(); if (_mu != null) uavs.GetVideosForUserAccount(Convert.ToInt32(_mu.ProviderUserKey), 'U'); if (uavs.Count > 0) { var favvids = new Videos(); favvids.AddRange(uavs.Select(uav1 => new Video(uav1.VideoID)).Where(f1 => f1.IsEnabled)); var sngrcds2 = new SongRecords(); sngrcds2.AddRange(favvids.Select(v1 => new SongRecord(v1))); sngrcds2.IsUserSelected = true; sngrcds2.EnableChangeOrder = false; ViewBag.UserUploaded = sngrcds2.VideoPlaylist(); } return View(uavs); }