예제 #1
0
        private void buttonSave_Click(object sender, EventArgs e)
        {
            if (modifyVid.getVideoId() == -1)
            {
                if (bl.updateVideoToChannel(textBoxName.Text, textBoxTags.Text,
                                            textBoxFileName.Text, textBoxPath.Text, textBoxDescription.Text))
                {
                    myChannelView_Load(sender, e);
                    MessageBox.Show("New video: " + textBoxName.Text + " added Successfuly.");
                }
                else
                {
                    MessageBox.Show("Error, Video could not save: are all required fields filled out?");
                }
            }
            else
            {
                if (bl.updateVideoToChannel(textBoxName.Text, textBoxTags.Text,
                                            textBoxFileName.Text, textBoxPath.Text, textBoxDescription.Text, modifyVid.getVideoId()))
                {
                    //update this or requiry the data base to rebuild the channel

                    myChannelView_Load(sender, e);
                    MessageBox.Show("Video: " + modifyVid.getVideoId().ToString() + " Updated");
                }
                else
                {
                    MessageBox.Show("Error, Video could not save: are all required fields filled out?");
                }
            }
        }
예제 #2
0
        //Likes Dislikes Buttons/////////////////////////////////////
        private void checkBoxLike_CheckedChanged(object sender, EventArgs e)
        {
            if (handleChecked)
            {
                handleChecked = false;
                //if 1 like occured unDislike did not occur
                //if 2 like occured unDislike occured
                //if 3 unLike occured
                switch (bl.clickLikeVideo(thisVideo.getVideoId(), thisUser.userId))
                {
                case 1:
                    checkBoxLike.Checked = true;
                    break;

                case 2:
                    checkBoxLike.Checked    = true;
                    checkBoxDislike.Checked = false;
                    break;

                case 3:
                    checkBoxLike.Checked = false;
                    break;
                }
                handleChecked = true;
            }
            labelLikesNum.Text    = thisVideo.getLikes().ToString();
            labelDislikesNum.Text = thisVideo.getDislikes().ToString();
        }
예제 #3
0
        private void buttonModify_Click(object sender, EventArgs e)
        {
            if (!(listBoxVidoes.SelectedIndex == -1))
            {
                modifyVid               = (listBoxVidoes.SelectedItem as video);
                textBoxName.Text        = modifyVid.getName();
                textBoxPath.Text        = modifyVid.getURL();
                textBoxDescription.Text = modifyVid.getDescription();

                textBoxTags.Text   = modifyVid.getTagsString();
                labelVideoId.Text  = "Video ID: " + modifyVid.getVideoId().ToString();
                buttonSave.Enabled = true;
            }
        }