Пример #1
0
        void btn_recog_Click(object sender, EventArgs e)
        {
            switch ((EnumPTests)_testparam.idt)
            {
            case EnumPTests.Adaptability:
                DAnswers da = new DAnswers();
                AnswersFactory.UpdateTestFromAnswers <DAnswers>(da, answers_grid, _testresult, _ge);
                break;

            case EnumPTests.Addictive:
                AAnswers aa = new AAnswers();
                AnswersFactory.UpdateTestFromAnswers <AAnswers>(aa, answers_grid, _testresult, _ge);
                break;

            case EnumPTests.FPI:
                FPIAnswers fa = new FPIAnswers();
                AnswersFactory.UpdateTestFromAnswers <FPIAnswers>(fa, answers_grid, _testresult, _ge);
                break;

            case EnumPTests.KettellA:
                KettellAnswers kaa = new KettellAnswers();
                AnswersFactory.UpdateTestFromAnswers <KettellAnswers>(kaa, answers_grid, _testresult, _ge);
                break;

            case EnumPTests.KettellC:
                KettellAnswers kca = new KettellAnswers();
                AnswersFactory.UpdateTestFromAnswers <KettellAnswers>(kca, answers_grid, _testresult, _ge);
                break;

            case EnumPTests.Leongard:
                LAnswers la = new LAnswers();
                AnswersFactory.UpdateTestFromAnswers <LAnswers>(la, answers_grid, _testresult, _ge);
                break;

            case EnumPTests.Modul2:
                MDAnswers ma = new MDAnswers();
                AnswersFactory.UpdateTestFromAnswers <MDAnswers>(ma, answers_grid, _testresult, _ge);
                break;

            case EnumPTests.NPNA:
                NPNAnswers na = new NPNAnswers();
                AnswersFactory.UpdateTestFromAnswers <NPNAnswers>(na, answers_grid, _testresult, _ge);
                break;

            case EnumPTests.Prognoz:
                PAnswers pa = new PAnswers();
                AnswersFactory.UpdateTestFromAnswers <PAnswers>(pa, answers_grid, _testresult, _ge);
                break;
            }

            this.Close();
        }
Пример #2
0
        private void FillAnswers()
        {
            switch ((EnumPTests)_testparam.idt)
            {
            case EnumPTests.Adaptability:
                DAnswers da = AnswersFactory.GetAnswersFromTestResult <DAnswers>(_testresult);
                Parallel.For(0, da.Count, answerindex =>
                {
                    if (da[answerindex].SelectedCellDescription != "")
                    {
                        answers_grid.CheckAnswerCell(answerindex, da[answerindex].SelectedCellDescription);
                    }
                });
                break;

            case EnumPTests.Addictive:
                AAnswers aa = AnswersFactory.GetAnswersFromTestResult <AAnswers>(_testresult);
                Parallel.For(0, aa.Count, answerindex =>
                {
                    if (aa[answerindex].SelectedCellDescription != "")
                    {
                        answers_grid.CheckAnswerCell(answerindex, aa[answerindex].SelectedCellDescription);
                    }
                });
                break;

            case EnumPTests.FPI:
                FPIAnswers fa = AnswersFactory.GetAnswersFromTestResult <FPIAnswers>(_testresult);
                Parallel.For(0, fa.Count, answerindex =>
                {
                    if (fa[answerindex].SelectedCellDescription != "")
                    {
                        answers_grid.CheckAnswerCell(answerindex, fa[answerindex].SelectedCellDescription);
                    }
                });
                break;

            case EnumPTests.KettellA:
                KettellAnswers kaa = AnswersFactory.GetAnswersFromTestResult <KettellAnswers>(_testresult);
                Parallel.For(0, kaa.Count, answerindex =>
                {
                    if (kaa[answerindex].SelectedCellDescription != "")
                    {
                        answers_grid.CheckAnswerCell(answerindex, kaa[answerindex].SelectedCellDescription);
                    }
                });
                break;

            case EnumPTests.KettellC:
                KettellAnswers kca = AnswersFactory.GetAnswersFromTestResult <KettellAnswers>(_testresult);
                Parallel.For(0, kca.Count, answerindex =>
                {
                    if (kca[answerindex].SelectedCellDescription != "")
                    {
                        answers_grid.CheckAnswerCell(answerindex, kca[answerindex].SelectedCellDescription);
                    }
                });
                break;

            case EnumPTests.Leongard:
                LAnswers la = AnswersFactory.GetAnswersFromTestResult <LAnswers>(_testresult);
                Parallel.For(0, la.Count, answerindex =>
                {
                    if (la[answerindex].SelectedCellDescription != "")
                    {
                        answers_grid.CheckAnswerCell(answerindex, la[answerindex].SelectedCellDescription);
                    }
                });
                break;

            case EnumPTests.Modul2:
                MDAnswers ma = AnswersFactory.GetAnswersFromTestResult <MDAnswers>(_testresult);

                Parallel.For(0, ma.Count, answerindex =>
                {
                    if (ma[answerindex].SelectedCellDescription != "")
                    {
                        answers_grid.CheckAnswerCell(answerindex, ma[answerindex].SelectedCellDescription);
                    }
                });

                break;

            case EnumPTests.NPNA:
                NPNAnswers na = AnswersFactory.GetAnswersFromTestResult <NPNAnswers>(_testresult);
                Parallel.For(0, na.Count, answerindex =>
                {
                    if (na[answerindex].SelectedCellDescription != "")
                    {
                        answers_grid.CheckAnswerCell(answerindex, na[answerindex].SelectedCellDescription);
                    }
                });
                break;

            case EnumPTests.Prognoz:
                PAnswers pa = AnswersFactory.GetAnswersFromTestResult <PAnswers>(_testresult);
                Parallel.For(0, pa.Count, answerindex =>
                {
                    if (pa[answerindex].SelectedCellDescription != "")
                    {
                        answers_grid.CheckAnswerCell(answerindex, pa[answerindex].SelectedCellDescription);
                    }
                });
                break;
            }
        }