/// <summary> /// Helper method for converting a prayer category ID to its name /// </summary> public string PrayerIdToCategory(int categoryId) { // guard against old, bad values. KeyValuePair <string, int> categoryObj = PrayerCategories.Find(c => c.Value == categoryId); return(string.IsNullOrWhiteSpace(categoryObj.Key) == false ? categoryObj.Key : string.Empty); }
/// <summary> /// Helper method for converting a prayer category name to its ID /// </summary> public int PrayerCategoryToId(string categoryName) { KeyValuePair <string, int> categoryObj = PrayerCategories.Find(c => c.Key == categoryName); return(string.IsNullOrWhiteSpace(categoryObj.Key) == false ? categoryObj.Value : -1); }