Пример #1
0
        /// <summary>
        /// 将实体转为为Select列表
        /// </summary>
        /// <param name="department"></param>
        /// <returns></returns>



        public static DataSelect ToViewModel(VIEW_MST_CATALOG catalog)
        {
            DataSelect item = new DataSelect();

            item.id    = catalog.CATALOG_CD;
            item.value = catalog.CATALOG_CD;
            item.text  = catalog.NAME;
            return(item);
        }
Пример #2
0
        public static DataSelect ToViewModel(VIEW_MST_CATEGORY category)
        {
            DataSelect item = new DataSelect();

            item.id    = category.CATE_CD;
            item.value = category.CATE_CD;
            item.text  = category.CATEGORY_NAME;
            return(item);
        }
Пример #3
0
        public static DataSelect ToEntity(VIEW_FW_MODULE module)
        {
            DataSelect item = new DataSelect();

            item.id       = module.MODULE_ID;
            item.text     = module.MODULE_NAME;
            item.value    = module.ICON;
            item.parentid = module.MODULE_PID;
            return(item);
        }
Пример #4
0
        public static IEnumerable <DataSelect> ToListModel(IEnumerable <VIEW_MST_CATALOG> list)
        {
            var selectList = new List <DataSelect>()
            {
                new DataSelect {
                    id = "", text = "顶级分类", value = ""
                }
            };

            foreach (var item in list)
            {
                selectList.Add(DataSelect.ToViewModel(item));
            }
            return(selectList);
        }