Пример #1
0
        /// <summary>
        /// Delete playlist from database or changes name of playlist
        /// </summary>
        private void Playlist_Context_Menu_Button_Click(object sender, ToolStripItemClickedEventArgs e)
        {
            MovieDatabaseEntities db = new MovieDatabaseEntities();

            int i     = (int)buttonToBeRemoved.Tag;
            int usrID = getCurrentUserID();
            var usr   = db.Users.SingleOrDefault(o => o.UserID == usrID);

            switch (e.ClickedItem.ToString())
            {
            case "Remove Playlist":
                Remove_Playlist(i, usrID, usr);
                break;

            case "Change name":
                ChangePlaylistNameMessageBox myMessageBox = new ChangePlaylistNameMessageBox();
                myMessageBox.ShowDialog();
                break;
            }
        }
        /// <summary>
        /// Delete playlist from database or changes name of playlist
        /// </summary>
        private void Playlist_Context_Menu_Button_Click(object sender, ToolStripItemClickedEventArgs e)
        {
            MovieDatabaseEntities db = new MovieDatabaseEntities();

            int i = (int)buttonToBeRemoved.Tag;
            int usrID = getCurrentUserID();
            var usr = db.Users.SingleOrDefault(o => o.UserID == usrID);
            switch (e.ClickedItem.ToString())
            {
                case "Remove Playlist":
                        Remove_Playlist(i, usrID, usr);
                        break;

                case "Change name":
                        ChangePlaylistNameMessageBox myMessageBox = new ChangePlaylistNameMessageBox();
                        myMessageBox.ShowDialog();
                        break;

            }
        }