/// <summary> /// 活动报名表数据获取 /// </summary> public string getEventApplyQues() { string ReqContent = string.Empty; string content = string.Empty; var respObj = new getEventApplyQuesRespData(); string respStr = string.Empty; try { ReqContent = Request["ReqContent"]; ReqContent = HttpUtility.HtmlDecode(ReqContent); var reqContentObj = ReqContent.DeserializeJSONTo <getEventApplyQuesReqData>(); Loggers.Debug(new DebugLogInfo() { Message = string.Format( "getEventApplyQues ReqContent:{0}", ReqContent) }); var service = new QuestionnaireBLL(Default.GetLoggingSession()); GetResponseParams <QuestionnaireEntity> returnDataObj = service.getEventApplyQues(reqContentObj.special.eventId); // GetResponseParams<QuestionnaireEntity> returnDataObj = service.getEventApplyQues("1"); var contentObj = new getEventApplyQuesRespContentData(); respObj.Code = returnDataObj.Code; respObj.Description = returnDataObj.Description; if (returnDataObj.Flag == "1" && returnDataObj.Params != null) { contentObj.questionCount = Default.ToStr(returnDataObj.Params.QuestionCount); // questions if (returnDataObj.Params.QuesQuestionEntityList != null) { contentObj.questions = new List <getEventApplyQuesRespQuestionData>(); foreach (var tmpQuestion in returnDataObj.Params.QuesQuestionEntityList) { if (tmpQuestion == null) { continue; } var tmpQues = new getEventApplyQuesRespQuestionData(); tmpQues.questionId = Default.ToStr(tmpQuestion.QuestionID); tmpQues.isSaveOutEvent = Default.ToStr(tmpQuestion.IsSaveOutEvent); tmpQues.cookieName = Default.ToStr(tmpQuestion.CookieName); tmpQues.questionText = Default.ToStr(tmpQuestion.QuestionDesc); tmpQues.questionType = Default.ToStr(tmpQuestion.QuestionType); tmpQues.minSelected = Default.ToStr(tmpQuestion.MinSelected); tmpQues.maxSelected = Default.ToStr(tmpQuestion.MaxSelected); tmpQues.isRequired = Default.ToStr(tmpQuestion.IsRequired); tmpQues.isFinished = Default.ToStr(tmpQuestion.IsFinished); // options if (tmpQuestion.QuesOptionEntityList != null) { tmpQues.options = new List <getEventApplyQuesRespOptionData>(); foreach (var tmpOption in tmpQuestion.QuesOptionEntityList) { if (tmpOption == null) { continue; } var tmpOp = new getEventApplyQuesRespOptionData(); tmpOp.optionId = Default.ToStr(tmpOption.OptionsID); tmpOp.optionText = Default.ToStr(tmpOption.OptionsText); tmpOp.isSelected = Default.ToStr(tmpOption.IsSelect); tmpQues.options.Add(tmpOp); } } contentObj.questions.Add(tmpQues); } } } respObj.content = contentObj; Loggers.Debug(new DebugLogInfo() { Message = string.Format( "getEventApplyQues RespContent:{0}", respObj.ToJSON()) }); } catch (Exception ex) { respObj.Code = "103"; respObj.Description = "数据库操作错误"; respObj.Exception = ex.ToString(); } content = respObj.ToJSON(); return(content); }