private static IEnumerable <CRSurveyAnswer> GetQuestionAnswers(PX.SurveyMonkeyReader.SurveyMonkeyReader dataReader, long surveyQuestionId) { SurveyQuestion surveyQuestion; try { surveyQuestion = dataReader.GetSurveyQuestion(surveyQuestionId); } catch (Exception ex) { throw new PXException(ex.Message); } return(surveyQuestion.Answers?.Select(answer => new CRSurveyAnswer { SurveyAnswerID = answer.AnswerID, SurveyLastModified = surveyQuestion.SurveyLastModified, Answer = answer.Answer }).ToList()); }
private static CRSurveyQuestion GetQuestionDetails(PX.SurveyMonkeyReader.SurveyMonkeyReader dataReader, long surveyQuestionId) { SurveyQuestion questionDetails; try { questionDetails = dataReader.GetSurveyQuestion(surveyQuestionId); } catch (Exception ex) { throw new PXException(ex.Message); } var newQuestion = new CRSurveyQuestion { SurveyQuestionID = questionDetails.QuestionID, SurveyLastModified = questionDetails.SurveyLastModified, Question = questionDetails.Question }; return(newQuestion); }