Esempio n. 1
0
        public static string TextFor(string electionType)
        {
            var item = BaseItems.SingleOrDefault(i => i.Value == electionType);

            return(item == null ? "" :
                   item._blankForDisplay ? "" : item.DisplayText);
        }
Esempio n. 2
0
        public static IneligibleReasonEnum GetFor(string description)
        {
            var item = BaseItems.SingleOrDefault(i => i.Description.Equals(description.Trim(), StringComparison.InvariantCultureIgnoreCase));

            if (item == null)
            {
                return(null);
            }
            return(item);
        }
Esempio n. 3
0
        public static string TextFor(string value, string defaultValue = "")
        {
            var item = BaseItems.SingleOrDefault(i => i.Value == value);

            if (item == null)
            {
                return(defaultValue ?? value);
            }

            return(TextFor(item));
        }
Esempio n. 4
0
        public static string TextFor(string value, string defaultValue = "")
        {
            var item = BaseItems.SingleOrDefault(i => i.Value == value);

            return(item == null ? (defaultValue ?? value) : item.DisplayText);
        }
Esempio n. 5
0
        public static string MessageTypeAFor(string value, string defaultValue = "")
        {
            var item = BaseItems.SingleOrDefault(i => i.Value == value);

            return(item == null ? (defaultValue ?? value) : item.MessageTypeA);
        }
Esempio n. 6
0
        public static string DescriptionFor(Guid key)
        {
            var item = BaseItems.SingleOrDefault(i => i.Value == key);

            return(item == null ? "" : item.Description);
        }
Esempio n. 7
0
 /// <summary>
 /// Get the reason matching this guid. If null or not matched, returns null.
 /// </summary>
 /// <param name="guid"></param>
 /// <returns></returns>
 public static IneligibleReasonEnum Get(Guid?guid)
 {
     return(guid.HasValue ? BaseItems.SingleOrDefault(i => i.Value == guid.Value) : null);
 }
Esempio n. 8
0
 /// <Summary>Find the status that matches this string. If not found, default to something... use Review needed.</Summary>
 public static BallotStatusEnum Parse(string code)
 {
     return(BaseItems.SingleOrDefault(i => i.Value == code) ?? Verify);
 }
Esempio n. 9
0
        public static string TextFor(string status)
        {
            var item = BaseItems.SingleOrDefault(i => i.Value == status);

            return(item == null ? NotStarted : item.DisplayText);
        }
        public static string TextFor(string status, string defaultText = null)
        {
            var item = BaseItems.SingleOrDefault(i => i.Value == status);

            return(item == null ? (defaultText.HasContent() ? defaultText : NotStarted) : item.DisplayText);
        }
Esempio n. 11
0
 /// <Summary>Find the status that matches this string. If not found, default to something... use Review needed.</Summary>
 public static OnlineBallotStatusEnum Parse(string code)
 {
     return(BaseItems.SingleOrDefault(i => i.Value == code) ?? New);
 }