private void btnDeleteMedia_Click(object sender, EventArgs e) { if (_selectedMedia != null) { DialogResult result = MessageBox.Show("Do you want to delete " + _selectedMedia.MediaTitle, "Delete Media", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { //Delete user in DB int affectedRows = _mediaLogic.DeleteMediaByID(_selectedMedia.MediaID); if (affectedRows > 0) { lbStripStatus.Text = "\"" + _selectedMedia.MediaTitle + "\"" + " has been deleted"; } else { //couldn't find any users of this userID } //Clear out selectedUser _selectedMedia = null; txtSeletedID.Text = ""; txtSeletedTitle.Text = ""; txtSeletedDirector.Text = ""; txtSeletedGenre.Text = ""; txtSeletedLanguage.Text = ""; txtSeletedPublish.Text = ""; txtSeletedBudget.Text = ""; //refresh list RefreshMediaList(); } } }
public int DeleteMediaByID(int ID) { MediaLogic mediaLogic = new MediaLogic(); return(mediaLogic.DeleteMediaByID(ID)); }
public int DeleteMedia(int mediaID) { return(ml.DeleteMediaByID(mediaID)); }