예제 #1
0
        public bool CheckLogic(string string_0)
        {
            bool flag = true;
            List <SurveyLogic> list = new List <SurveyLogic>();

            list = oSurveyLogicDal.GetCheckLogic(string_0);
            foreach (SurveyLogic item in list)
            {
                if (flag)
                {
                    string fORMULA = item.FORMULA;
                    if (Result(fORMULA))
                    {
                        Logic_Message = strShowText(item.LOGIC_MESSAGE, true);
                        Logic_Message = strShowText(Logic_Message, false);
                        NOTE          = item.NOTE;
                        IS_ALLOW_PASS = item.IS_ALLOW_PASS;
                        return(false);
                    }
                }
            }
            return(flag);
        }
예제 #2
0
        public bool CheckLogic(string string_0)
        {
            if (string_0 == "INFO_REC" && SurveyHelper.AutoFill)
            {
                return(true);
            }
            new List <SurveyLogic>();
            foreach (SurveyLogic item in oSurveyLogicDal.GetCheckLogic(string_0))
            {
                string fORMULA = item.FORMULA;
                if (oLogicEngine.boolResult(fORMULA))
                {
                    string string_ = oLogicEngine.strShowText(item.LOGIC_MESSAGE, true);
                    string_ = oLogicEngine.strShowText(string_, false);
                    string nOTE = item.NOTE;
                    switch (item.IS_ALLOW_PASS)
                    {
                    case 1:
                        if (!SurveyHelper.AutoFill && MessageBox.Show(string_ + Environment.NewLine + Environment.NewLine + SurveyMsg.MsgPassCheck, SurveyMsg.MsgCaption, MessageBoxButton.YesNo, MessageBoxImage.Asterisk, MessageBoxResult.No).Equals(MessageBoxResult.No))
                        {
                            return(false);
                        }
                        break;

                    case 3:
                        if (!SurveyHelper.AutoFill)
                        {
                            MessageBoxResult messageBoxResult = MessageBox.Show(string_ + Environment.NewLine + Environment.NewLine + SurveyMsg.MsgPassModifyCheck, SurveyMsg.MsgCaption, MessageBoxButton.YesNoCancel, MessageBoxImage.Asterisk, MessageBoxResult.Cancel);
                            if (messageBoxResult.Equals(MessageBoxResult.Yes))
                            {
                                SurveyHelper.QueryEditQn = nOTE;
                                EditAnswerSingle editAnswerSingle2 = new EditAnswerSingle();
                                editAnswerSingle2.oLogicEngine = oLogicEngine;
                                editAnswerSingle2.ShowDialog();
                                return(false);
                            }
                            if (messageBoxResult.Equals(MessageBoxResult.Cancel))
                            {
                                return(false);
                            }
                        }
                        break;

                    case 0:
                        MessageBox.Show(string_, SurveyMsg.MsgCaption, MessageBoxButton.OK, MessageBoxImage.Hand);
                        return(false);

                    case 2:
                        if (MessageBox.Show(string_ + Environment.NewLine + Environment.NewLine + SurveyMsg.MsgPassModify, SurveyMsg.MsgCaption, MessageBoxButton.YesNo, MessageBoxImage.Asterisk, MessageBoxResult.No).Equals(MessageBoxResult.Yes))
                        {
                            SurveyHelper.QueryEditQn = nOTE;
                            EditAnswerSingle editAnswerSingle = new EditAnswerSingle();
                            editAnswerSingle.oLogicEngine = oLogicEngine;
                            editAnswerSingle.ShowDialog();
                        }
                        return(false);
                    }
                }
            }
            return(true);
        }