コード例 #1
0
ファイル: CommonDataService.cs プロジェクト: Nilker/Account
        public List <CompanyInfoDto> CompanyInfos()
        {
            var companyInfoDtos = _companyInfoRepository.WhereOrderSelect(s => s.Status == 0, s => s.ID, s => new CompanyInfoDto()
            {
                CompanyCode = s.CompanyCode,
                CompanyName = s.CompanyName,
                CompanyType = s.CompanyType
            }).ToList();

            return(companyInfoDtos);
        }
コード例 #2
0
ファイル: CommonDataService.cs プロジェクト: Nilker/Account
        public List <DicInfoDto> GetDicInfos(int dicType = -1)
        {
            Expression <Func <DictInfo, bool> > expression = s => s.Status == 0;

            if (dicType != -1)
            {
                expression = expression.And(s => s.DictType == dicType);
            }

            var models = _dicRepository.WhereOrderSelect(expression, s => s.OrderNum, s => new DicInfoDto()
            {
                DictId   = s.DictID,
                DictName = s.DictName,
                DictType = s.DictType
            }).OrderBy(s => s.DictId).ToList();

            return(models);
        }
コード例 #3
0
ファイル: CommonDataService.cs プロジェクト: Nilker/Account
        public List <RelevanceDto> GetRelevanceInfos(int type, int mainType = 0)
        {
            Expression <Func <Relevance, bool> > expression = s => s.Status == 0;

            if (type != 0)
            {
                expression = expression.And(s => s.Type == type);
            }

            if (mainType != 0)
            {
                var tem = mainType.ToString();
                expression = expression.And(s => s.MainType == tem);
            }

            var models = _relevanceRepository.WhereOrderSelect(expression, s => s.Type, s => new RelevanceDto()
            {
                Key   = s.SubType,
                Value = s.Remark,
                Type  = s.Type
            }).OrderBy(s => s.Key).ToList();

            return(models);
        }