Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
        }