예제 #1
0
        private void btnBefore_Click(object sender, EventArgs e)
        {
            QuestionOne frmBefore = new QuestionOne();

            frmBefore.TopMost = false;
            frmBefore.ShowDialog();
            this.Close();
        }
예제 #2
0
        private void btnLunYi_Click(object sender, EventArgs e)
        {
            M_QuestionnaireUserDetail result = null;

            if (Properties.Settings.Default.ActivityId > 0)
            {
                //同人同天同问卷做控制
                result = ClientInfo.AlreadyExistQuestionnaire(QuestionnaireCode.KangFuLunYi, loginInfo.UserId,
                                                              Properties.Settings.Default.ActivityId);
            }

            if (result != null)
            {
                //记录上次问卷Id
                Properties.Settings.Default.LastTimeQuestionnaireRecodId = result.QuestionnaireRecodId;
                Properties.Settings.Default.Save();

                string         str            = "会员" + LoginInfo.GetInstance().PatientAccount + "于" + result.AnswerTime + "参加本活动,完成了轮椅筛查。若继续筛查,则上一次筛查数据将被清除。请参考信息登记表,选择";
                QuitComfirmFrm quitComfirmFrm = new QuitComfirmFrm(new ScreeningSelect(), this, str);
                DialogResult   dr             = quitComfirmFrm.ShowDialog();
                if (dr == DialogResult.Cancel)
                {
                    return;
                }
            }
            else
            {
                //清空上次问卷Id
                Properties.Settings.Default.LastTimeQuestionnaireRecodId = 0;
                Properties.Settings.Default.Save();
            }

            var screeningSelect = new ScreeningSelect();

            var frmNext       = new LunYi.QuestionOne();
            var questionnaire = new Model.M_QuestionnaireUserDetail();

            questionnaire.QuestionnaireCode   = QuestionnaireCode.KangFuLunYi;
            questionnaire.QuestionnaireName   = QuestionnaireCode.KangFuLunYiName;
            questionnaire.UserId              = loginInfo.UserId;
            questionnaire.FamilyMemberID      = loginInfo.FamilyMemberID;
            questionnaire.QuestionnaireStatus = 0;
            questionnaire.ActivityId          = Settings.Default.ActivityId;
            questionnaire.QuestionnaireScore  = 0;
            questionnaire.QuestionnaireType   = 0;
            questionnaire.ActivityName        = Settings.Default.ActivityName;
            questionnaire.AnswerTime          = DateTime.Now;

            ClientInfo.AddQuestionnaire(questionnaire);
            if (loginInfo.UserId > -2)
            {
                //如果已经登录,则先判断本次登录是否已经做过此问卷,否则产生用户的回答记录。

                //选择了轮椅问卷,则在添加一条问卷记录。
                frmNext.TopMost = false;
                frmNext.Show();

                Close();
            }
            else
            {
                //LoginForm frmLogin = new LoginForm(frmNext);
                //LoginForm frmLogin = new LoginForm(screeningSelect);
                //frmLogin.Show();
                //Hide();

                //新的登录
                var frmLoginFormNew = new LoginFormNew(screeningSelect);
                frmLoginFormNew.Show();
                Hide();
            }
        }