Exemplo n.º 1
0
        public List <UserApplyUserResultDTO> GetUserApply(UserApplySearchDTO dto)
        {
            List <UserApplyUserResultDTO> result = null;
            var tcdmse = SingleQueryObject.GetObj();

            var pp = tcdmse.UserApply_UserApplyInfo.AsNoTracking().Where(p => p.AuditStatus == 0);

            if (dto != null)
            {
                if (!string.IsNullOrEmpty(dto.SearchText))
                {
                    pp = pp.Where(p => p.UserApplyName.Contains(dto.SearchText));
                }
                if (dto.RoleIDlist != null)
                {
                    pp = pp.Where(p => dto.RoleIDlist.Where(g => p.AuditRoleIDList.Contains(("," + (g ?? -1).ToString() + ","))).Count() > 0);
                }
                if (dto.UserApplyID != null)
                {
                    pp = pp.Where(p => p.UserApplyID == dto.UserApplyID);
                }
            }
            result = Mapper.Map <List <UserApply_UserApplyInfo>, List <UserApplyUserResultDTO> >(pp.ToList());

            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 查询申请的用户
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public List <UserApplyUserResultDTO> GetApplyUser(UserApplySearchDTO dto)
        {
            List <UserApplyUserResultDTO> result = null;
            var tcdmse = SingleQueryObject.GetObj();
            var pp     = tcdmse.UserApply_UserApplyInfo.AsNoTracking().Where(p => p.UserApplyID != null);

            if (dto.BatchID != null)
            {
                pp = pp.Where(p => p.BatchID == dto.BatchID);
            }

            result = Mapper.Map <List <UserApply_UserApplyInfo>, List <UserApplyUserResultDTO> >(pp.ToList());

            return(result);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 查询申请的批次
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public List <UserApplyBatchResultDTO> GetApplyBatchUser(UserApplySearchDTO dto)
        {
            List <UserApplyBatchResultDTO> result = null;
            var tcdmse = SingleQueryObject.GetObj();
            var pp     = tcdmse.UserApply_ApplyBatch.AsNoTracking().Where(p => p.AuditStatus == 0 || p.AuditStatus == 1 || p.AuditStatus == 3);

            if (dto.DistributorID != null)
            {
                pp = pp.Where(p => p.DistributorID.Contains(dto.DistributorID.Value.ToString()));
            }
            if (dto.BatchID != null)
            {
                pp = tcdmse.UserApply_ApplyBatch.AsNoTracking().Where(p => p.BatchID == dto.BatchID);
            }

            dto.Count = pp.Count();
            var aa = pp.OrderByDescending(o => o.CreateTime).ThenByDescending(t => t.BatchID).Skip((dto.page - 1) * dto.rows).Take(dto.rows).ToList();

            result = Mapper.Map <List <UserApply_ApplyBatch>, List <UserApplyBatchResultDTO> >(aa.ToList());

            return(result);
        }