protected void btnSubmit_Click(object sender, EventArgs e)
        {
            //build bcvideo
            BCVideo vid = uvVideo.GetBCVideo();

            //upload the video
            RPCResponse <long> rpcr = bc.CreateVideo(vid, uvVideo.FileName, uvVideo.FileBytes);

            if (rpcr.error.message != null)
            {
                ltlMessage.Text = rpcr.error.code + ": " + rpcr.error.message;
            }
            else
            {
                ltlMessage.Text = "Video Created Successfully with ID: " + rpcr.result.ToString();

                vid.id               = rpcr.result;
                vid.creationDate     = DateTime.Now;
                vid.lastModifiedDate = DateTime.Now;
                vid.publishedDate    = DateTime.Now;

                UpdateInsertPair <VideoItem> a = accountItem.ImportToSitecore(vid, UpdateType.NEW);
            }

            //blank out the other fields after upload
            uvVideo.ClearForm();

            //display the current video and playlist count
            ltlTotalVideos.Text = accountItem.VideoLib.Videos.Count.ToString();
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            //build bcvideo
            BCPlaylist plist = plPlaylist.GetBCPlaylist();

            //upload the video
            RPCResponse <long> rpcr = bc.CreatePlaylist(plist);

            if (rpcr.error.message != null)
            {
                ltlMessage.Text = rpcr.error.code + ": " + rpcr.error.message;
            }
            else
            {
                ltlMessage.Text = "Playlist Created Successfully with ID: " + rpcr.result.ToString();

                plist.id = rpcr.result;
                UpdateInsertPair <PlaylistItem> a = accountItem.ImportToSitecore(plist, UpdateType.NEW);
            }

            //blank out the other fields after upload
            plPlaylist.ClearForm();

            //display the current video and playlist count
            ltlTotalPlaylists.Text = accountItem.PlaylistLib.Playlists.Count.ToString();
        }
Example #3
0
        /// <summary>
        /// This handles syncing the local info with brightcove
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            pnlNewMessage.Visible    = false;
            pnlUpdateMessage.Visible = false;

            UpdateType utype = UpdateType.NEW;

            if (radUpdate.SelectedValue.Equals("update"))
            {
                utype = UpdateType.UPDATE;
            }
            else if (radUpdate.SelectedValue.Equals("both"))
            {
                utype = UpdateType.BOTH;
            }

            //import/update the videos
            List <BCVideo> videos = bc.FindAllVideos().Videos;
            UpdateInsertPair <VideoItem> vidUIP = accountItem.ImportToSitecore(videos, utype);

            //import/update the playlists
            List <BCPlaylist> playlists             = bc.FindAllPlaylists().Playlists;
            UpdateInsertPair <PlaylistItem> playUIP = accountItem.ImportToSitecore(playlists, utype);

            if (utype.Equals(UpdateType.BOTH) || utype.Equals(UpdateType.NEW))
            {
                //show message over how many things changed
                pnlNewMessage.Visible = true;
                ltlNewItem.Text       = vidUIP.NewItems.Count.ToString();
                ltlNewPlaylists.Text  = playUIP.NewItems.Count.ToString();
            }
            if (utype.Equals(UpdateType.BOTH) || utype.Equals(UpdateType.UPDATE))
            {
                pnlUpdateMessage.Visible = true;
                ltlUpdatedItems.Text     = vidUIP.UpdatedItems.Count.ToString();
                ltlUpdatedPlaylists.Text = playUIP.UpdatedItems.Count.ToString();
            }

            //display the current video and playlist count
            ltlTotalPlaylists.Text = accountItem.PlaylistLib.Playlists.Count.ToString();
            ltlTotalVideos.Text    = accountItem.VideoLib.Videos.Count.ToString();
        }
Example #4
0
        /// <summary>
        /// This handles syncing the local info with brightcove
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            pnlUpdateMessage.Visible = true;

            //import/update the video

            BCVideo v = bc.FindVideoById(currentItem.VideoID);
            UpdateInsertPair <VideoItem> vidUIP = accountItem.ImportToSitecore(v, UpdateType.UPDATE);

            //show message over how many things changed
            if (vidUIP.UpdatedItems.Count > 0)
            {
                loadFormWithCurrentValues();
                ltlUpdateMessage.Text = "The settings have been updated from Brightcove.";
            }
            else
            {
                ltlUpdateMessage.Text = "There was a problem updating this video.";
            }
        }