protected void btnDelete_Click(object sender, EventArgs e) { if (EditVideoId > 0) { btnSaveReturn.Visible = false; //btnSaveContinue.Visible = false; btnDelete.Visible = false; lblResults.Visible = true; VIDEO video = MediaVideoMgr.SelectVideoById(EditVideoId); //string filename = Server.MapPath(video.FILE_NAME); int delStatus = MediaVideoMgr.DeleteVideo(EditVideoId, video.FILE_NAME); // delete the task lblResults.Text = "<div style=\"text-align: center; font-weight: bold; padding: 10px;\">"; lblResults.Text += (delStatus == 1) ? Resources.LocalizedText.VideoDeleted : Resources.LocalizedText.VideoErrorDeleting; lblResults.Text += "</div>"; } }
protected void rgFiles_DeleteCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { GridEditableItem item = (GridEditableItem)e.Item; decimal videoId = (decimal)item.GetDataKeyValue("VideoId"); VIDEO video = MediaVideoMgr.SelectVideoById(videoId); //string filename = Server.MapPath(video.FILE_NAME); int status = MediaVideoMgr.DeleteVideo(videoId, video.FILE_NAME); this.GetUploadedFiles(); if (AttachmentEvent != null) { SessionManager.ReturnRecordID = video.VIDEO_ID; SessionManager.ReturnObject = "AddVideo"; SessionManager.ReturnStatus = true; AttachmentEvent("delete"); } }
protected void lbDelete_Click(object sender, EventArgs e) { RadButton lb = (RadButton)sender; decimal videoId = 0; try { videoId = Convert.ToDecimal(lb.CommandArgument.ToString()); } catch { } if (videoId > 0) { //string videoname = Server.MapPath(lb.CommandName.ToString()); int status = MediaVideoMgr.DeleteVideo(videoId, lb.CommandName.ToString()); } SessionManager.ReturnStatus = true; SessionManager.ReturnObject = "DisplayVideos"; SessionManager.ReturnRecordID = 0; }