Exemplo n.º 1
0
        public void AutoFillList_FillWith3Elements()
        {
            var element = AutoFill <TestList> .One();

            Assert.That(element.IntValues, Is.EquivalentTo(new[] { 1, 2, 3 }));
            Assert.That(element.StringValues, Is.EquivalentTo(new[] { "some-string-values0", "some-string-values1", "some-string-values2" }));
        }
Exemplo n.º 2
0
        public static List <AutoFill> Get(string sWebData)
        {
            List <AutoFill> acAutoFillData = new List <AutoFill>();

            try
            {
                // Read data from table
                SQLite sSQLite = SqlReader.ReadTable(sWebData, "autofill");
                if (sSQLite == null)
                {
                    return(acAutoFillData);
                }

                for (int i = 0; i < sSQLite.GetRowCount(); i++)
                {
                    AutoFill aFill = new AutoFill();

                    aFill.sName  = Crypto.GetUTF8(sSQLite.GetValue(i, 0));
                    aFill.sValue = Crypto.GetUTF8(sSQLite.GetValue(i, 1));

                    Counting.AutoFill++;
                    acAutoFillData.Add(aFill);
                }
            }
            catch  { }
            return(acAutoFillData);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Get Autofill values from chromium based browsers
        /// </summary>
        /// <param name="sWebData"></param>
        /// <returns>List with autofill</returns>
        public static List <AutoFill> Get(string sWebData)
        {
            List <AutoFill> acAutoFillData = new List <AutoFill>();

            try
            {
                // Read data from table
                SQLite sSQLite = SqlReader.ReadTable(sWebData, "autofill");
                if (sSQLite == null)
                {
                    return(acAutoFillData);
                }

                for (int i = 0; i < sSQLite.GetRowCount(); i++)
                {
                    AutoFill aFill = new AutoFill();

                    aFill.sName  = Crypto.GetUTF8(sSQLite.GetValue(i, 0));
                    aFill.sValue = Crypto.GetUTF8(sSQLite.GetValue(i, 1));

                    Counter.AutoFill++;
                    acAutoFillData.Add(aFill);
                }
            }
            catch (System.Exception ex) { StormKitty.Logging.Log("Chromium >> Failed collect autofill data\n" + ex); }
            return(acAutoFillData);
        }
Exemplo n.º 4
0
        public void AutoFillObject_ContinueIncrementing()
        {
            var element = AutoFill <TestObjectType> .One();

            Assert.That(element.IntValue, Is.EqualTo(1));
            Assert.That(element.SubObject, Is.Not.Null);
            Assert.That(element.SubObject.SubIntValue, Is.EqualTo(2));
        }
Exemplo n.º 5
0
        public void AutoFillRecursiveObject_StopWhenMaxDepthIsReached()
        {
            var element = AutoFill <TestRecursive> .One(settings : new AutoFillSettings {
                MaxDepth = 1
            });

            Assert.That(element.Recursive.Recursive, Is.Null);
        }
Exemplo n.º 6
0
        public void AutoFill_DoNotFilIgnoredFields()
        {
            var element = AutoFill <TestIgnoring> .One(ignoring : (i) => new { i.Ignored, i.Child.SubIgnored });

            Assert.That(element.Value, Is.EqualTo(1));
            Assert.That(element.Ignored, Is.Null);
            Assert.That(element.Child.SubIgnored, Is.Null);
        }
Exemplo n.º 7
0
        public void AutoFillStringValue_PrefixVariableNameWithSome()
        {
            var element = AutoFill <TestStringClass> .One();

            Assert.That(element.Name, Does.Match("^some-name$"));
            Assert.That(element.Description, Does.Match("^some-description$"));
            Assert.That(element.MultipleWordProperty, Does.Match("^some-multiple-word-property$"));
        }
Exemplo n.º 8
0
        public void AutoFillStringValue_WithRandomFlag_SuffixRandomValue()
        {
            var element = AutoFill <TestStringClass> .One(AutoFillFlags.RandomizeString);

            Assert.That(element.Name, Does.Match("^some-name-([a-f0-9]{16})$"));
            Assert.That(element.Description, Does.Match("^some-description-([a-f0-9]{16})$"));
            Assert.That(element.MultipleWordProperty, Does.Match("^some-multiple-word-property-([a-f0-9]{16})$"));
        }
Exemplo n.º 9
0
 private void addAutoFilter()
 {
     if (IsNumeric(SelectedRegexGroupe))
     {
         AutoFill.Add(new AutoFillModel(this)
         {
             AppendEnd = AppendEnd, AppendFront = AppendFront, RegexFilter = RegexFilter, SettingName = SettingName, SelectedRegexGroupe = Convert.ToInt32(SelectedRegexGroupe), UseRegexFullMatch = UseRegexFullMatch
         });
         mainWindowModel.saveAutoFillJson();
     }
 }
Exemplo n.º 10
0
        public void EditEffect_WhenEffectDoesNotExists_Throw()
        {
            var executionContext  = new NaheulbookExecutionContext();
            var editEffectRequest = AutoFill <EditEffectRequest> .One();

            _effectRepository.GetWithModifiersAsync(Arg.Any <int>())
            .Returns((Effect)null);

            Func <Task> act = () => _effectService.EditEffectAsync(executionContext, 42, editEffectRequest);

            act.Should().Throw <EffectNotFoundException>();
        }
Exemplo n.º 11
0
        public async Task CreateEffect_EnsureThatUserIsAnAdmin_BeforeAddingInDatabase()
        {
            var executionContext    = new NaheulbookExecutionContext();
            var createEffectRequest = AutoFill <CreateEffectRequest> .One();

            await _effectService.CreateEffectAsync(executionContext, 2, createEffectRequest);

            Received.InOrder(() =>
            {
                _authorizationUtil.EnsureAdminAccessAsync(executionContext);
                _unitOfWork.SaveChangesAsync();
            });
        }
Exemplo n.º 12
0
        public async Task CreateEffectType_AddANewEffectTypeInDatabase()
        {
            var createEffectTypeRequest = AutoFill <CreateEffectTypeRequest> .One();

            var effectType = await _effectService.CreateEffectTypeAsync(new NaheulbookExecutionContext(), createEffectTypeRequest);

            Received.InOrder(() =>
            {
                _effectTypeRepository.Add(effectType);
                _unitOfWork.SaveChangesAsync();
            });
            effectType.Name.Should().Be("some-name");
        }
Exemplo n.º 13
0
        public void AutoFillIntegerValues_IncrementByOne()
        {
            var element = AutoFill <TestIntClass> .One();

            Assert.That(element.IntValue, Is.EqualTo(1));
            Assert.That(element.ShortValue, Is.EqualTo(2));
            Assert.That(element.CharValue, Is.EqualTo(3));
            Assert.That(element.LongValue, Is.EqualTo(4));
            Assert.That(element.ByteValue, Is.EqualTo(5));
            Assert.That(element.FloatValue, Is.EqualTo(6));
            Assert.That(element.DoubleValue, Is.EqualTo(7));
            Assert.That(element.DecimalValue, Is.EqualTo(8));
            Assert.That(element.BoolValue, Is.EqualTo(true));
        }
Exemplo n.º 14
0
        private void AddAttributes()
        {
            CssClass += " TxtAutoComplete";
            Attributes.Add("applicationid", ApplicationId.ToString());
            Attributes.Add("connstring", ConnString);

            Attributes.Add("table", SearchTable);
            Attributes.Add("search", SearchField);
            Attributes.Add("display", DisplayField);
            Attributes.Add("delay", Delay.ToString());
            Attributes.Add("minchars", MinChars.ToString());
            Attributes.Add("autofill", AutoFill.ToString());
            Attributes.Add("filters", Filters);
            Attributes.Add("noresultsmessage", NoResultsMessage);
        }
Exemplo n.º 15
0
        public async Task CreateEffectSubCategory_AddANewEffectSubCategoryInDatabase()
        {
            var expectedEffectSubCategory = CreateEffectSubCategory();

            expectedEffectSubCategory.Effects = new List <Effect>();
            var createEffectSubCategoryRequest = AutoFill <CreateEffectSubCategoryRequest> .One();

            var effectSubCategory = await _effectService.CreateEffectSubCategoryAsync(new NaheulbookExecutionContext(), createEffectSubCategoryRequest);

            Received.InOrder(() =>
            {
                _effectSubCategoryRepository.Add(effectSubCategory);
                _unitOfWork.SaveChangesAsync();
            });
            effectSubCategory.Should().BeEquivalentTo(expectedEffectSubCategory);
        }
        public async Task CreateItemTemplateSubCategory_AddANewItemTemplateSubCategoryInDatabase()
        {
            var expectedItemTemplateSubCategory      = CreateItemTemplateSubCategoryAsync();
            var createItemTemplateSubCategoryRequest = AutoFill <CreateItemTemplateSubCategoryRequest> .One(settings : new AutoFillSettings {
                MaxDepth = 0
            });

            var itemTemplateSubCategory = await _itemTemplateSubCategoryService.CreateItemTemplateSubCategoryAsync(new NaheulbookExecutionContext(), createItemTemplateSubCategoryRequest);

            Received.InOrder(() =>
            {
                _itemTemplateSubCategoryRepository.Add(itemTemplateSubCategory);
                _unitOfWork.SaveChangesAsync();
            });
            itemTemplateSubCategory.Should().BeEquivalentTo(expectedItemTemplateSubCategory);
        }
Exemplo n.º 17
0
        public async Task CreateEffect_AddANewEffectInDatabase()
        {
            var expectedEffect      = CreateEffect(subCategoryId: 2);
            var createEffectRequest = AutoFill <CreateEffectRequest> .One();

            var executionContext = new NaheulbookExecutionContext();

            var effect = await _effectService.CreateEffectAsync(executionContext, 2, createEffectRequest);

            Received.InOrder(() =>
            {
                _effectRepository.Add(effect);
                _unitOfWork.SaveChangesAsync();
            });
            effect.Should().BeEquivalentTo(expectedEffect);
        }
        public async Task CreateItemTemplateSection_AddANewItemTemplateSectionInDatabase()
        {
            var expectedItemTemplateSection      = CreateItemTemplateSection();
            var createItemTemplateSectionRequest = AutoFill <CreateItemTemplateSectionRequest> .One(settings : new AutoFillSettings {
                MaxDepth = 0
            });

            var itemTemplateSection = await _service.CreateItemTemplateSectionAsync(new NaheulbookExecutionContext(), createItemTemplateSectionRequest);

            var itemTemplateSectionRepository = _unitOfWorkFactory.GetUnitOfWork().ItemTemplateSections;

            Received.InOrder(() =>
            {
                itemTemplateSectionRepository.Add(itemTemplateSection);
                _unitOfWorkFactory.GetUnitOfWork().SaveChangesAsync();
            });
            itemTemplateSection.Should().BeEquivalentTo(expectedItemTemplateSection);
        }
Exemplo n.º 19
0
        public async Task EditEffect_UpdateEffectInDatabase()
        {
            var expectedEffect   = CreateEffect(42, subCategoryId: 1, offset: 1);
            var executionContext = new NaheulbookExecutionContext();
            var previousEffect   = AutoFill <Effect> .One(AutoFillFlags.RandomizeString | AutoFillFlags.RandomInt, new AutoFillSettings { MaxDepth = 1 }, (i) => new { Category = i.SubCategory });

            var editEffectRequest = AutoFill <EditEffectRequest> .One();

            previousEffect.Id = 42;

            _effectRepository.GetWithModifiersAsync(42)
            .Returns(previousEffect);

            await _effectService.EditEffectAsync(executionContext, 42, editEffectRequest);

            await _unitOfWork.Received(1)
            .SaveChangesAsync();

            previousEffect.Should().BeEquivalentTo(expectedEffect);
        }
Exemplo n.º 20
0
        public async Task EditEffect_EnsureThatUserIsAnAdmin_BeforeAddingInDatabase()
        {
            var executionContext = new NaheulbookExecutionContext();
            var previousEffect   = AutoFill <Effect> .One(AutoFillFlags.RandomizeString | AutoFillFlags.RandomInt);

            var editEffectRequest = AutoFill <EditEffectRequest> .One();

            previousEffect.Id = 42;

            _effectRepository.GetWithModifiersAsync(42)
            .Returns(previousEffect);

            await _effectService.EditEffectAsync(executionContext, 42, editEffectRequest);

            Received.InOrder(() =>
            {
                _authorizationUtil.EnsureAdminAccessAsync(executionContext);
                _unitOfWork.SaveChangesAsync();
            });
        }
Exemplo n.º 21
0
        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);
            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        string_ = this.oQuestion.QDefine.QUESTION_TITLE;
            List <string> list2   = this.oBoldTitle.ParaToList(string_, "//");

            string_ = list2[0];
            this.oBoldTitle.SetTextBlock(this.txtQuestionTitle, string_, this.oQuestion.QDefine.TITLE_FONTSIZE, "", true);
            string_ = ((list2.Count > 1) ? list2[1] : this.oQuestion.QDefine.QUESTION_CONTENT);
            this.oBoldTitle.SetTextBlock(this.txtCircleTitle, string_, 0, "", true);
            if (this.oQuestion.QDefine.CONTROL_TYPE > 0)
            {
                this.txtFill.MaxLength = this.oQuestion.QDefine.CONTROL_TYPE;
            }
            if (this.oQuestion.QDefine.CONTROL_HEIGHT != 0)
            {
                this.txtFill.Height = (double)this.oQuestion.QDefine.CONTROL_HEIGHT;
            }
            if (this.oQuestion.QDefine.CONTROL_WIDTH != 0)
            {
                this.txtFill.Width = (double)this.oQuestion.QDefine.CONTROL_WIDTH;
            }
            if (this.oQuestion.QDefine.CONTROL_FONTSIZE > 0)
            {
                this.txtFill.FontSize = (double)this.oQuestion.QDefine.CONTROL_FONTSIZE;
            }
            if (this.oQuestion.QDefine.PRESET_LOGIC != "")
            {
                this.txtFill.Text = this.oLogicEngine.stringResult(this.oQuestion.QDefine.PRESET_LOGIC);
                this.txtFill.SelectAll();
            }
            this.txtFill.Focus();
            if (this.oQuestion.QDefine.DETAIL_ID != "")
            {
                if (this.oQuestion.QDefine.LIMIT_LOGIC != "")
                {
                    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[]            array = this.oLogicEngine.aryCode(this.oQuestion.QDefine.LIMIT_LOGIC, ',');
                    List <SurveyDetail> list3 = 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())
                            {
                                list3.Add(surveyDetail);
                                break;
                            }
                        }
                    }
                    list3.Sort(new Comparison <SurveyDetail>(FillLong.Class6.instance.method_0));
                    this.oQuestion.QDetails = list3;
                }
                if (this.oQuestion.QDefine.DETAIL_ID.Substring(0, 1) == "#")
                {
                    for (int j = 0; j < this.oQuestion.QDetails.Count <SurveyDetail>(); j++)
                    {
                        this.oQuestion.QDetails[j].CODE_TEXT = this.oBoldTitle.ReplaceABTitle(this.oQuestion.QDetails[j].CODE_TEXT);
                    }
                }
                this.Button_Width    = 280.0;
                this.Button_Height   = SurveyHelper.BtnHeight;
                this.Button_FontSize = SurveyHelper.BtnFontSize;
                this.method_1();
            }
            string_ = this.oQuestion.QDefine.NOTE;
            this.oBoldTitle.SetTextBlock(this.txtQuestionNote, string_, 0, "", true);
            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;
                if (this.txtFill.Text == "")
                {
                    this.txtFill.Text = autoFill.Fill(this.oQuestion.QDefine);
                }
                if (autoFill.AutoNext(this.oQuestion.QDefine))
                {
                    this.btnNav_Click(this, e);
                }
            }
            Style  style        = (Style)base.FindResource("SelBtnStyle");
            string navOperation = SurveyHelper.NavOperation;

            if (!(navOperation == "Back"))
            {
                if (!(navOperation == "Normal"))
                {
                    if (!(navOperation == "Jump"))
                    {
                    }
                }
                else if (this.oQuestion.QDefine.EXTEND_1.Contains(SurveyHelper.Only1CodeMode3) && this.txtFill.Text != "" && !SurveyHelper.AutoFill)
                {
                    this.btnNav_Click(this, e);
                }
            }
            else
            {
                this.txtFill.Text = this.oQuestion.ReadAnswerByQuestionName(this.MySurveyId, this.oQuestion.QuestionName);
            }
            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();
            }
        }
Exemplo n.º 22
0
        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        = (string)this.BtnPhoto.Content;
            this.oQuestion.Init(this.CurPageId, 0);
            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;
            }
            if (SurveyHelper.AutoFill)
            {
                AutoFill autoFill = new AutoFill();
                this.btnNav.Content     = this.btnNav_Content;
                this.oQuestion.FillText = autoFill.Fill(this.oQuestion.QDefine) + ".jpg";
                if (autoFill.AutoNext(this.oQuestion.QDefine))
                {
                    this.btnNav_Click(this, e);
                }
            }
            string question_TITLE = this.oQuestion.QDefine.QUESTION_TITLE;

            this.oBoldTitle.SetTextBlock(this.txtQuestionTitle, question_TITLE, this.oQuestion.QDefine.TITLE_FONTSIZE, "", true);
            if (SurveyMsg.FunctionAttachments == "FunctionAttachments_true" && this.oQuestion.QDefine.IS_ATTACH == 1)
            {
                this.btnAttach.Visibility = Visibility.Visible;
            }
            if (this.cmbList.Items.Count > 0)
            {
                this.cmbList.SelectedIndex = 0;
                this.BtnPhoto.Visibility   = Visibility.Visible;
            }
            else
            {
                this.HaveWebCam = false;
            }
            if (!this.HaveWebCam)
            {
                this.PhotoFileName         = SurveyMsg.MsgNoCamera;
                this.stkWebCam.Visibility  = Visibility.Hidden;
                this.BtnViewPic.Visibility = Visibility.Hidden;
                this.BtnPhoto.Visibility   = Visibility.Hidden;
                this.cmbList.Visibility    = Visibility.Hidden;
                this.txtDevice.Visibility  = Visibility.Hidden;
                MessageBox.Show(SurveyMsg.MsgNoWebCam, SurveyMsg.MsgCaption, MessageBoxButton.OK, MessageBoxImage.Hand);
                this.btnNav.Content = this.btnNav_Content;
            }
            string navOperation = SurveyHelper.NavOperation;

            if (!(navOperation == "Back") && !(navOperation == "Normal"))
            {
                navOperation = "Jump";
            }
            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();
            }
        }
Exemplo n.º 23
0
        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();
            }
        }
Exemplo n.º 24
0
        private void method_2()
        {
            AutoFill autoFill = new AutoFill();

            autoFill.oLogicEngine = this.oLogicEngine;
            Style style       = (Style)base.FindResource("SelBtnStyle");
            Style style2      = (Style)base.FindResource("UnSelBtnStyle");
            Style style3      = (Style)base.FindResource("ContentMediumStyle");
            Brush borderBrush = (Brush)base.FindResource("NormalBorderBrush");
            Brush foreground  = (Brush)base.FindResource("PressedBrush");
            HorizontalAlignment horizontalAlignment = HorizontalAlignment.Right;

            if (this.CL_TA == "C")
            {
                horizontalAlignment = HorizontalAlignment.Center;
            }
            else if (this.CL_TA == "L")
            {
                horizontalAlignment = HorizontalAlignment.Left;
            }
            VerticalAlignment verticalAlignment = VerticalAlignment.Center;

            if (this.CL_VA == "T")
            {
                verticalAlignment = VerticalAlignment.Top;
            }
            else if (this.CL_VA == "B")
            {
                verticalAlignment = VerticalAlignment.Bottom;
            }
            Grid   gridContent = this.GridContent;
            int    num         = 0;
            string text        = this.method_8(this.oQuestion.QDefine.CONTROL_MASK, 1);

            if (text == "#")
            {
                num = 1;
            }
            else if (text.ToUpper() == "G")
            {
                num = 2;
            }
            else if (this.oQuestion.QDefine.CONTROL_MASK != "" && this.oQuestion.QDefine.CONTROL_MASK != null)
            {
                num = 0;
                this.iNoOfInterval = (int)Convert.ToInt16(this.oQuestion.QDefine.CONTROL_MASK.ToString());
                if (this.iNoOfInterval < 1)
                {
                    this.iNoOfInterval = 9999;
                }
            }
            int num2 = 0;
            int num3 = 0;

            foreach (SurveyDetail surveyDetail in this.oQuestion.QCircleDetails)
            {
                string code      = surveyDetail.CODE;
                string code_TEXT = surveyDetail.CODE_TEXT;
                string text2     = "";
                if (SurveyHelper.NavOperation == "Back")
                {
                    string string_ = this.oQuestion.QuestionName + "_R" + code;
                    text2 = this.oQuestion.ReadAnswerByQuestionName(this.MySurveyId, string_);
                }
                gridContent.RowDefinitions.Add(new RowDefinition
                {
                    Height = GridLength.Auto
                });
                Border border = new Border();
                border.BorderThickness = new Thickness(1.0);
                border.BorderBrush     = borderBrush;
                bool flag = false;
                if (num == 1)
                {
                    if (this.oQuestion.QDefine.CONTROL_MASK.Contains("#" + code + "#"))
                    {
                        flag = true;
                    }
                }
                else if (num > 1)
                {
                    if (num3 == 0)
                    {
                        num3 = surveyDetail.RANDOM_SET;
                    }
                    else if (num3 != surveyDetail.RANDOM_SET)
                    {
                        if (num == 2)
                        {
                            num  = 3;
                            flag = true;
                        }
                        else
                        {
                            num = 2;
                        }
                        num3 = surveyDetail.RANDOM_SET;
                    }
                    else if (num == 3)
                    {
                        flag = true;
                    }
                }
                else if (num2 / this.iNoOfInterval % 2 > 0)
                {
                    flag = true;
                }
                if (flag)
                {
                    border.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(this.BackgroudColor));
                }
                border.SetValue(Grid.RowProperty, num2);
                border.SetValue(Grid.ColumnProperty, 0);
                gridContent.Children.Add(border);
                WrapPanel wrapPanel = new WrapPanel();
                wrapPanel.VerticalAlignment   = verticalAlignment;
                wrapPanel.HorizontalAlignment = horizontalAlignment;
                border.Child = wrapPanel;
                TextBlock textBlock = new TextBlock();
                textBlock.Text              = code_TEXT;
                textBlock.Style             = style3;
                textBlock.Foreground        = foreground;
                textBlock.TextWrapping      = TextWrapping.Wrap;
                textBlock.Margin            = new Thickness(5.0, 0.0, 5.0, 0.0);
                textBlock.VerticalAlignment = verticalAlignment;
                if (this.oQuestion.QCircleDefine.CONTROL_FONTSIZE > 0)
                {
                    textBlock.FontSize = (double)this.oQuestion.QCircleDefine.CONTROL_FONTSIZE;
                }
                wrapPanel.Children.Add(textBlock);
                border = new Border();
                border.BorderThickness = new Thickness(1.0);
                border.BorderBrush     = borderBrush;
                border.SetValue(Grid.RowProperty, num2);
                border.SetValue(Grid.ColumnProperty, 1);
                if (flag)
                {
                    border.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(this.BackgroudColor));
                }
                gridContent.Children.Add(border);
                WrapPanel wrapPanel2 = new WrapPanel();
                this.wrapSingle.Add(wrapPanel2);
                wrapPanel2.Orientation         = Orientation.Horizontal;
                wrapPanel2.VerticalAlignment   = VerticalAlignment.Center;
                wrapPanel2.HorizontalAlignment = HorizontalAlignment.Center;
                wrapPanel2.Margin = new Thickness(2.0, 5.0, 2.0, 5.0);
                wrapPanel2.Name   = "wR" + code;
                wrapPanel2.Tag    = code;
                border.Child      = wrapPanel2;
                this.oQuestion.SelectedCode.Add(text2);
                this.listButton = new List <Button>();
                foreach (SurveyDetail surveyDetail2 in this.oQuestion.QDetails)
                {
                    Button button = new Button();
                    button.Name    = "b_" + surveyDetail2.CODE;
                    button.Content = surveyDetail2.CODE_TEXT;
                    button.Margin  = new Thickness(2.0, 0.0, 2.0, 0.0);
                    button.Style   = ((surveyDetail2.CODE == text2) ? style : style2);
                    if (flag)
                    {
                        button.Opacity = 0.85;
                    }
                    button.Tag       = num2;
                    button.Click    += this.method_3;
                    button.FontSize  = (double)this.Button_FontSize;
                    button.MinWidth  = this.Button_Width;
                    button.MinHeight = (double)this.Button_Height;
                    wrapPanel2.Children.Add(button);
                    this.listButton.Add(button);
                }
                int num4 = 0;
                if ((!SurveyHelper.AutoFill || !(SurveyHelper.FillMode == "3")) && SurveyHelper.NavOperation != "Back")
                {
                    string extend_ = surveyDetail.EXTEND_4;
                    if (extend_ != "")
                    {
                        string[] array = this.oLogicEngine.aryCode(extend_, ',');
                        for (int i = 0; i < array.Count <string>(); i++)
                        {
                            using (List <Button> .Enumerator enumerator3 = this.listButton.GetEnumerator())
                            {
                                while (enumerator3.MoveNext())
                                {
                                    Button button2 = enumerator3.Current;
                                    if (button2.Name == "b_" + array[i])
                                    {
                                        num4 = 1;
                                        this.method_3(button2, new RoutedEventArgs());
                                        break;
                                    }
                                }
                                goto IL_876;
                            }
                            break;
                            IL_876 :;
                        }
                    }
                }
                if (num4 == 0 && this.oQuestion.QDetails.Count == 1 && !SurveyHelper.AutoFill && (this.oQuestion.QDefine.EXTEND_1.Contains(SurveyHelper.Only1CodeMode1) || this.oQuestion.QDefine.EXTEND_1.Contains(SurveyHelper.Only1CodeMode2)))
                {
                    this.method_3(this.listButton[0], new RoutedEventArgs());
                }
                if (SurveyHelper.AutoFill)
                {
                    Button button3;
                    if (this.oQuestion.QDefine.CONTROL_TYPE == 0)
                    {
                        button3 = autoFill.SingleButton(this.oQuestion.QDefine, this.listButton);
                    }
                    else
                    {
                        if (this.AutoFillButton == -1)
                        {
                            this.AutoFillButton = Convert.ToInt32(this.oFunc.INT((double)(this.listButton.Count <Button>() / 2), 0, 0, 0));
                        }
                        button3 = this.listButton[this.AutoFillButton];
                    }
                    if (button3 != null && num4 == 0)
                    {
                        this.method_3(button3, new RoutedEventArgs());
                    }
                }
                num2++;
            }
        }
Exemplo n.º 25
0
        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);
            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        string_ = this.oQuestion.QDefine.QUESTION_TITLE;
            List <string> list2   = this.oBoldTitle.ParaToList(string_, "//");

            string_ = list2[0];
            this.oBoldTitle.SetTextBlock(this.txtQuestionTitle, string_, this.oQuestion.QDefine.TITLE_FONTSIZE, "", true);
            string_ = ((list2.Count > 1) ? list2[1] : this.oQuestion.QDefine.QUESTION_CONTENT);
            this.oBoldTitle.SetTextBlock(this.txtCircleTitle, string_, 0, "", true);
            if (this.oQuestion.QDefine.CONTROL_TYPE > 0)
            {
                this.txtFill.MaxLength = this.oQuestion.QDefine.CONTROL_TYPE;
            }
            if (this.oQuestion.QDefine.CONTROL_HEIGHT != 0)
            {
                this.txtFill.Height = (double)this.oQuestion.QDefine.CONTROL_HEIGHT;
            }
            if (this.oQuestion.QDefine.CONTROL_WIDTH != 0)
            {
                this.txtFill.Width = (double)this.oQuestion.QDefine.CONTROL_WIDTH;
            }
            if (this.oQuestion.QDefine.CONTROL_FONTSIZE > 0)
            {
                this.txtFill.FontSize = (double)this.oQuestion.QDefine.CONTROL_FONTSIZE;
            }
            if (this.oQuestion.QDefine.CONTROL_TOOLTIP.Trim() != "")
            {
                string_ = this.oQuestion.QDefine.CONTROL_TOOLTIP;
                list2   = this.oBoldTitle.ParaToList(string_, "//");
                string_ = list2[0];
                this.oBoldTitle.SetTextBlock(this.txtBefore, string_, this.oQuestion.QDefine.CONTROL_FONTSIZE, "", true);
                if (list2.Count > 1)
                {
                    string_ = list2[1];
                    this.oBoldTitle.SetTextBlock(this.txtAfter, string_, this.oQuestion.QDefine.CONTROL_FONTSIZE, "", true);
                }
            }
            if (this.oQuestion.QDefine.PRESET_LOGIC != "")
            {
                this.txtFill.Password = this.oLogicEngine.stringResult(this.oQuestion.QDefine.PRESET_LOGIC);
                this.txtFill.SelectAll();
            }
            this.txtFill.Focus();
            if (this.oQuestion.QDefine.DETAIL_ID != "")
            {
                if (this.oQuestion.QDefine.LIMIT_LOGIC != "")
                {
                    string[]            array = this.oLogicEngine.aryCode(this.oQuestion.QDefine.LIMIT_LOGIC, ',');
                    List <SurveyDetail> list3 = 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())
                            {
                                list3.Add(surveyDetail);
                                break;
                            }
                        }
                    }
                    list3.Sort(new Comparison <SurveyDetail>(FillPassword.Class7.instance.method_0));
                    this.oQuestion.QDetails = list3;
                }
                if (this.oQuestion.QDefine.DETAIL_ID.Substring(0, 1) == "#")
                {
                    for (int j = 0; j < this.oQuestion.QDetails.Count <SurveyDetail>(); j++)
                    {
                        this.oQuestion.QDetails[j].CODE_TEXT = this.oBoldTitle.ReplaceABTitle(this.oQuestion.QDetails[j].CODE_TEXT);
                    }
                }
                this.Button_Width    = (double)SurveyHelper.BtnWidth;
                this.Button_Height   = SurveyHelper.BtnHeight;
                this.Button_FontSize = SurveyHelper.BtnFontSize;
                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 = (double)this.oQuestion.QDefine.CONTROL_WIDTH;
                }
                if (this.oQuestion.QDefine.CONTROL_FONTSIZE != 0)
                {
                    this.Button_FontSize = this.oQuestion.QDefine.CONTROL_FONTSIZE;
                }
                this.method_1();
            }
            if (this.oQuestion.QDefine.NOTE != "")
            {
                string_ = this.oQuestion.QDefine.NOTE;
                list2   = this.oBoldTitle.ParaToList(string_, "//");
                string_ = list2[0];
                this.oBoldTitle.SetTextBlock(this.txtQuestionNote, string_, 0, "", true);
                if (list2.Count > 1)
                {
                    string text = "";
                    int    num  = list2[1].IndexOf(">");
                    if (num > 0)
                    {
                        text = this.method_8(list2[1], num + 1, -9999);
                        num  = this.method_10(this.method_6(list2[1], 1, num - 1));
                    }
                    else
                    {
                        text = list2[1];
                    }
                    if (this.oQuestion.QDefine.GROUP_LEVEL != "" && num > 0)
                    {
                        this.oQuestion.InitCircle();
                        string text2 = "";
                        if (this.MyNav.GroupLevel == "A")
                        {
                            text2 = this.MyNav.CircleACode;
                        }
                        if (this.MyNav.GroupLevel == "B")
                        {
                            text2 = this.MyNav.CircleBCode;
                        }
                        if (text2 != "")
                        {
                            foreach (SurveyDetail surveyDetail2 in this.oQuestion.QCircleDetails)
                            {
                                if (surveyDetail2.CODE == text2)
                                {
                                    text = surveyDetail2.EXTEND_1;
                                    break;
                                }
                            }
                        }
                    }
                    if (text != "")
                    {
                        string text3 = Environment.CurrentDirectory + "\\Media\\" + text;
                        if (this.method_7(text, 1) == "#")
                        {
                            text3 = "..\\Resources\\Pic\\" + this.method_8(text, 1, -9999);
                        }
                        else if (!File.Exists(text3))
                        {
                            text3 = "..\\Resources\\Pic\\" + text;
                        }
                        Image image = new Image();
                        if (num > 0)
                        {
                            image.Height = (double)num;
                        }
                        image.Stretch = Stretch.Uniform;
                        image.Margin  = new Thickness(0.0, 10.0, 20.0, 10.0);
                        image.SetValue(Grid.ColumnProperty, 0);
                        image.SetValue(Grid.RowProperty, 0);
                        image.HorizontalAlignment = HorizontalAlignment.Center;
                        image.VerticalAlignment   = VerticalAlignment.Center;
                        try
                        {
                            BitmapImage bitmapImage = new BitmapImage();
                            bitmapImage.BeginInit();
                            bitmapImage.UriSource = new Uri(text3, UriKind.RelativeOrAbsolute);
                            bitmapImage.EndInit();
                            image.Source = bitmapImage;
                            this.NoteArea.Children.Add(image);
                        }
                        catch (Exception)
                        {
                        }
                    }
                }
            }
            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;
                if (this.txtFill.Password == "")
                {
                    this.txtFill.Password = autoFill.Fill(this.oQuestion.QDefine);
                }
                if (autoFill.AutoNext(this.oQuestion.QDefine))
                {
                    this.btnNav_Click(this, e);
                }
            }
            Style  style        = (Style)base.FindResource("SelBtnStyle");
            string navOperation = SurveyHelper.NavOperation;

            if (!(navOperation == "Back"))
            {
                if (!(navOperation == "Normal"))
                {
                    if (!(navOperation == "Jump"))
                    {
                    }
                }
                else if (this.oQuestion.QDefine.EXTEND_1.Contains(SurveyHelper.Only1CodeMode3) && this.txtFill.Password != "" && !SurveyHelper.AutoFill)
                {
                    this.btnNav_Click(this, e);
                }
            }
            else
            {
                this.txtFill.Password = this.oQuestion.ReadAnswerByQuestionName(this.MySurveyId, this.oQuestion.QuestionName);
            }
            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();
            }
        }
Exemplo n.º 26
0
        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);
            this.MyNav.GroupLevel = this.oQuestion.QDefine.GROUP_LEVEL;
            if (this.MyNav.GroupLevel == "B")
            {
                this.MyNav.GroupLevel     = "A";
                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;
                this.MyNav.GetCircleInfo(this.MySurveyId);
                this.oQuestion.QuestionName       = this.oQuestion.QuestionName + this.MyNav.QName_Add;
                this.oQuestion.CircleQuestionName = ((this.oQuestion.QDefine.GROUP_LEVEL == "A") ? this.oQuestion.QDefine.GROUP_CODEA : this.oQuestion.QDefine.GROUP_CODEB);
                this.oQuestion.CircleQuestionName = this.oQuestion.CircleQuestionName + this.MyNav.QName_Add;
                new List <VEAnswer>().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;
            }
            else
            {
                this.MyNav.GroupLevel        = "";
                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;
            }
            string        string_ = this.oQuestion.QDefine.QUESTION_TITLE;
            List <string> list    = this.oBoldTitle.ParaToList(string_, "//");

            string_ = list[0];
            this.oBoldTitle.SetTextBlock(this.txtQuestionTitle, string_, this.oQuestion.QDefine.TITLE_FONTSIZE, "", true);
            string_ = ((list.Count > 1) ? list[1] : this.oQuestion.QDefine.QUESTION_CONTENT);
            this.oBoldTitle.SetTextBlock(this.txtCircleTitle, string_, 0, "", true);
            if (this.oQuestion.QCircleDefine.LIMIT_LOGIC != "")
            {
                string[]            array = this.oLogicEngine.aryCode(this.oQuestion.QCircleDefine.LIMIT_LOGIC, ',');
                List <SurveyDetail> list2 = new List <SurveyDetail>();
                for (int i = 0; i < array.Count <string>(); i++)
                {
                    foreach (SurveyDetail surveyDetail in this.oQuestion.QCircleDetails)
                    {
                        if (surveyDetail.CODE == array[i].ToString())
                        {
                            list2.Add(surveyDetail);
                            break;
                        }
                    }
                }
                this.oQuestion.QCircleDetails = list2;
            }
            if (this.oQuestion.QCircleDefine.DETAIL_ID.Substring(0, 1) == "#")
            {
                for (int j = 0; j < this.oQuestion.QCircleDetails.Count <SurveyDetail>(); j++)
                {
                    this.oQuestion.QCircleDetails[j].CODE_TEXT = this.oBoldTitle.ReplaceABTitle(this.oQuestion.QCircleDetails[j].CODE_TEXT);
                }
            }
            if (this.oQuestion.QDefine.CONTROL_TOOLTIP.Trim() != "")
            {
                string_       = this.oQuestion.QDefine.CONTROL_TOOLTIP;
                list          = this.oBoldTitle.ParaToList(string_, "//");
                this._txtLeft = list[0];
                if (list.Count > 1)
                {
                    this._txtRight = list[1];
                }
            }
            this.Fill_Length = this.oQuestion.QDefine.CONTROL_TYPE;
            if (this.Fill_Length == 0)
            {
                this.Fill_Length = 250;
            }
            this.Fill_Width = 400.0;
            if (this.oQuestion.QCircleDefine.CONTROL_WIDTH != 0)
            {
                this.BrandText_Width = this.oQuestion.QCircleDefine.TITLE_FONTSIZE;
            }
            if (this.oQuestion.QDefine.CONTROL_WIDTH != 0)
            {
                this.Fill_Width = (double)this.oQuestion.QDefine.CONTROL_WIDTH;
            }
            if (this.oQuestion.QDefine.CONTROL_HEIGHT != 0)
            {
                this.Fill_Height = this.oQuestion.QDefine.CONTROL_HEIGHT;
            }
            if (this.oQuestion.QDefine.CONTROL_FONTSIZE != 0)
            {
                this.Fill_FontSize = this.oQuestion.QDefine.CONTROL_FONTSIZE;
            }
            this.method_4();
            this.Button_Type = this.oQuestion.QCircleDefine.CONTROL_TYPE;
            if (this.Button_Type == 0)
            {
                this.Button_Type = 4;
            }
            if (this.oQuestion.QDefine.DETAIL_ID != "")
            {
                if (this.oQuestion.QDefine.LIMIT_LOGIC != "")
                {
                    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[]            array2 = this.oLogicEngine.aryCode(this.oQuestion.QDefine.LIMIT_LOGIC, ',');
                    List <SurveyDetail> list3  = new List <SurveyDetail>();
                    for (int k = 0; k < array2.Count <string>(); k++)
                    {
                        foreach (SurveyDetail surveyDetail2 in this.oQuestion.QDetails)
                        {
                            if (surveyDetail2.CODE == array2[k].ToString())
                            {
                                list3.Add(surveyDetail2);
                                break;
                            }
                        }
                    }
                    list3.Sort(new Comparison <SurveyDetail>(P_AutoNextFill.Class28.instance.method_0));
                    this.oQuestion.QDetails = list3;
                }
                if (this.oQuestion.QDefine.DETAIL_ID.Substring(0, 1) == "#")
                {
                    for (int l = 0; l < this.oQuestion.QDetails.Count <SurveyDetail>(); l++)
                    {
                        this.oQuestion.QDetails[l].CODE_TEXT = this.oBoldTitle.ReplaceABTitle(this.oQuestion.QDetails[l].CODE_TEXT);
                    }
                }
                this.Button_Width    = 200.0;
                this.Button_Height   = SurveyHelper.BtnHeight;
                this.Button_FontSize = SurveyHelper.BtnFontSize;
                if (this.oQuestion.QDefine.CONTROL_HEIGHT != 0)
                {
                    this.Button_Height = this.oQuestion.QCircleDefine.CONTROL_HEIGHT;
                }
                if (this.oQuestion.QDefine.CONTROL_WIDTH != 0)
                {
                    this.Button_Width = (double)this.oQuestion.QCircleDefine.CONTROL_WIDTH;
                }
                if (this.oQuestion.QDefine.CONTROL_FONTSIZE != 0)
                {
                    this.Button_FontSize = this.oQuestion.QCircleDefine.CONTROL_FONTSIZE;
                }
                this.method_2();
            }
            if (this.oQuestion.QDefine.NOTE != "")
            {
                string_ = this.oQuestion.QDefine.NOTE;
                list    = this.oBoldTitle.ParaToList(string_, "//");
                string_ = list[0];
                this.oBoldTitle.SetTextBlock(this.txtQuestionNote, string_, 0, "", true);
            }
            if (SurveyHelper.AutoFill)
            {
                AutoFill autoFill = new AutoFill();
                autoFill.oLogicEngine = this.oLogicEngine;
                if (this.listFills.Count > 0)
                {
                    foreach (TextBox textBox in this.listFills)
                    {
                        if (textBox.Text == "")
                        {
                            textBox.Text = autoFill.FillInt(this.oQuestion.QDefine);
                        }
                    }
                    if (autoFill.AutoNext(this.oQuestion.QDefine))
                    {
                        this.btnNav_Click(this, e);
                    }
                }
            }
            Style  style        = (Style)base.FindResource("SelBtnStyle");
            string navOperation = SurveyHelper.NavOperation;

            if (!(navOperation == "Back") && !(navOperation == "Normal"))
            {
                navOperation = "Jump";
            }
            this.SecondsWait = this.oQuestion.QDefine.PAGE_COUNT_DOWN;
            if (this.SecondsWait > 0)
            {
                this.SecondsCountDown  = this.SecondsWait;
                this.btnNav.Foreground = Brushes.LightGray;
                this.btnNav.Content    = this.SecondsCountDown.ToString();
                this.timer.Interval    = TimeSpan.FromMilliseconds(1000.0);
                this.timer.Tick       += this.timer_Tick;
                this.timer.Start();
            }
            if (this._nLastTextBox > 0)
            {
                if (this.listFills[this._nLastTextBox - 1].Text != "")
                {
                    this.listFills[this._nLastTextBox - 1].Focus();
                }
                else if (this.listFills.Count > 0)
                {
                    this.listFills[0].Focus();
                }
            }
            else if (this.listFills.Count > 0)
            {
                this.listFills[0].Focus();
            }
            this.PageLoaded = true;
        }
Exemplo n.º 27
0
        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);
            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        string_ = this.oQuestion.QDefine.QUESTION_TITLE;
            List <string> list2   = this.oBoldTitle.ParaToList(string_, "//");

            string_ = list2[0];
            this.oBoldTitle.SetTextBlock(this.txtQuestionTitle, string_, this.oQuestion.QDefine.TITLE_FONTSIZE, "", true);
            string_ = ((list2.Count > 1) ? list2[1] : this.oQuestion.QDefine.QUESTION_CONTENT);
            this.oBoldTitle.SetTextBlock(this.txtCircleTitle, string_, 0, "", true);
            if (this.oQuestion.QDefine.CONTROL_TYPE > 0)
            {
                this.txtFill.MaxLength = this.oQuestion.QDefine.CONTROL_TYPE;
            }
            if (this.oQuestion.QDefine.CONTROL_HEIGHT != 0)
            {
                this.txtFill.Height = (double)this.oQuestion.QDefine.CONTROL_HEIGHT;
            }
            if (this.oQuestion.QDefine.CONTROL_WIDTH != 0)
            {
                this.txtFill.Width = (double)this.oQuestion.QDefine.CONTROL_WIDTH;
            }
            if (this.oQuestion.QDefine.CONTROL_FONTSIZE > 0)
            {
                this.txtFill.FontSize = (double)this.oQuestion.QDefine.CONTROL_FONTSIZE;
            }
            if (this.oQuestion.QDefine.CONTROL_TOOLTIP.Trim() != "")
            {
                string_ = this.oQuestion.QDefine.CONTROL_TOOLTIP;
                list2   = this.oBoldTitle.ParaToList(string_, "//");
                string_ = list2[0];
                this.oBoldTitle.SetTextBlock(this.txtBefore, string_, this.oQuestion.QDefine.CONTROL_FONTSIZE, "", true);
                if (list2.Count > 1)
                {
                    string_ = list2[1];
                    this.oBoldTitle.SetTextBlock(this.txtAfter, string_, this.oQuestion.QDefine.CONTROL_FONTSIZE, "", true);
                }
            }
            if (this.oQuestion.QDefine.PRESET_LOGIC != "")
            {
                this.txtFill.Text = this.oLogicEngine.stringResult(this.oQuestion.QDefine.PRESET_LOGIC);
                this.txtFill.SelectAll();
            }
            this.txtFill.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;
                if (this.txtFill.Text == "")
                {
                    this.txtFill.Text = autoFill.Fill(this.oQuestion.QDefine);
                }
                if (autoFill.AutoNext(this.oQuestion.QDefine))
                {
                    this.SecondsCountDown = 2;
                    this.timer.Interval   = TimeSpan.FromMilliseconds(1000.0);
                    this.timer.Tick      += this.timer_Tick_1;
                    this.timer.Start();
                }
            }
            Style  style        = (Style)base.FindResource("SelBtnStyle");
            string navOperation = SurveyHelper.NavOperation;

            if (!(navOperation == "Back"))
            {
                if (!(navOperation == "Normal"))
                {
                    if (!(navOperation == "Jump"))
                    {
                    }
                }
                else if (this.oQuestion.QDefine.EXTEND_1.Contains(SurveyHelper.Only1CodeMode3) && this.txtFill.Text != "" && !SurveyHelper.AutoFill)
                {
                    this.btnNav_Click(this, e);
                }
            }
            else
            {
                this.txtFill.Text = this.oQuestion.ReadAnswerByQuestionName(this.MySurveyId, this.oQuestion.QuestionName);
                this.lng          = this.oQuestion.ReadAnswerByQuestionName(this.MySurveyId, this.oQuestion.QuestionName + "_MapLng");
                this.lat          = this.oQuestion.ReadAnswerByQuestionName(this.MySurveyId, this.oQuestion.QuestionName + "_MapLat");
            }
            this.SecondsWait = this.oQuestion.QDefine.PAGE_COUNT_DOWN;
            if (this.SecondsWait > 0 && !SurveyHelper.AutoFill)
            {
                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();
            }
            this.PageLoaded = 1;
        }
Exemplo n.º 28
0
        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);
            string text = "";

            if (this.oQuestion.QDefine.CONTROL_TOOLTIP.Trim() != "")
            {
                text = this.oLogicEngine.Route(this.oQuestion.QDefine.CONTROL_TOOLTIP);
            }
            else if (this.oQuestion.QDefine.GROUP_LEVEL != "" && this.oQuestion.QDefine.CONTROL_MASK != "")
            {
                this.oQuestion.InitCircle();
                string text2 = "";
                if (this.MyNav.GroupLevel == "A")
                {
                    text2 = this.MyNav.CircleACode;
                }
                if (this.MyNav.GroupLevel == "B")
                {
                    text2 = this.MyNav.CircleBCode;
                }
                if (text2 != "")
                {
                    foreach (SurveyDetail surveyDetail in this.oQuestion.QCircleDetails)
                    {
                        if (surveyDetail.CODE == text2)
                        {
                            text = this.oLogicEngine.Route(surveyDetail.EXTEND_1);
                            break;
                        }
                    }
                }
            }
            if (text != "")
            {
                string text3 = Environment.CurrentDirectory + "\\Media\\" + text;
                if (this.oFunc.LEFT(text, 1) == "#")
                {
                    text3 = "..\\Resources\\Pic\\" + this.oFunc.MID(text, 1, -9999);
                }
                else if (!File.Exists(text3))
                {
                    text3 = "..\\Resources\\Pic\\" + text;
                }
                Image image = new Image();
                if (!(this.oQuestion.QDefine.CONTROL_MASK == "*") && !(this.oQuestion.QDefine.CONTROL_MASK.Trim() == "") && this.oQuestion.QDefine.CONTROL_MASK != null)
                {
                    string string_2 = this.oQuestion.QDefine.CONTROL_MASK;
                    if (this.oFunc.LEFT(string_2, 1) == "#")
                    {
                        string_2 = this.oFunc.MID(string_2, 1, -9999);
                        this.scrollPic.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
                        this.scrollPic.VerticalScrollBarVisibility   = ScrollBarVisibility.Auto;
                        int num = this.oFunc.StringToInt(string_2);
                        if (num > 0)
                        {
                            this.scrollPic.Width = (double)num;
                        }
                    }
                    else
                    {
                        int num2 = this.oFunc.StringToInt(string_2);
                        if (num2 > 0)
                        {
                            image.Width = (double)num2;
                        }
                    }
                }
                else
                {
                    this.PicWidth.Width    = new GridLength(1.0, GridUnitType.Star);
                    this.ButtonWidth.Width = GridLength.Auto;
                }
                image.Stretch = Stretch.Uniform;
                image.Margin  = new Thickness(0.0, 10.0, 20.0, 10.0);
                image.SetValue(Grid.ColumnProperty, 0);
                image.SetValue(Grid.RowProperty, 0);
                image.HorizontalAlignment = HorizontalAlignment.Center;
                image.VerticalAlignment   = VerticalAlignment.Center;
                try
                {
                    BitmapImage bitmapImage = new BitmapImage();
                    bitmapImage.BeginInit();
                    bitmapImage.UriSource = new Uri(text3, UriKind.RelativeOrAbsolute);
                    bitmapImage.EndInit();
                    image.Source           = bitmapImage;
                    this.scrollPic.Content = image;
                }
                catch (Exception)
                {
                }
            }
            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 surveyDetail2 in this.oQuestion.QDetails)
                    {
                        if (surveyDetail2.CODE == array[i].ToString())
                        {
                            list4.Add(surveyDetail2);
                            break;
                        }
                    }
                }
                if (this.oQuestion.QDefine.SHOW_LOGIC == "" && this.oQuestion.QDefine.IS_RANDOM == 0)
                {
                    list4.Sort(new Comparison <SurveyDetail>(Multiple.Class61.instance.method_0));
                }
                this.oQuestion.QDetails = list4;
            }
            if (this.oQuestion.QDefine.FIX_LOGIC != "")
            {
                string[] array2 = this.oLogicEngine.aryCode(this.oQuestion.QDefine.FIX_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.listFix.Add(array2[j]);
                                break;
                            }
                        }
                    }
                }
            }
            if (this.oQuestion.QDefine.PRESET_LOGIC != "")
            {
                string[] array3 = this.oLogicEngine.aryCode(this.oQuestion.QDefine.PRESET_LOGIC, ',');
                for (int k = 0; k < array3.Count <string>(); k++)
                {
                    using (List <SurveyDetail> .Enumerator enumerator = this.oQuestion.QDetails.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            if (enumerator.Current.CODE == array3[k])
                            {
                                this.listPreSet.Add(array3[k]);
                                break;
                            }
                        }
                    }
                }
            }
            if (this.oQuestion.QDefine.DETAIL_ID.Substring(0, 1) == "#")
            {
                for (int l = 0; l < this.oQuestion.QDetails.Count <SurveyDetail>(); l++)
                {
                    this.oQuestion.QDetails[l].CODE_TEXT = this.oBoldTitle.ReplaceABTitle(this.oQuestion.QDetails[l].CODE_TEXT);
                }
            }
            if (list2[0].Trim() != "")
            {
                string[]            array4 = this.oLogicEngine.aryCode(list2[0], ',');
                List <SurveyDetail> list5  = new List <SurveyDetail>();
                for (int m = 0; m < array4.Count <string>(); m++)
                {
                    foreach (SurveyDetail surveyDetail3 in this.oQuestion.QDetails)
                    {
                        if (surveyDetail3.CODE == array4[m].ToString())
                        {
                            list5.Add(surveyDetail3);
                            break;
                        }
                    }
                }
                this.oQuestion.QDetails = list5;
            }
            else if (this.oQuestion.QDefine.IS_RANDOM > 0)
            {
                this.oQuestion.RandomDetails();
            }
            this.Button_Type     = this.oQuestion.QDefine.CONTROL_TYPE;
            this.Button_FontSize = ((this.oQuestion.QDefine.CONTROL_FONTSIZE == 0) ? SurveyHelper.BtnFontSize : this.oQuestion.QDefine.CONTROL_FONTSIZE);
            if (this.Button_FontSize == -1)
            {
                this.Button_FontSize = -SurveyHelper.BtnFontSize;
            }
            this.Button_FontSize = Math.Abs(this.Button_FontSize);
            this.Button_Height   = ((this.oQuestion.QDefine.CONTROL_HEIGHT == 0) ? SurveyHelper.BtnHeight : this.oQuestion.QDefine.CONTROL_HEIGHT);
            if (this.oQuestion.QDefine.CONTROL_WIDTH == 0)
            {
                if (this.Button_Type != 2)
                {
                    if (this.Button_Type != 4)
                    {
                        this.Button_Width = SurveyHelper.BtnWidth;
                        goto IL_DE3;
                    }
                }
                this.Button_Width = 440;
            }
            else
            {
                this.Button_Width = this.oQuestion.QDefine.CONTROL_WIDTH;
            }
IL_DE3:
            this.method_2();
            if (!this.ExistTextFill && !this.IsFixOther)
            {
                this.txtFill.Height      = 0.0;
                this.txtFillTitle.Height = 0.0;
                this.txtAfter.Height     = 0.0;
            }
            else
            {
                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);
                    }
                }
                if (this.IsFixOther)
                {
                    this.txtFill.IsEnabled  = true;
                    this.txtFill.Background = Brushes.White;
                }
            }
            if (SurveyMsg.FunctionAttachments == "FunctionAttachments_true" && this.oQuestion.QDefine.IS_ATTACH == 1)
            {
                this.btnAttach.Visibility = Visibility.Visible;
            }
            Style  style        = (Style)base.FindResource("SelBtnStyle");
            Style  style2       = (Style)base.FindResource("UnSelBtnStyle");
            bool   flag         = false;
            bool   flag2        = false;
            string navOperation = SurveyHelper.NavOperation;

            if (!(navOperation == "Back"))
            {
                if (!(navOperation == "Normal"))
                {
                    if (!(navOperation == "Jump"))
                    {
                    }
                }
                else
                {
                    foreach (string text4 in this.listPreSet)
                    {
                        if (!this.listFix.Contains(text4))
                        {
                            this.oQuestion.SelectedValues.Add(text4);
                            foreach (Button button in this.listBtnNormal)
                            {
                                if (button.Name.Substring(2) == text4)
                                {
                                    button.Style = style;
                                    int num3 = (int)button.Tag;
                                    if (num3 == 1 || num3 == 3 || num3 == 5 || (num3 == 11 | num3 == 13) || num3 == 14)
                                    {
                                        flag = true;
                                    }
                                }
                            }
                        }
                    }
                    if (flag)
                    {
                        this.txtFill.IsEnabled  = true;
                        this.txtFill.Background = Brushes.White;
                    }
                    if (this.oQuestion.QDetails.Count == 1 || this.listBtnNormal.Count == 0)
                    {
                        if (this.listBtnNormal.Count > 0 && (this.oQuestion.QDefine.EXTEND_1.Contains(SurveyHelper.Only1CodeMode1) || this.oQuestion.QDefine.EXTEND_1.Contains(SurveyHelper.Only1CodeMode2)) && this.listBtnNormal[0].Style == style2)
                        {
                            this.method_3(this.listBtnNormal[0], new RoutedEventArgs());
                        }
                        if (this.oQuestion.QDefine.EXTEND_1.Contains(SurveyHelper.Only1CodeMode2))
                        {
                            if (this.txtFill.IsEnabled)
                            {
                                this.txtFill.Focus();
                            }
                            else
                            {
                                flag2 = true;
                            }
                        }
                    }
                    if (this.oQuestion.QDefine.EXTEND_1.Contains(SurveyHelper.Only1CodeMode3) && this.oQuestion.SelectedValues.Count > 0)
                    {
                        if (this.txtFill.IsEnabled)
                        {
                            this.txtFill.Focus();
                        }
                        else
                        {
                            flag2 = true;
                        }
                    }
                    if (SurveyHelper.AutoFill && !flag2)
                    {
                        AutoFill autoFill = new AutoFill();
                        autoFill.oLogicEngine = this.oLogicEngine;
                        this.listButton       = autoFill.MultiButton(this.oQuestion.QDefine, this.listButton, this.listBtnNormal, 0);
                        foreach (Button button2 in this.listButton)
                        {
                            if (button2.Style == style2)
                            {
                                this.method_3(button2, null);
                            }
                        }
                        if (this.txtFill.IsEnabled)
                        {
                            this.txtFill.Text = autoFill.CommonOther(this.oQuestion.QDefine, "");
                        }
                        if (this.listButton.Count > 0 && autoFill.AutoNext(this.oQuestion.QDefine))
                        {
                            flag2 = true;
                        }
                    }
                    if (flag2)
                    {
                        this.btnNav_Click(this, e);
                    }
                }
            }
            else
            {
                this.oQuestion.ReadAnswer(this.MySurveyId, SurveyHelper.SurveySequence);
                foreach (SurveyAnswer surveyAnswer in this.oQuestion.QAnswersRead)
                {
                    if (this.oFunc.MID(surveyAnswer.QUESTION_NAME, 0, (this.oQuestion.QuestionName + "_A").Length) == this.oQuestion.QuestionName + "_A")
                    {
                        if (this.listFix.Contains(surveyAnswer.CODE))
                        {
                            continue;
                        }
                        this.oQuestion.SelectedValues.Add(surveyAnswer.CODE);
                        using (List <Button> .Enumerator enumerator3 = this.listBtnNormal.GetEnumerator())
                        {
                            while (enumerator3.MoveNext())
                            {
                                Button button3 = enumerator3.Current;
                                if (button3.Name.Substring(2) == surveyAnswer.CODE)
                                {
                                    button3.Style = style;
                                    int num4 = (int)button3.Tag;
                                    if (num4 == 1 || num4 == 3 || num4 == 5 || (num4 == 11 | num4 == 13) || num4 == 14)
                                    {
                                        flag = true;
                                    }
                                }
                            }
                            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;
                }
            }
            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();
            }
            this.PageLoaded = true;
        }