示例#1
0
文件: SchemaInfo.cs 项目: ewin66/Arya
        public ListOfValue AddLov(string value, string parentValue)
        {
            if (string.IsNullOrEmpty(value.Trim()))
            {
                return(null);
            }

            if (ActiveListOfValues.Any(val => val.Equals(value)))
            {
                var lov =
                    ListOfValues.FirstOrDefault(a => a.Active && a.Value.ToLower().Trim() == value.ToLower().Trim());

                if (lov == null)
                {
                    return(null);
                }

                if (lov.ParentValue.Trim().ToLower() != parentValue.Trim().ToLower())
                {
                    lov.ParentValue = parentValue;
                    return(lov);
                }
                return(lov);
            }
            var listOfValue = new ListOfValue {
                Value = value, ParentValue = parentValue
            };

            ListOfValues.Add(listOfValue);

            return(listOfValue);
        }
示例#2
0
文件: SchemaInfo.cs 项目: ewin66/Arya
        public ListOfValue AddLov(string value)
        {
            if (ActiveListOfValues.Any(val => val.Equals(value)))
            {
                return(null);
            }

            var listOfValue = new ListOfValue {
                Value = value
            };

            ListOfValues.Add(listOfValue);

            return(listOfValue);
        }