123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using IMCS.CCS.Entitys;
- using IMCS.CCS.Repository;
- using IMCS_CCS.Entitys;
- using System.Collections.Generic;
- using System.Linq;
- namespace IMCS_CCS.Repository
- {
- public class CcsActionDeviceSourceCheckRepository : ICcsActionDeviceSourceCheckRepository
- {
- private readonly CcsContext _context;
- public CcsActionDeviceSourceCheckRepository(CcsContext context)
- {
- _context = context;
- }
- public List<CcsActionDeviceSourceCheck> GetList(CcsActionDeviceSourceCheck vo)
- {
- IQueryable<CcsActionDeviceSourceCheck> actions = _context.CcsActionDeviceSourceCheck;
- if (vo.Enable == null)
- {
- vo.Enable = 1;
- }
- actions = actions.Where(x => x.Enable == vo.Enable);
- if (vo.ActionId != null)
- {
- actions = actions.Where(x => x.ActionId == vo.ActionId);
- }
- if (!string.IsNullOrEmpty(vo.Type))
- {
- actions = actions.Where(x => x.Type == vo.Type);
- }
- if (!string.IsNullOrEmpty(vo.DeviceCode))
- {
- actions = actions.Where(x => x.DeviceCode == vo.DeviceCode);
- }
- if (!string.IsNullOrEmpty(vo.DeviceSource))
- {
- actions = actions.Where(x => x.DeviceSource == vo.DeviceSource);
- }
- List< CcsActionDeviceSourceCheck > aa = actions.OrderBy(x => x.CheckSort).ToList();
- return aa;
- }
- }
- }
|