public ActionResult DeleteNote(string noteId)
        {
            string userId = User.Identity.GetUserId();
            Note   note;

            try
            {
                note = this.noteService.DeleteNoteById(noteId, userId);
            }
            catch (ValidationException ex)
            {
                ExceptionBindingInMS.AddModelErrors(this.ModelState, ex);
                return(PartialView("_Notes"));
            }

            return(this.GetNotes(note.VideoId));
        }
        public ActionResult AddVideo([Bind(Exclude = "VideoId")] VideoViewModel video)
        {
            string userId      = User.Identity.GetUserId();
            Video  videoEntity = new Video {
                YtId = video.YtId, Title = video.Title, ThumbUrl = video.ThumbNail, CategoryId = video.CategoryId
            };

            try
            {
                this.videoService.AddVideo(videoEntity, userId);
            }
            catch (ValidationException ex)
            {
                ExceptionBindingInMS.AddModelErrors(this.ModelState, ex);
                return(View("_VideosWindow"));
            }

            return(this.GetVideos(videoEntity.CategoryId.ToString()));
        }
        public ActionResult AddCategory([Bind(Exclude = "CategoryId")] CategoryViewModel category)
        {
            string   userId         = User.Identity.GetUserId();
            Category categoryEntity = new Category {
                Name = category.Name, ApplicationUserId = userId
            };

            try
            {
                this.categoryService.AddCategory(categoryEntity);
            }
            catch (ValidationException ex)
            {
                ExceptionBindingInMS.AddModelErrors(this.ModelState, ex);
                return(View("_CategoryList"));
            }


            category.CategoryId = categoryEntity.CategoryId;


            return(PartialView("_Category", category));
        }