Esempio n. 1
0
        public bool Check(Kooboo.Data.Context.DataContext context)
        {
            var value = context.GetValue(this.LeftExpression);

            if (value == null)
            {
                return(false);
            }

            var valuetype = value.GetType();

            if (valuetype == typeof(Int32) || valuetype == typeof(Int16) || valuetype == typeof(Int64) || valuetype == typeof(byte))
            {
                var intvalue = (int)value;

                int comparevalue;

                if (int.TryParse(this.RightValue, out comparevalue))
                {
                    return(intvalue > comparevalue);
                }
                else
                {
                    return(false);
                }
            }


            return(false);
        }
Esempio n. 2
0
        public bool Check(Kooboo.Data.Context.DataContext context)
        {
            var value = context.GetValue(this.LeftExpression);

            if (value == null)
            {
                return(false);
            }

            string stringvalue = value.ToString().ToLower();

            if (stringvalue == this.RightValue)
            {
                return(false);
            }

            if (value.GetType() == typeof(bool))
            {
                bool boolrightvalue = false;

                if (string.IsNullOrWhiteSpace(this.RightValue) || this.RightValue.ToLower() == "true" || this.RightValue == "1" || this.RightValue.ToLower() == "yes" || this.RightValue.ToLower() == "ok")
                {
                    boolrightvalue = true;
                }

                var boolvalue = (bool)value;

                if (boolvalue == boolrightvalue)
                {
                    return(false);
                }
            }

            return(true);
        }
Esempio n. 3
0
        public bool Check(Kooboo.Data.Context.DataContext context)
        {
            var value = context.GetValue(LeftExpression);

            if (value == null)
            {
                return(false);
            }
            var stringvalue = value.ToString();

            return(stringvalue.StartsWith(this.RightValue));
        }