示例#1
0
        public ActionResult OpenFeedbackForm(FrameworxViewModel frameworxViewModel)
        {
            FrameworxFeedbackViewModel frameworxFeedbackViewModel = new FrameworxFeedbackViewModel();

            frameworxFeedbackViewModel.UserEmail   = User.Identity.Name;
            frameworxFeedbackViewModel.UserName    = _commonDbService.FindDisplayNameFromEmail(frameworxFeedbackViewModel.UserEmail);
            frameworxFeedbackViewModel.FrameworxId = frameworxViewModel.id;
            frameworxFeedbackViewModel.FeedBackFor = string.IsNullOrWhiteSpace(frameworxViewModel.Title) ? Constants.InformationNotAvailableText : frameworxViewModel.Title;
            return(PartialView("_FeedbackForm", frameworxFeedbackViewModel));
        }
示例#2
0
        public ActionResult SaveFeedback(FrameworxFeedbackViewModel frameworxFeedbackViewModel)
        {
            if (ModelState.IsValid)
            {
                var userId = _commonDbService.FindUserIdFromEmail(User.Identity.Name);
                if (userId == null)
                {
                    throw new Exception("Error while submiiting feedback");
                }
                frameworxFeedbackViewModel.UserId = userId.Value;
                var newFeedbackDetailsModel = _mapper.Map <FrameworxFeedbackViewModel, FrameworxFeedback>(frameworxFeedbackViewModel);
                //Call service's SaveFeedbackDetails method to save feedback details
                _frameworxFeedbackService.SaveFeedbackDetails(newFeedbackDetailsModel);
                return(Json(true));
            }

            return(Json(false));
        }