| | |
| | | containerInfos = orderContainers; |
| | | if (containerInfos.Count == 1) |
| | | { |
| | | Dt_Container container = Db.Queryable<Dt_Container>().First(x => x.ContainerStatus == ContainerStatusEnum.Empty.ObjToInt()); |
| | | Dt_Container container = Db.Queryable<Dt_Container>().OrderBy(x => x.ContainerSort).First(x => x.ContainerStatus == ContainerStatusEnum.Empty.ObjToInt()); |
| | | if (container != null) |
| | | { |
| | | Dt_OrderContainer containerInfo = _mapper.Map<Dt_OrderContainer>(container); |
| | |
| | | } |
| | | else |
| | | { |
| | | List<Dt_Container> containers = Db.Queryable<Dt_Container>().Where(x => x.ContainerStatus == ContainerStatusEnum.Empty.ObjToInt()).Take(2).ToList(); |
| | | if (containers != null && containers.Count > 0) |
| | | Dt_Container container = Db.Queryable<Dt_Container>().OrderBy(x => x.ContainerSort).First(x => x.ContainerStatus == ContainerStatusEnum.Empty.ObjToInt()); |
| | | if (container != null) |
| | | { |
| | | containerInfos = _mapper.Map<List<Dt_OrderContainer>>(containers); |
| | | containerInfos = _mapper.Map<List<Dt_OrderContainer>>(container); |
| | | } |
| | | } |
| | | |