Example #1
0
        public IActionResult DeletePhotoStory(int id)
        {
            var photoStory = photoStoryService.FindPhotoStoryById(id);

            if (photoStory == null)
            {
                return(this.RedirectToAction("Index", "Home"));
            }

            if ((photoStory.PhotographyAddictedUserId == this.User.FindFirstValue(ClaimTypes.NameIdentifier)) ||
                photoStory.PhotographyAddictedUserId != null || this.User.IsInRole("Moderator"))
            {
                return(View(photoStory));
            }

            return(this.RedirectToAction("Index", "Home"));
        }
        public IActionResult AddPhotoStoryComment(int id)
        {
            var isPhotoStoryExist = photoStoryService.FindPhotoStoryById(id);

            if (isPhotoStoryExist == null)
            {
                return(this.RedirectToAction("Index", "Home"));
            }

            var photoStoryComment = new AddPhotoStoryCommentViewModel()
            {
                PhotoStoryId = id,
            };

            return(View(photoStoryComment));
        }