public static string TextFor(string electionType) { var item = BaseItems.SingleOrDefault(i => i.Value == electionType); return(item == null ? "" : item._blankForDisplay ? "" : item.DisplayText); }
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); }
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)); }
public static string TextFor(string value, string defaultValue = "") { var item = BaseItems.SingleOrDefault(i => i.Value == value); return(item == null ? (defaultValue ?? value) : item.DisplayText); }
public static string MessageTypeAFor(string value, string defaultValue = "") { var item = BaseItems.SingleOrDefault(i => i.Value == value); return(item == null ? (defaultValue ?? value) : item.MessageTypeA); }
public static string DescriptionFor(Guid key) { var item = BaseItems.SingleOrDefault(i => i.Value == key); return(item == null ? "" : item.Description); }
/// <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); }
/// <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); }
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); }
/// <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); }