Exemple #1
0
        public void SetTagValue(string tagName, string tagValue)
        {
            var tag = TicketTagValues.SingleOrDefault(x => x.TagName == tagName);

            if (tag == null)
            {
                tag = new TicketTagValue {
                    TagName = tagName, TagValue = tagValue
                };
                TicketTagValues.Add(tag);
            }
            else
            {
                tag.TagValue = tagValue;
            }

            if (string.IsNullOrEmpty(tag.TagValue))
            {
                TicketTagValues.Remove(tag);
            }

            TicketTags       = JsonHelper.Serialize(TicketTagValues);
            _ticketTagValues = null;
        }
Exemple #2
0
 public string GetTagData()
 {
     return(string.Join("\r", TicketTagValues.Where(x => !string.IsNullOrEmpty(x.TagValue)).Select(x => string.Format("{0}: {1}", x.TagName, x.TagValue))));
 }
Exemple #3
0
        public string GetTagValue(string tagName)
        {
            var tag = TicketTagValues.SingleOrDefault(x => x.TagName == tagName);

            return(tag != null ? tag.TagValue : "");
        }
Exemple #4
0
 public bool IsTaggedWithDefinedTags(IEnumerable <string> definedTags)
 {
     return(TicketTagValues.Any(x => definedTags.Contains(x.TagName) && !string.IsNullOrEmpty(x.TagValue)));
 }