Exemplo n.º 1
0
        public List <TheCategoryVo> getLessVoList(List <TheCategoryEntity> entityList, List <int> keys)
        {
            if (entityList == null || entityList.Count == 0)
            {
                return(null);
            }

            List <TheCategoryVo> voList = new List <TheCategoryVo>();

            foreach (TheCategoryEntity entity in entityList)
            {
                if (!keys.Contains(entity.CategoryId))
                {
                    continue;
                }

                TheCategoryVo vo = toVo(entity);
                vo.Selected = true;
                voList.Add(vo);

                if (voList.Count == keys.Count)
                {
                    break;
                }
            }

            return(voList);
        }
Exemplo n.º 2
0
        public TheCategoryVo toVo(TheCategoryEntity entity)
        {
            TheCategoryVo vo = new TheCategoryVo();

            vo.CategoryId   = entity.CategoryId;
            vo.CategoryName = entity.CategoryName;

            return(vo);
        }
Exemplo n.º 3
0
        public List <TheCategoryVo> getVoList(List <TheCategoryEntity> entityList)
        {
            if (entityList == null || entityList.Count == 0)
            {
                return(null);
            }

            List <TheCategoryVo> voList = new List <TheCategoryVo>();

            foreach (TheCategoryEntity entity in entityList)
            {
                TheCategoryVo vo = toVo(entity);
                voList.Add(vo);
            }

            return(voList);
        }
Exemplo n.º 4
0
        public List <TheCategoryVo> getMoreVoList(List <TheCategoryEntity> entityList, List <int> keys)
        {
            if (entityList == null || entityList.Count == 0)
            {
                return(null);
            }

            List <TheCategoryVo> voList = new List <TheCategoryVo>();

            foreach (TheCategoryEntity entity in entityList)
            {
                TheCategoryVo vo = toVo(entity);
                if (keys.Contains(entity.CategoryId))
                {
                    vo.Selected = true;
                }
                voList.Add(vo);
            }

            return(voList);
        }