Пример #1
0
        /// <summary>
        /// 验证当前页
        /// </summary>
        /// <returns></returns>
        private bool ValidateCurrentTabPage()
        {
            bool pass = XtabControlData.Validate(xtraTabControlMain.SelectedTabPage);

            if (!pass)
            {
                DXMessageBox.ShowWarning2("当前页存在输入有误的题目!\r\n请检查并修改!", this);
            }
            return(pass);
        }
Пример #2
0
        /// <summary>
        /// 加载问卷
        /// </summary>
        /// <param name="qc_id"></param>
        void LoadQuestionnaire(params string[] qc_id)
        {
            this.ShowWaitingPanel(() =>
            {
                var firstqc = qc_id == null || qc_id.Length == 0
                    ? TmoServiceClient.InvokeServerMethodT <List <tmo_questionnaire_category> >(
                    funCode.GetFistQuestionnaires, currentUser.user_id, _usertimes)
                    : TmoServiceClient.InvokeServerMethodT <List <tmo_questionnaire_category> >(
                    funCode.GetQuestionnaires, currentUser.user_id, _usertimes, qc_id);

                XtabControlData tabControlData = new XtabControlData(currentUser);
                tabControlData.Init(firstqc);
                controlData = tabControlData;
                return(tabControlData);
            }, x =>
            {
                XtabControlData tabControlData = x as XtabControlData;
                if (tabControlData != null)
                {
                    tabControlData.TagetToXTabControl(xtraTabControlMain);
                    btnSave.Enabled = true;
                    if (controlData.Status.questionnare_status == 0 && controlData.Status.questionnaire_time != default(DateTime) && !string.IsNullOrEmpty(controlData.Status.qc_ids))
                    {
                        DXMessageBox.ShowInfo(string.Format("已加载上次{0}暂存的问卷!", controlData.Status.questionnaire_time.ToFormatDateTimeStr()), this);
                    }
                    if (controlData.Status.questionnare_status == 1)
                    {
                        ReadOnly = true;
                        DXMessageBox.ShowInfo("当前问卷【已提交】,不能编辑修改,请进行评估。\n已自动切换到浏览模式!", this);
                    }
                    if (controlData.Status.questionnare_status == 2)
                    {
                        ReadOnly = true;
                        DXMessageBox.ShowInfo("当前问卷【已评估】,只能浏览。\n已自动切换到浏览模式!", this);
                    }
                    CheckButtonState(tabControlData.TabPages.Keys.FirstOrDefault());
                }
            }, "问卷拼命加载中"
                                  );
        }