예제 #1
0
        private string GetOptionSet(string str_in, string str_fname, string str_fvalue)
        {
            string       str2    = "";
            OperatorType unknown = OperatorType.Unknown;
            ArrayList    list    = new ArrayList();

            foreach (PLMOperator @operator in SelectionOperator.GetOperator(this.curFieldAttr.DataType2))
            {
                if (str_in.Equals(@operator.OperName))
                {
                    str2    = str_fvalue;
                    unknown = @operator.OperType;
                }
            }
            switch (unknown)
            {
            case OperatorType.Equal:
                if ((this.curFieldAttr.DataType2 != PLMDataType.String) && (this.curFieldAttr.DataType2 != PLMDataType.Char))
                {
                    return(str_fname + " = " + str2);
                }
                return(str_fname + " = '" + str2 + "'");

            case OperatorType.NotEqual:
                return(str_fname + " <> " + str2);

            case OperatorType.LikeLeft:
                return(str_fname + " like '" + str2 + "*'");

            case OperatorType.Like:
                return(str_fname + " like '*" + str2 + "*'");

            case OperatorType.LikeRight:
                return(str_fname + " like '*" + str2 + "'");

            case OperatorType.Greater:
                return(str_fname + " > " + str2);

            case OperatorType.Less:
                return(str_fname + " < " + str2);

            case OperatorType.GreaterEqual:
                return(str_fname + " >= " + str2);

            case OperatorType.LessEqual:
                return(str_fname + " <= " + str2);
            }
            if ((this.curFieldAttr.DataType2 == PLMDataType.String) || (this.curFieldAttr.DataType2 == PLMDataType.Char))
            {
                return(str_fname + " = '" + str2 + "'");
            }
            return(str_fname + " = " + str2);
        }
예제 #2
0
        private void AddOperLst(DEMetaAttribute attr)
        {
            int       num  = 0;
            ArrayList list = new ArrayList();

            foreach (PLMOperator @operator in SelectionOperator.GetOperator(attr.DataType2))
            {
                if (num == 0)
                {
                    this.cmBox_oper.Text = @operator.OperName;
                }
                this.cmBox_oper.Properties.Items.Add(@operator.OperName);
                num++;
            }
        }