Пример #1
0
        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");
                }
            }
        }
Пример #2
0
        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));
        }
Пример #3
0
 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));
        }
Пример #5
0
        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();
        }
Пример #6
0
        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" }));
        }
Пример #7
0
 // DELETE: api/VideoUpload/5
 public void Delete(int id)
 {
     _videoUploadService.DeleteVideo(id);
 }
Пример #8
0
        public async Task <IActionResult> OnPostDeleteVideoAsync()
        {
            await _videoService.DeleteVideo(Model.Id);

            return(RedirectToPage("./Manage"));
        }
 public ActionResult Delete(Int64 videoId)
 {
     _videoService.DeleteVideo(videoId);
     return(Content("true"));
 }