private void method_0(object sender, RoutedEventArgs e) { this.MySurveyId = SurveyHelper.SurveyID; this.CurPageId = SurveyHelper.NavCurPage; SurveyHelper.PageStartTime = DateTime.Now; this.txtSurvey.Text = this.MySurveyId; this.btnNav.Content = this.btnNav_Content; this.oQuestion.Init(this.CurPageId, 0, false); this.MyNav.GroupLevel = this.oQuestion.QDefine.GROUP_LEVEL; if (this.MyNav.GroupLevel != "") { this.MyNav.GroupPageType = this.oQuestion.QDefine.GROUP_PAGE_TYPE; this.MyNav.GroupCodeA = this.oQuestion.QDefine.GROUP_CODEA; this.MyNav.CircleACurrent = SurveyHelper.CircleACurrent; this.MyNav.CircleACount = SurveyHelper.CircleACount; if (this.MyNav.GroupLevel == "B") { this.MyNav.GroupCodeB = this.oQuestion.QDefine.GROUP_CODEB; this.MyNav.CircleBCurrent = SurveyHelper.CircleBCurrent; this.MyNav.CircleBCount = SurveyHelper.CircleBCount; } this.MyNav.GetCircleInfo(this.MySurveyId); this.oQuestion.QuestionName = this.oQuestion.QuestionName + this.MyNav.QName_Add; List <VEAnswer> list = new List <VEAnswer>(); list.Add(new VEAnswer { QUESTION_NAME = this.MyNav.GroupCodeA, CODE = this.MyNav.CircleACode, CODE_TEXT = this.MyNav.CircleCodeTextA }); SurveyHelper.CircleACode = this.MyNav.CircleACode; SurveyHelper.CircleACodeText = this.MyNav.CircleCodeTextA; SurveyHelper.CircleACurrent = this.MyNav.CircleACurrent; SurveyHelper.CircleACount = this.MyNav.CircleACount; if (this.MyNav.GroupLevel == "B") { list.Add(new VEAnswer { QUESTION_NAME = this.MyNav.GroupCodeB, CODE = this.MyNav.CircleBCode, CODE_TEXT = this.MyNav.CircleCodeTextB }); SurveyHelper.CircleBCode = this.MyNav.CircleBCode; SurveyHelper.CircleBCodeText = this.MyNav.CircleCodeTextB; SurveyHelper.CircleBCurrent = this.MyNav.CircleBCurrent; SurveyHelper.CircleBCount = this.MyNav.CircleBCount; } } else { SurveyHelper.CircleACode = ""; SurveyHelper.CircleACodeText = ""; SurveyHelper.CircleACurrent = 0; SurveyHelper.CircleACount = 0; SurveyHelper.CircleBCode = ""; SurveyHelper.CircleBCodeText = ""; SurveyHelper.CircleBCurrent = 0; SurveyHelper.CircleBCount = 0; this.MyNav.GroupCodeA = ""; this.MyNav.CircleACurrent = 0; this.MyNav.CircleACount = 0; this.MyNav.GroupCodeB = ""; this.MyNav.CircleBCurrent = 0; this.MyNav.CircleBCount = 0; } this.oLogicEngine.SurveyID = this.MySurveyId; if (this.MyNav.GroupLevel != "") { this.oLogicEngine.CircleACode = SurveyHelper.CircleACode; this.oLogicEngine.CircleACodeText = SurveyHelper.CircleACodeText; this.oLogicEngine.CircleACount = SurveyHelper.CircleACount; this.oLogicEngine.CircleACurrent = SurveyHelper.CircleACurrent; this.oLogicEngine.CircleBCode = SurveyHelper.CircleBCode; this.oLogicEngine.CircleBCodeText = SurveyHelper.CircleBCodeText; this.oLogicEngine.CircleBCount = SurveyHelper.CircleBCount; this.oLogicEngine.CircleBCurrent = SurveyHelper.CircleBCurrent; } string show_LOGIC = this.oQuestion.QDefine.SHOW_LOGIC; List <string> list2 = new List <string>(); list2.Add(""); if (show_LOGIC != "") { list2 = this.oBoldTitle.ParaToList(show_LOGIC, "//"); if (list2.Count > 1) { this.oQuestion.QDefine.DETAIL_ID = this.oLogicEngine.Route(list2[1]); } } this.oQuestion.InitDetailID(this.CurPageId, 0); string string_ = this.oQuestion.QDefine.QUESTION_TITLE; List <string> list3 = this.oBoldTitle.ParaToList(string_, "//"); string_ = list3[0]; this.oBoldTitle.SetTextBlock(this.txtQuestionTitle, string_, this.oQuestion.QDefine.TITLE_FONTSIZE, "", true); string_ = ((list3.Count > 1) ? list3[1] : this.oQuestion.QDefine.QUESTION_CONTENT); this.oBoldTitle.SetTextBlock(this.txtCircleTitle, string_, 0, "", true); if (this.oQuestion.QDefine.LIMIT_LOGIC != "") { string[] array = this.oLogicEngine.aryCode(this.oQuestion.QDefine.LIMIT_LOGIC, ','); List <SurveyDetail> list4 = new List <SurveyDetail>(); for (int i = 0; i < array.Count <string>(); i++) { foreach (SurveyDetail surveyDetail in this.oQuestion.QDetails) { if (surveyDetail.CODE == array[i].ToString()) { list4.Add(surveyDetail); break; } } } if (this.oQuestion.QDefine.SHOW_LOGIC == "" && this.oQuestion.QDefine.IS_RANDOM == 0) { list4.Sort(new Comparison <SurveyDetail>(MultipleSearch.Class23.instance.method_0)); } this.oQuestion.QDetails = list4; } if (this.oQuestion.QDefine.PRESET_LOGIC != "") { string[] array2 = this.oLogicEngine.aryCode(this.oQuestion.QDefine.PRESET_LOGIC, ','); for (int j = 0; j < array2.Count <string>(); j++) { using (List <SurveyDetail> .Enumerator enumerator = this.oQuestion.QDetails.GetEnumerator()) { while (enumerator.MoveNext()) { if (enumerator.Current.CODE == array2[j]) { this.listPreSet.Add(array2[j]); break; } } } } } if (this.oQuestion.QDefine.DETAIL_ID.Substring(0, 1) == "#") { for (int k = 0; k < this.oQuestion.QDetails.Count <SurveyDetail>(); k++) { this.oQuestion.QDetails[k].CODE_TEXT = this.oBoldTitle.ReplaceABTitle(this.oQuestion.QDetails[k].CODE_TEXT); } } if (list2[0].Trim() != "") { string[] array3 = this.oLogicEngine.aryCode(list2[0], ','); List <SurveyDetail> list5 = new List <SurveyDetail>(); for (int l = 0; l < array3.Count <string>(); l++) { foreach (SurveyDetail surveyDetail2 in this.oQuestion.QDetails) { if (surveyDetail2.CODE == array3[l].ToString()) { list5.Add(surveyDetail2); break; } } } this.oQuestion.QDetails = list5; } else if (this.oQuestion.QDefine.IS_RANDOM > 0) { this.oQuestion.RandomDetails(); } this.Button_Height = SurveyHelper.BtnHeight; this.Button_FontSize = SurveyHelper.BtnFontSize; this.Button_Width = SurveyHelper.BtnWidth; if (this.oQuestion.QDefine.CONTROL_HEIGHT != 0) { this.Button_Height = this.oQuestion.QDefine.CONTROL_HEIGHT; } if (this.oQuestion.QDefine.CONTROL_WIDTH != 0) { this.Button_Width = this.oQuestion.QDefine.CONTROL_WIDTH; } if (this.oQuestion.QDefine.CONTROL_FONTSIZE != 0) { this.Button_FontSize = this.oQuestion.QDefine.CONTROL_FONTSIZE; } this.ExistTextFill = false; foreach (SurveyDetail surveyDetail3 in this.oQuestion.QDetails) { int is_OTHER = surveyDetail3.IS_OTHER; if (is_OTHER != 1 && is_OTHER != 3 && is_OTHER != 5 && is_OTHER != 11 && is_OTHER != 13) { if (is_OTHER != 14) { continue; } } this.ExistTextFill = true; break; } if (this.ExistTextFill) { this.txtFill.Visibility = Visibility.Visible; if (this.oQuestion.QDefine.NOTE == "") { this.txtFillTitle.Visibility = Visibility.Visible; } else { string_ = this.oQuestion.QDefine.NOTE; list3 = this.oBoldTitle.ParaToList(string_, "//"); string_ = list3[0]; this.oBoldTitle.SetTextBlock(this.txtFillTitle, string_, 0, "", true); if (list3.Count > 1) { string_ = list3[1]; this.oBoldTitle.SetTextBlock(this.txtAfter, string_, 0, "", true); } } } else { this.txtFill.Height = 0.0; this.txtFillTitle.Height = 0.0; this.txtAfter.Height = 0.0; } if (this.oQuestion.QDefine.CONTROL_MASK != "") { string_ = this.oQuestion.QDefine.CONTROL_MASK; this.oBoldTitle.SetTextBlock(this.txtSelectTitle, string_, 0, "", true); } if (this.oQuestion.QDefine.CONTROL_TOOLTIP.Trim() != "") { string_ = this.oQuestion.QDefine.CONTROL_TOOLTIP; this.oBoldTitle.SetTextBlock(this.txtSearchTitle, string_, 0, "", true); } this.oListSource = this.oQuestion.QDetails; this.method_10(); this.txtSearch.Focus(); if (SurveyMsg.FunctionAttachments == "FunctionAttachments_true" && this.oQuestion.QDefine.IS_ATTACH == 1) { this.btnAttach.Visibility = Visibility.Visible; } if (SurveyHelper.AutoFill) { AutoFill autoFill = new AutoFill(); autoFill.oLogicEngine = this.oLogicEngine; List <SurveyDetail> list6 = autoFill.MultiDetail(this.oQuestion.QDefine, this.oQuestion.QDetails, 10); foreach (SurveyDetail surveyDetail4 in list6) { this.txtSelect.Text = surveyDetail4.CODE_TEXT; this.btnSelect_Click(this.btnSelect, new RoutedEventArgs()); } if (this.txtFill.IsEnabled) { this.txtFill.Text = autoFill.CommonOther(this.oQuestion.QDefine, ""); } if (list6.Count > 0 && autoFill.AutoNext(this.oQuestion.QDefine)) { this.btnNav_Click(this, e); } } Style style = (Style)base.FindResource("SelBtnStyle"); Style style2 = (Style)base.FindResource("UnSelBtnStyle"); bool flag = false; string navOperation = SurveyHelper.NavOperation; if (!(navOperation == "Back")) { if (!(navOperation == "Normal")) { if (!(navOperation == "Jump")) { } } else { foreach (string text in this.listPreSet) { if (!this.oQuestion.SelectedValues.Contains(text)) { this.oQuestion.SelectedValues.Add(text); foreach (SurveyDetail surveyDetail5 in this.oQuestion.QDetails) { if (surveyDetail5.CODE == text) { this.method_11(text, surveyDetail5.CODE_TEXT, surveyDetail5.IS_OTHER); int is_OTHER2 = surveyDetail5.IS_OTHER; if (is_OTHER2 != 1 && is_OTHER2 != 3 && is_OTHER2 != 5 && !(is_OTHER2 == 11 | is_OTHER2 == 13)) { if (is_OTHER2 != 14) { break; } } this.listOther.Add(text); flag = true; break; } } } } if (flag) { this.txtFill.IsEnabled = true; this.txtFill.Background = Brushes.White; this.txtFill.Focus(); } if (this.oQuestion.QDetails.Count == 1) { if (this.oQuestion.SelectedValues.Count == 0 && (this.oQuestion.QDefine.EXTEND_1.Contains(SurveyHelper.Only1CodeMode1) || this.oQuestion.QDefine.EXTEND_1.Contains(SurveyHelper.Only1CodeMode2))) { this.ListOption.SelectedValue = this.oQuestion.QDetails[0].CODE_TEXT; this.ListOption_SelectionChanged(this.ListOption, null); this.btnSelect_Click(null, null); } if (this.oQuestion.QDefine.EXTEND_1.Contains(SurveyHelper.Only1CodeMode2)) { if (this.txtFill.IsEnabled) { this.txtFill.Focus(); } else if (!SurveyHelper.AutoFill) { this.btnNav_Click(this, e); } } } if (this.oQuestion.QDefine.EXTEND_1.Contains(SurveyHelper.Only1CodeMode3) && this.oQuestion.SelectedValues.Count > 0) { if (this.txtFill.IsEnabled) { this.txtFill.Focus(); } else if (!SurveyHelper.AutoFill) { this.btnNav_Click(this, e); } } } } else { this.oQuestion.ReadAnswer(this.MySurveyId, SurveyHelper.SurveySequence); foreach (SurveyAnswer surveyAnswer in this.oQuestion.QAnswersRead) { if (this.method_6(surveyAnswer.QUESTION_NAME, 0, (this.oQuestion.QuestionName + "_A").Length) == this.oQuestion.QuestionName + "_A") { this.oQuestion.SelectedValues.Add(surveyAnswer.CODE); using (List <SurveyDetail> .Enumerator enumerator = this.oQuestion.QDetails.GetEnumerator()) { while (enumerator.MoveNext()) { SurveyDetail surveyDetail6 = enumerator.Current; if (surveyDetail6.CODE == surveyAnswer.CODE) { this.method_11(surveyAnswer.CODE, surveyDetail6.CODE_TEXT, surveyDetail6.IS_OTHER); int is_OTHER3 = surveyDetail6.IS_OTHER; if (is_OTHER3 != 1 && is_OTHER3 != 3 && is_OTHER3 != 5 && !(is_OTHER3 == 11 | is_OTHER3 == 13)) { if (is_OTHER3 != 14) { break; } } this.listOther.Add(surveyAnswer.CODE); flag = true; break; } } continue; } } if (this.ExistTextFill && surveyAnswer.QUESTION_NAME == this.oQuestion.QuestionName + "_OTH" && surveyAnswer.CODE != "") { this.txtFill.Text = surveyAnswer.CODE; } } if (flag) { this.txtFill.IsEnabled = true; this.txtFill.Background = Brushes.White; } } new SurveyBiz().ClearPageAnswer(this.MySurveyId, SurveyHelper.SurveySequence); this.SecondsWait = this.oQuestion.QDefine.PAGE_COUNT_DOWN; if (this.SecondsWait > 0) { this.SecondsCountDown = this.SecondsWait; this.btnNav.Foreground = Brushes.Gray; this.btnNav.Content = this.SecondsCountDown.ToString(); this.timer.Interval = TimeSpan.FromMilliseconds(1000.0); this.timer.Tick += this.timer_Tick; this.timer.Start(); } }