private void InitiateDeleteVideoMenu() { Console.Clear(); Console.WriteLine( "| Deleting a selected video |\n" + "|___________________________|\n" + "- Enter id of video:"); string input = Console.ReadLine(); if (int.TryParse(input, out int verifiedNumber)) { var video = _videoService.DeleteVideo(verifiedNumber); if (video != null) { Console.Clear(); Console.WriteLine( "| Selected video has been deleted |\n" + "|_________________________________|\n"); printerFunctions.PrintVideo(video); } else { Console.WriteLine("Invalid id, video not found"); } } }
public JsonResult deleteVideo(string VideoID) { FindItemReponse <VideoModel> ConResponse = _videoService.FindVideoByID(VideoID); BaseResponse response = _videoService.DeleteVideo(VideoID); return(Json(new { ErrorCode = response.ErrorCode, Message = response.Message }, JsonRequestBehavior.AllowGet)); }
public async Task <ActionResult> DeleteVideo(int videoId) { using (IVideoService videoService = ServiceCreator.CreateVideoService(Connection)) { await videoService.DeleteVideo(videoId); } return(RedirectToAction("VideoDeleting")); }
public IActionResult Delete(int?id) { var isVideoRemoved = videoService.DeleteVideo(id); if (isVideoRemoved == false) { return(BadRequest()); } return(Json(isVideoRemoved)); }
private void DeleteVideo() { Console.WriteLine("Which video do you want to delete?"); var id = Convert.ToInt32(Console.ReadLine()); var deleteVideo = _videoService.FindVideoById(id); if (_videoService.DeleteVideo(id) != null) { Console.WriteLine("The video was removed"); } else { Console.WriteLine("There is no video with that id"); } Console.ReadLine(); }
public async Task <ActionResult <VideoDataset> > CreateVideo([FromRoute] int cvId, [FromRoute] int sectionId, [FromRoute] int videoId) { VideoDataset video = await _videoService.GetVideoById(videoId); if (video == null) { return(NotFound()); } if (video.CVId != cvId || video.SectionId != sectionId) { return(Forbid()); } if (await _videoService.DeleteVideo(videoId)) { return(NoContent()); } return(BadRequest(new { message = "Deleting video failed" })); }
// DELETE: api/VideoUpload/5 public void Delete(int id) { _videoUploadService.DeleteVideo(id); }
public async Task <IActionResult> OnPostDeleteVideoAsync() { await _videoService.DeleteVideo(Model.Id); return(RedirectToPage("./Manage")); }
public ActionResult Delete(Int64 videoId) { _videoService.DeleteVideo(videoId); return(Content("true")); }