示例#1
0
        private void exitDigitSynbol()
        {
            _time_test.Stop();
            OutputDigitSymbol ods = new OutputDigitSymbol();

            if (!Directory.Exists(FEITStandard.GetRepotOutputPath()))
            {
                Directory.CreateDirectory(FEITStandard.GetRepotOutputPath());
            }

            ods.Output(FEITStandard.GetRepotOutputPath() + "DigitSymbol\\" +
                       mMainWindow.mDemography.GenBriefString() + ".txt",
                       ref mListener.mEvalue, ref mTimer);

            //PCATDataSaveReport();
            mMainWindow.TestForward();
            //mMainWindow.TestForward(); 版本四中若要提示测试结束 则隐去
        }
示例#2
0
        public void callbackStartTest(String message)
        {
            //mMW.mTestAt = 0;
            mbSet = true;

            //parse message to keep server information and make a testList
            if (mMW.mVersion == PCATData.VERSION.CLIENT)
            {
                //server
                Regex           rex = new Regex("[^\t]+");
                MatchCollection mts = rex.Matches(message);
                mMW.mConnInfo =
                    new PCATData.ConnectionInfo(
                        mts[1].Value, mts[2].Value, mts[3].Value, mts[4].Value, mts[5].Value);

                //user id
                mMW.mUserID = long.Parse(mts[6].Value);

                //testList
                mMW.mTestList = new List <TestType>();
                for (int i = 7; i < mts.Count; i++)
                {
                    mMW.mTestList.Add(
                        (TestType)FEITStandard.GetTestIndexByName(mts[i].Value));
                }
            }

            if (mMW.mVersion == VERSION.STANDALONE)
            {
                mMW.mDB = new PCATTableRoutine(PCATData.Names.SQLitePath);
            }
            else if (mMW.mVersion == VERSION.CLIENT)
            {
                mMW.mDB = new PCATTableRoutine(mMW.mConnInfo, VERSION.CLIENT);
            }

            //register standalone
            if (mMW.mVersion == VERSION.STANDALONE)
            {
                TextRange txtRange = new TextRange(amRichNote.Document.ContentStart, amRichNote.Document.ContentEnd);
                int       age      = -1;
                if (int.TryParse(amTBAge.Text, out age) &&
                    !String.IsNullOrEmpty(amTBName.Text) && !String.IsNullOrWhiteSpace(amTBName.Text))
                {
                    String   time = "";
                    DateTime dt   = DateTime.Now;
                    time = dt.Year.ToString() + dt.Month.ToString().PadLeft(2, '0') +
                           dt.Day.ToString().PadLeft(2, '0') + dt.Hour.ToString().PadLeft(2, '0') +
                           dt.Minute.ToString().PadLeft(2, '0') + dt.Second.ToString().PadLeft(2, '0');

                    mMW.mDemography           = new StDemography();
                    mMW.mDemography.Name      = removeQuot(amTBName.Text);
                    mMW.mDemography.Age       = age;
                    mMW.mDemography.Gender    = (String)((ComboBoxItem)amComboGender.SelectedItem).Content;
                    mMW.mDemography.Health    = (String)((ComboBoxItem)amComboHealth.SelectedItem).Content;
                    mMW.mDemography.Education = (String)((ComboBoxItem)amComboBoxEdu.SelectedItem).Content;
                    mMW.mDemography.Job       = (String)((ComboBoxItem)amComboJob.SelectedItem).Content;
                    mMW.mDemography.Time      = time;

                    //SQLite

                    /* StUserRegisterFeedback fb = mMW.mDB.AddUser(removeQuot(amTBName.Text),
                     *       removeQuot((String)((ComboBoxItem)amComboGender.SelectedItem).Content),
                     *       age,
                     *       removeQuot((String)((ComboBoxItem)amComboHealth.SelectedItem).Content),
                     *       removeQuot(amTBEduBG.Text),
                     *       removeQuot((String)((ComboBoxItem)amComboJob.SelectedItem).Content),
                     *       removeQuot(txtRange.Text));
                     *
                     * mMW.mUserID = fb.id;
                     * mMW.GoToTest(mMW.mTestList[mMW.mTestAt]);*/
                    this.DialogResult = true;
                    this.Close();
                }
                else
                {
                    MessageBox.Show(
                        "须输入整数作为年龄并填写名字", "信息",
                        MessageBoxButton.OK, MessageBoxImage.Information);
                }
            }
            else if (mMW.mVersion == VERSION.CLIENT)
            {
                mMW.TestForward();
                this.Close();
            }
        }