private static SelectList CreateTogetherTypes(TogetherTypeEnum SelectedType) { Dictionary <int, string> togetherTypes = new Dictionary <int, string>(); foreach (int i in Enum.GetValues(typeof(TogetherTypeEnum))) { togetherTypes.Add(i, Together.GetStringFromTogetherType((TogetherTypeEnum)i)); } return(new SelectList(togetherTypes, "Key", "Value", (int)SelectedType)); }
public static SelectList CreateTogetherTypesWithAll() { Dictionary <int, string> togetherTypes = new Dictionary <int, string>(); foreach (int i in Enum.GetValues(typeof(TogetherTypeWithAllEnum))) { if (i == 0) { togetherTypes.Add(0, "所有类型"); } else { togetherTypes.Add(i, Together.GetStringFromTogetherType((TogetherTypeEnum)i)); } } return(new SelectList(togetherTypes, "Key", "Value", (int)TogetherTypeWithAllEnum.All)); }