Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        public ListOfValue AddLov(string value, string parentValue, string enrichmentImage, string enrichmentCopy, int?displayOrder)
        {
            if (string.IsNullOrEmpty(value.Trim()))
            {
                return(null);
            }
            if (ActiveListOfValues.Any(val => val.Equals(value)))
            {
                return(null);
            }

            var listOfValue = new ListOfValue
            {
                Value           = value,
                ParentValue     = parentValue,
                EnrichmentImage = enrichmentImage,
                EnrichmentCopy  = enrichmentCopy,
                DisplayOrder    = displayOrder
            };

            ListOfValues.Add(listOfValue);

            return(listOfValue);
        }