private void buttonRemoveImage_Click(object sender, EventArgs e) { if (this.FileActive != null) { DbService.RemoveFileById(this.FileActive.FileId); MessageBox.Show(this.FileActive.Name, "File removed from directory listing."); this.FileActive = null; DisplayService_BindList(); DisplayService_BindPanel(); } }
private void buttonRemove_Click(object sender, EventArgs e) { const string message = "Are you sure that you would like to remove this file?"; const string caption = "File Removal"; var result = MessageBox.Show(message, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { DbService.RemoveFileById(this.FileId); this.Changes = true; this.Dashboard.FileActive = null; this.Close(); } }