Ejemplo n.º 1
0
        public async Task <FeedBackDetailsDTO> GetFeedback(Guid id)
        {
            var feedBackDetailsDTO = new FeedBackDetailsDTO();
            var baseBackDetailsDTO = await _context.Feedbacks.FirstOrDefaultAsync(x => x.Id == id);

            if (baseBackDetailsDTO == null)
            {
                return(feedBackDetailsDTO);
            }

            feedBackDetailsDTO.Id      = baseBackDetailsDTO.Id;
            feedBackDetailsDTO.AppId   = baseBackDetailsDTO.AppId;
            feedBackDetailsDTO.AppSort = baseBackDetailsDTO.AppSort;
            feedBackDetailsDTO.Rating  = baseBackDetailsDTO.Rating;
            feedBackDetailsDTO.Comment = baseBackDetailsDTO.Comment;
            feedBackDetailsDTO.IsRated = baseBackDetailsDTO.IsRated;

            if (baseBackDetailsDTO.OrgId != null)
            {
                feedBackDetailsDTO.OrgId = baseBackDetailsDTO.OrgId;
            }

            if (baseBackDetailsDTO.OrgEmployeeId != null)
            {
                feedBackDetailsDTO.OrgEmployeeId = baseBackDetailsDTO.OrgEmployeeId;
            }

            return(feedBackDetailsDTO);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> SetRating(FeedBackDetailsDTO feedback)
        {
            var isHappy = await _feedBackService.CloseFeedback(feedback.Id, feedback.Comment, feedback.Rating);

            if (isHappy)
            {
                return(View("SiteEvaluated"));
            }
            else
            {
                return(NotFound());
            }
        }