Exemplo n.º 1
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);
        }