Exemple #1
0
        public List <DepartmentDto> GetDepartmentDto(ProtocolQueryDepartment query)
        {
            PredicateGroup group = new PredicateGroup();

            if (!string.IsNullOrEmpty(query.DepartmentId))
            {
                group.Predicates.Add(Predicates.Field <Department>(d => d.Id, Operator.Eq, query.DepartmentId));
            }
            if (!string.IsNullOrEmpty(query.OrganizeId))
            {
                group.Predicates.Add(Predicates.Field <Department>(d => d.OrganizationId, Operator.Eq, query.OrganizeId));
            }
            if (!string.IsNullOrEmpty(query.DepartmentName))
            {
                group.Predicates.Add(Predicates.Field <Department>(d => d.Name, Operator.Eq, query.DepartmentName));
            }
            return(Unit.DepartmentRepository.GetDepartment(group, query.Query).ToListDto <Department, DepartmentDto>().ToList());
        }
 public List <DepartmentDto> GetDepartment(ProtocolQueryDepartment query)
 {
     return(departmentService.GetDepartmentDto(query));
 }