示例#1
0
文件: FlowHelper.cs 项目: radtek/ITMS
        public static IList <SelectListItem> GetTypeSelectList(string typeName)
        {
            if (!BasicTypeList.Select(t => t.Text).Contains(typeName))
            {
                throw new ArgumentException("无效的类型名称");
            }
            var  type = BasicTypeList.First(t => t.Text == typeName);
            long count;
            var  list = new MongoBll <BasicType>().GetList(out count, 1, 50);

            return(list.Where(t => t.TypeId == int.Parse(type.Value)).Select(t => new SelectListItem
            {
                Text = t.Name,
                Value = t.Num.ToString()
            }).ToList());
        }